How to use MCP Servers with an AI agent
An MCP server gives your agent a new set of tools. In Claude Code run claude mcp add, in Codex run codex mcp add or edit config.toml, and in Cursor add the server to .cursor/mcp.json. Add only servers you trust, and give each one the smallest permissions it needs.
Checked against official docs on Oct 26, 2026.
Get the free starter kit. One short email a day when our setups change.
Free starter kit on signup: 2 Claude Code skills and 1 agent persona from our paid packs. By subscribing you agree to get The AI Loadout Daily, one email each morning. No spam, we never sell your email, and every email has a one-click unsubscribe link.
Claude Code
Remote server: claude mcp add --transport http notion https://mcp.notion.com/mcpLocal server: claude mcp add --transport stdio --env API_KEY=YOUR_KEY myserver -- npx -y some-mcp-packageAdd --scope project to share it with your team through .mcp.jsonclaude mcp list, claude mcp get <name>, claude mcp remove <name>, or /mcp inside a session
Codex
Local: codex mcp add context7 -- npx -y @upstash/context7-mcpRemote: codex mcp add example --url https://example.com/mcpOr edit ~/.codex/config.toml with [mcp_servers.<name>] tables (command, args, env, or url and bearer_token_env_var)codex mcp list, codex mcp login <name> for OAuth, /mcp in the TUI
Cursor
Project: .cursor/mcp.json. Global: ~/.cursor/mcp.json{"mcpServers":{"name":{"command":"npx","args":["-y","pkg"],"env":{}}}} for local, or {"url":"https://...","headers":{}} for remoteUse ${env:NAME} instead of pasting keysCheck Output > MCP Logs when a server will not start
Grok Bot
Grok Bot comes with connectors for apps like Gmail, Google Calendar, GitHub and XConnect the ones you need and it uses them as toolsFor anything without a connector it can use the web or a script on its own computer
Gotchas
- MCP servers that fetch outside content can expose you to prompt injection, per Anthropic's docs.
- Project config files get committed. Never put raw API keys in .mcp.json or .cursor/mcp.json.
- Too many servers crowd the context. Codex lets you trim tools with enabled_tools and disabled_tools.
The loadout for this job
- Tools: Cursor, Claude
- Repo: MCP Servers
- Model: Claude Sonnet 5.5
- Bot: Grok Bot
- Full setup: Best AI coding agent
FAQ
What is MCP?
The Model Context Protocol, an open standard for connecting AI apps to tools and data.
Do Claude Code, Codex and Cursor all support MCP?
Yes. All three can connect to local (stdio) and remote (HTTP) MCP servers.
Related how-tos
Sources
Commands change. Check the linked docs before you run anything. All how-to guides