Skip to content

feat: Add project-specific MCP server detection#2

Open
gvago wants to merge 2 commits into
jacobycwang:mainfrom
gvago:main
Open

feat: Add project-specific MCP server detection#2
gvago wants to merge 2 commits into
jacobycwang:mainfrom
gvago:main

Conversation

@gvago
Copy link
Copy Markdown

@gvago gvago commented Sep 10, 2025

Summary

Adds support for detecting and displaying project-specific MCP servers from .mcp.json files alongside global servers, providing users with a complete view of their MCP server configuration.

Changes Made

Core Functionality

  • New readProjectMcpConfig(): Reads .mcp.json from current working directory
  • Enhanced getAllMcpServers(): Now returns {active, disabled, project} instead of just {active, disabled}
  • Project server detection: Automatically finds and displays project-specific servers

UI Improvements

  • Visual distinction: Project servers show with 📁 folder icon and "(project - read-only)" label
  • Read-only state: Project servers are disabled in the checkbox interface (cannot be toggled)
  • Smart sorting: Project servers appear at bottom of list for better organization
  • Updated messaging: Error messages now mention .mcp.json alongside other config files

Implementation Details

  • Non-destructive: Project servers are never modified, only displayed
  • Filtered from management: Project servers are excluded from toggle operations
  • Type safety: Added optional disabled property to ServerToggleItem interface

Testing

Tested in a real project with .mcp.json containing:

{
  "mcpServers": {
    "supabase": {
      "command": "npx",
      "args": ["-y", "@supabase/mcp-server-supabase@latest", "--project-ref=..."]
    }
  }
}

Result: Successfully displays all servers with clear visual distinction:

  • ✅ Global servers (toggleable)
  • 📁 Project servers (read-only)

Benefits

  1. Complete visibility: Users can see all MCP servers (global + project) in one view
  2. No confusion: Clear labeling prevents accidental management attempts
  3. Respects architecture: Project servers remain managed by Claude Code
  4. Backward compatible: Existing functionality unchanged
  5. Zero breaking changes: All existing workflows continue to work

Use Case

This addresses the common scenario where developers have:

  • Global MCP servers (archon, playwright, shadcn-ui) managed via claude-ext
  • Project-specific servers (supabase with credentials) managed via Claude Code's .mcp.json

Now users get a unified view while respecting the appropriate management boundaries.

Resolves #1

Guy Vago added 2 commits September 10, 2025 09:01
- Add readProjectMcpConfig() to read .mcp.json files
- Display project servers in UI with folder icon and read-only label
- Filter project servers from toggle operations (read-only)
- Sort project servers at bottom of list
- Update error messages to include .mcp.json
- Add disabled property to ServerToggleItem type

Resolves: Shows complete MCP server state across global and project configs
while keeping project servers managed by Claude Code.
- Remove disabled state from project servers in UI
- Allow navigation to project servers with arrow keys
- Enable toggling project servers with spacebar
- When selected: copy project server to global ~/.claude.json
- When unselected: remove from global config (stays in .mcp.json)
- Show visual indicator when project server is active globally
- Project .mcp.json files are never modified (read-only source)

This provides complete MCP server management capabilities:
- Global servers: full toggle between active/disabled states
- Project servers: toggle between inactive/active-globally states
- Unified interface for all MCP server types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Project-specific MCP Server Enable/Disable

1 participant