-
Notifications
You must be signed in to change notification settings - Fork 13
Multi-Client MCP Configuration Support #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
butschster
merged 8 commits into
context-hub:main
from
savinmikhail:feature/multi-client-config-support
Oct 4, 2025
Merged
Multi-Client MCP Configuration Support #270
butschster
merged 8 commits into
context-hub:main
from
savinmikhail:feature/multi-client-config-support
Oct 4, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
codex output: ❯ ./ctx mcp:config -i
MCP Configuration Generator
===========================
This tool generates configuration snippets for connecting CTX to MCP clients like Claude Desktop.
It automatically detects your operating system and generates the appropriate configuration format.
Interactive Configuration Mode
------------------------------
Let's configure your MCP client step by step...
Which MCP client are you configuring? [Claude Desktop]:
[claude ] Claude Desktop
[codex ] Codex
[cursor ] Cursor
[generic] Generic MCP Client
> codex
Environment Detection
---------------------
------------------ --------
Operating System macOS
PHP OS Darwin
Architecture arm64
------------------ --------
How do you want to configure project access? [Use global project registry (switch between projects dynamically)]:
[global ] Use global project registry (switch between projects dynamically)
[specific] Use specific project path (single project)
> global
Do you need to configure environment variables (e.g., GitHub token)? (yes/no) [no]:
>
Generated Configuration
-----------------------
Codex configuration (TOML):
[mcp_servers.ctx]
command = "ctx"
args = ["server"]
Setup Instructions
------------------
1. Copy the TOML snippet above to your Codex MCP client configuration.
2. Ensure the `ctx` binary is available in your PATH.
3. Restart the Codex client and verify the MCP server connection.
generator on feature/mult…nfig-support ❯
|
claude example Generated Configuration
-----------------------
Configuration type: claude
Operating system: macOS
Project mode: Global project registry
Command: ctx server
Add this configuration to your Claude Desktop config file:
{
"mcpServers": {
"ctx": {
"command": "ctx",
"args": [
"server"
]
}
}
}
Claude Desktop configuration file location:
• ~/Library/Application Support/Claude/claude_desktop_config.json
Setup Instructions
------------------
To set up Claude Desktop with CTX:
1. Close Claude Desktop if it's running
2. Open the Claude Desktop configuration file (see paths above)
3. If the file doesn't exist, create it with the generated configuration
4. If the file exists, merge the "mcpServers" section with your existing configuration
5. Save the file and restart Claude Desktop
6. You should see CTX listed in the MCP servers when you start a new conversation
! [NOTE] Global project registry configuration:
!
! • This configuration uses CTX's project registry system
!
! • You can switch between different registered projects dynamically
!
! • Use "ctx project:add" to register projects first
!
! • Good for multi-project workflows
Troubleshooting Tips
--------------------
If Claude doesn't show CTX as available:
• Check that the configuration file syntax is valid JSON
• Verify that the CTX binary is installed and accessible
• Check the Claude Desktop logs for any error messages
• Try restarting Claude Desktop completely
! [NOTE] For more help:
!
! • Visit the CTX documentation at https://context-hub.github.io/generator/
!
! • Check the MCP server documentation for troubleshooting guides
!
! • Join the community discussions on GitHub
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
console:cli
Console commands and CLI interface
enhancement
New feature or request
mcp
MCP server components
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds interactive multi‑client support to
ctx mcp:config
, enabling users to generate client‑specific MCP configurations for Claude Desktop, Codex, Cursor, and Generic clients. Updates documentation to reflect the new interactive flow and that CTX works with multiple MCP clients, not only Claude.Initial issue: see #267
Motivation
The MCP ecosystem now includes several clients. Previously,
ctx mcp:config
assumed Claude Desktop. This change introduces a client selection experience and explicit flags so users can set up their preferred MCP client quickly and correctly.What’s included
CLI: Interactive mode and client selection
-i, --interactive
guided setup with OS detection, project selection, and client choice-c, --client=claude|codex|cursor|generic
explicit non‑interactive selection-e, --explain
prints client‑specific setup instructions-p, --project-path
and-g, --global/--no-global
to choose project scoping-f, --wsl
to force WSL mode on WindowsArchitecture: Strategy + registry for client‑specific config
src/McpServer/McpConfig/Client/ClientStrategyRegistry.php
src/McpServer/McpConfig/Client/ClientStrategyInterface.php
src/McpServer/McpConfig/Client/AbstractClientStrategy.php
src/McpServer/McpConfig/Client/ClaudeDesktopClientStrategy.php
src/McpServer/McpConfig/Client/CodexClientStrategy.php
src/McpServer/McpConfig/Client/CursorClientStrategy.php
src/McpServer/McpConfig/Client/GenericClientStrategy.php
Command integration
src/McpServer/Console/McpConfigCommand.php
: integrates interactive flow, strategy registry, and flagsDocs update
README.md
:223 — renamed section to “Connect to an MCP Client (Optional)” and documentedctx mcp:config -i
README.md
:130 — Quick Start updated to mention multiple MCP clients (Claude Desktop, Cursor, Continue, Windsurf)Usage
Interactive (recommended):
Non‑interactive examples:
Additional options:
Validation
ctx mcp:config -i
and verified:--explain
shows client‑specific instructionsNotes on defaults
--client
, the command generates a Generic MCP configuration. Use--client=claude
to mirror Claude‑specific defaults.Screenshots/Examples (text)
command
andargs
.Checklist
Related files