Skip to content

Repo MCP dialog ignores directory-level MCP status when default config has no mcp #130

@GammelSami

Description

@GammelSami

In a repo, the "MCP for This Location" dialog can show:

Image

even when directory-level MCP servers exist and are active for that repo.

Reproduce

  1. Use a repo that has project-level MCP config (e.g. in repo config), while global/default config has no mcp section.
  2. Open repo page -> MCP dialog ("MCP for This Location").
  3. Observe empty state ("No MCP servers configured globally").
  4. Verify backend/OpenCode returns directory MCP status for that repo directory (e.g. /mcp?directory=<repoPath> is non-empty).

Expected

Repo MCP dialog should show servers relevant for that repo/directory, even if global default config has no mcp.

Actual

Dialog derives server list from global/default config and shows empty state, despite directory-level MCP status existing.

Suspected cause

RepoMcpDialog uses config.content.mcp from default config to build serverIds, instead of deriving from repo-assigned config and/or directory-scoped MCP status.

Suggested fix

  • Resolve config by repo (repo.openCodeConfigName) rather than always default.
  • Build displayed server list from union of:
    • configured MCP servers for the repo config
    • keys from directory-scoped MCP status response
  • Adjust empty-state text to distinguish "no global MCP configured" vs "no MCP for this repo".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions