How to add MCP servers to your coding agent: commands, config files and fixes
You found an MCP server you want, maybe from our MCP servers worth knowing list. Now you need to plug it in. Every client does this a bit differently: Claude Code, Codex and Gemini CLI have an mcp add command, Cursor and VS Code use JSON files, and Codex stores its config in TOML. Below are the commands and file locations for each client, taken from their own docs, then how to test a server before your agent touches it and how to fix the usual problems.
MCP servers use one of two transports. Stdio runs the server as a local process on your machine and typically serves a single client. Streamable HTTP connects to a server at a URL, supports standard HTTP auth such as bearer tokens, API keys and custom headers, and typically serves many clients. The current spec release is dated July 28, 2026.
Add it with · config file:claude mcp add · ~/.claude.json (local and user scopes) or .mcp.json at the project root (project scope)
# Remote (HTTP) server
claude mcp add --transport http notion https://mcp.notion.com/mcp
# Local (stdio) server: everything after -- goes to the server untouched
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-server
# Manage
claude mcp list
claude mcp get <name>
claude mcp remove <name>
Scopes: local is the default and private to you in that project. project writes .mcp.json so the whole team gets it through git. user is private to you and loads in every project. Add --scope project or --scope user to change it.
Inside a session, /mcp shows status and handles OAuth sign-in. Already set up Claude Desktop? claude mcp add-from-claude-desktop imports its servers.
Claude Code prompts for approval in interactive sessions before using project-scoped servers from .mcp.json. Its docs say claude -p runs and Agent SDK sessions load them without asking.
Our take: Use project scope for servers that need no secrets, and local or user scope for anything that uses a token.
Add it with · config file:codex mcp add · ~/.codex/config.toml, or .codex/config.toml in a trusted project
# Local (stdio) server
codex mcp add context7 -- npx -y @upstash/context7-mcp
# Remote server, then sign in if it uses OAuth
codex mcp add <name> --url https://mcp.example.com
codex mcp login <name>
codex mcp list
In TOML, each server is a [mcp_servers.<name>] table. Local servers use command, args and env; remote servers use url, and optionally bearer_token_env_var or http_headers.
Add it with · config file: Command Palette → MCP: Add Server · ~/.copilot/mcp-config.json (Global > Copilot) or a workspace-root .mcp.json
The guided flow asks for a server URL (HTTP or SSE) or a launch command (stdio). It can also generate a config from an npm package, pip package or Docker image name, and shows the publisher for you to confirm first.
A workspace-root .mcp.json needs the experimental chat.mcp.workspaceRootConfig.enabled setting. The older .vscode/mcp.json and user-profile mcp.json still work and are labeled deprecated in the guided flow.
Format gotcha: portable files use a top-level mcpServers object, while the VS Code format uses servers. Check which one before you copy a config across.
Our take: Copilot's Free plan already includes MCP in agent mode, so you can try all of this at no cost.
Add it with · config file:gemini mcp add · .gemini/settings.json (project, the default) or ~/.gemini/settings.json (user, with -s user)
gemini mcp add [options] <name> <commandOrUrl> [args...]
# Remote server over HTTP
gemini mcp add -t http my-server https://mcp.example.com/mcp
gemini mcp list
The transport defaults to stdio; use -t http or -t sse for remote servers. --include-tools and --exclude-tools limit which tools load, and --timeout sets the connection timeout in milliseconds.
--trust bypasses all tool call confirmation prompts, so use it only for servers you fully trust.
In settings.json, command is for stdio, url for SSE and httpUrl for Streamable HTTP. /mcp shows server status, and gemini mcp enable, disable and remove manage servers.
Our take: Leave --trust off. The confirmation prompts are your safety net.
Add it with · config file: MCP Servers icon → Configure (IDE), or ~/.cline/data/settings/cline_mcp_settings.json (CLI)
In the IDE, the Remote Servers tab takes a name and URL, and offers Streamable HTTP (recommended) or SSE (legacy).
In the JSON file, servers go under mcpServers. The CLI path can be changed with the CLINE_MCP_SETTINGS_PATH environment variable, and cline mcp opens a setup wizard.
The README says it stores secrets such as OAuth tokens in the OS keychain by default. On machines with no keychain (headless Linux, SSH sessions, some containers) they go to ~/.mcp-inspector/secrets.json, unencrypted unless you supply a key.
Our take: Seeing exactly what a server exposes, and checking whether a problem is the server or your client.
The MCP project's list of published servers, which it describes as "like an app store for MCP servers." It launched in preview on September 8, 2025, and the project says it is still a preview release, so breaking changes or data resets may happen.
Our take: Checking whether a vendor publishes an official server before you install a community one.
Server won't start in time. Claude Code: set MCP_TIMEOUT (for example MCP_TIMEOUT=10000 claude for 10 seconds). Codex: raise startup_timeout_sec (default 10). Gemini CLI: pass --timeout in milliseconds.
Long tool calls time out. Claude Code accepts a per-server timeout in milliseconds in .mcp.json (for example "timeout": 600000 for ten minutes). Codex uses tool_timeout_sec (default 60).
Remote server is skipped in Claude Code. A JSON entry with a url but no type is read as stdio and skipped. Add "type": "http"; Claude Code also accepts streamable-http as an alias.
Tool output is cut off. Claude Code warns above 10,000 tokens of MCP output and limits it to 25,000 tokens by default. Raise the limit with MAX_MCP_OUTPUT_TOKENS.
Config copied from another app doesn't load. Check the top-level key: mcpServers for most clients, servers for the VS Code format, and [mcp_servers.<name>] tables in Codex TOML.
Still stuck? Connect the same server to MCP Inspector. If it works there, the problem is your client config.
Only connect servers you trust. Claude Code's docs warn that servers which fetch external content can expose you to prompt injection.
Load fewer tools. Use Codex enabled_tools or Gemini --include-tools so the agent sees only the tools it needs.
Keep approvals on. Cursor asks before MCP tools by default, Codex can prompt on writes only, and Gemini's --trust should stay off for servers that can change things.
Keep secrets out of shared files. Use ${env:NAME} in Cursor, bearer_token_env_var in Codex, or local and user scope in Claude Code.
Solo, one client: Add servers at user or global scope, with secrets in environment variables.
Team repo: Commit a project file (.mcp.json for Claude Code, .cursor/mcp.json, .codex/config.toml) that has only URLs and ${env:...} references, and let each person sign in with OAuth.
Several clients: Expect to configure each one separately. Codex's config is shared across its CLI, IDE extension and the ChatGPT desktop app, and Claude Code can import from Claude Desktop.
Find out whether the server is remote (a URL) or local (a command). Then use your client's add command (claude mcp add, codex mcp add, gemini mcp add), its UI (Cursor's Customize page, VS Code's MCP: Add Server), or its config file. Then check the server's status, for example with /mcp in Claude Code, Codex or Gemini CLI.
Where is the MCP config file?
Claude Code: ~/.claude.json and project .mcp.json. Cursor: .cursor/mcp.json or ~/.cursor/mcp.json. Codex: ~/.codex/config.toml or project .codex/config.toml. VS Code: ~/.copilot/mcp-config.json or workspace .mcp.json. Gemini CLI: .gemini/settings.json or ~/.gemini/settings.json.
What's the difference between stdio and Streamable HTTP?
Stdio runs the server as a local process on your machine. Streamable HTTP connects to a server at a URL and supports standard HTTP auth such as bearer tokens, API keys and headers; MCP recommends OAuth to get tokens. SSE is the older remote transport.
Can I use the same MCP config in every client?
Not always as-is. Most clients use an mcpServers object, the VS Code format uses servers, and Codex uses TOML tables. The server itself works in any client that supports its transport.
How do I test an MCP server without an agent?
Run npx @modelcontextprotocol/inspector, connect to the server, and call its tools by hand.
Is it safe to commit .mcp.json?
Yes, if it has no secrets. Use environment variable references or OAuth. Claude Code prompts for approval before using project-scoped servers in interactive sessions, but not in claude -p runs.
Every command and setting on this page comes from the client's own docs (linked as Source) and was checked on October 21, 2026. Placeholder values like <name> and https://mcp.example.com are examples; use your server's real name and URL.
How we write these: each tool description is based on the tool's own site or docs (linked as Source) and checked on the date above. "Our take" lines are our opinion. Something out of date? Email hello@hotfixdaily.com. No tool paid to be listed.
Get the next issue in your inbox
Five things worth your attention in AI, agents, vibe coding and game dev, every weekday. Plus the free AI Builder Starter Stack PDF when you join.