Connecting MCP to Clients
Wire the same server into Claude Code, Cursor, and Codex.
One server, many clients. Here's the exact config for the big three.
Claude Code
claude mcp add github -- npx -y @modelcontextprotocol/server-github
Or edit .mcp.json in your project root:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "..." }
}
}
}
Check what's connected with claude mcp list.
Cursor
Settings β MCP β Add new MCP server, then fill in:
- Name:
github - Type:
command - Command:
npx -y @modelcontextprotocol/server-github
(Access tokens go in the env/secret fields.)
Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
env = ["GITHUB_PERSONAL_ACCESS_TOKEN=..."]
Verify it worked
Ask each client a question that requires the tool:
How many open issues does the repo "owner/repo" have?
If the client can answer, the server is connected and the model is actually calling it.
Troubleshooting checklist
- Is the server runnable by hand? (
npx -y @modelcontextprotocol/server-githubshouldn't crash.) - Are paths absolute? Clients don't always inherit your shell's
$PATHor cwd. - Did you restart the client after editing config?
- Is the API key in
env, not in the command string?
.mcp.json checked into a repo is the modern pattern β your whole team gets the same tools automatically.