How to connect MCP servers to Claude, ChatGPT and Cursor
By the Kitbay editorial team ·
To connect an MCP server, you give your AI client either a command that starts the server on your computer (a local server) or the URL of a server hosted online (a remote server). Each client stores this in its own place: a terminal command in Claude Code and Codex, a JSON file in Claude Desktop, Cursor and VS Code, and a settings screen in ChatGPT.
This guide covers where each client keeps that setting. For background, see what an MCP server is.
Local or remote: decide first
| Local server | Remote server | |
|---|---|---|
| Runs on | Your computer, started by the client | The provider's infrastructure |
| Transport | stdio (standard input and output) | Streamable HTTP |
| You provide | A command, its arguments and any environment variables | A URL, usually followed by a login |
| Access | Your files and programs, with your user account's rights | Whatever the account you sign in with allows |
The MCP documentation notes that a local stdio server usually serves one client, while a remote server typically serves many. The project's README tells you which form a server comes in. Kitbay's config builder can produce the snippet for several clients from one set of details.
Claude Code
Claude Code adds servers from the terminal.
# remote server
claude mcp add --transport http notion https://mcp.notion.com/mcp
# local server; everything after -- is the server's own command
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable -- npx -y airtable-mcp-server
Each server has a scope:
- local (default): only you, only this project; stored in
~/.claude.json. - project: shared through
.mcp.jsonin the project root, which you commit. Claude Code asks for approval before using servers from this file. - user: only you, in every project; stored in
~/.claude.json.
Add --scope project or --scope user to change it. Inside a session, /mcp shows status and starts OAuth sign-in for remote servers that need it. claude mcp list and claude mcp remove <name> manage the list.
Claude Desktop
Claude Desktop handles local and remote servers in different places.
Local servers go in claude_desktop_config.json. Open it from Settings, then the Developer tab, then Edit Config:
| System | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/Documents"]
}
}
}
Quit and restart the app fully after saving. Use absolute paths. If a server does not appear, check the logs: mcp.log and mcp-server-NAME.log sit in ~/Library/Logs/Claude on macOS and in the logs folder beside the config file on Windows and Linux.
Remote servers are added as custom connectors: Settings, then Connectors, then Add custom connector, then paste the URL and complete the sign-in. The same screen lets you turn individual tools on or off.
ChatGPT
ChatGPT connects only to servers it can reach over the network. OpenAI's documentation describes this flow on ChatGPT web:
- Open the Plugins page and choose the plus button, then Add custom MCP server.
- Enter a name and the server URL, or choose a tunnel for a private server.
- Choose authentication: OAuth, none, or OAuth with a no-login fallback.
- Read the risk warning and create the plugin, then install it.
- In a chat, mention the server with
@to use it.
Supported transports are SSE and streaming HTTP. ChatGPT asks you to confirm write actions by default, treating every tool as a write action unless the server marks it read-only. Workspace permissions apply, and availability can depend on your plan; check your account settings, as we could not confirm the current plan list from OpenAI's pages.
Cursor
Cursor reads two JSON files:
.cursor/mcp.jsonin a project, for that project only;~/.cursor/mcp.jsonin your home folder, for every project.
{
"mcpServers": {
"local-example": { "command": "npx", "args": ["-y", "some-mcp-server"], "env": { "API_KEY": "${env:API_KEY}" } },
"remote-example": { "url": "https://example.com/mcp" }
}
}
Cursor supports stdio, SSE and Streamable HTTP, and OAuth for remote servers. By default it asks before running an MCP tool, and you can expand the prompt to see the arguments.
VS Code
In VS Code, run MCP: Add Server from the Command Palette, pick HTTP or a stdio command, and choose where to save it. The files differ in their main key:
| File | Main key |
|---|---|
.vscode/mcp.json (workspace) or the profile mcp.json |
servers |
.mcp.json at the workspace root |
mcpServers |
~/.copilot/mcp-config.json (user) |
mcpServers |
The VS Code reference describes the editor-managed servers files as serving an older harness and points new Copilot setups to the mcpServers files. Use the inputs feature (in servers files) to prompt for secrets instead of writing them into shared files. On macOS and Linux, stdio servers can be sandboxed with "sandboxEnabled": true.
Codex
Codex stores servers in ~/.codex/config.toml, or in .codex/config.toml inside a trusted project.
codex mcp add context7 -- npx -y @upstash/context7-mcp
[mcp_servers.example]
url = "https://example.com/mcp"
codex mcp login <name> starts OAuth, and /mcp in the terminal interface lists active servers. The ChatGPT desktop app, Codex CLI and the IDE extension share this configuration.
Other clients
Gemini CLI uses an mcpServers block in ~/.gemini/settings.json or .gemini/settings.json, plus a gemini mcp add command. Its trust: true option skips every confirmation, so keep it for servers you control. Windsurf, Cline and Zed have their own settings; see their client pages.
Safety note
A local server runs with your user account's rights and can do anything you can do with your files. A remote server acts with the permissions of the account you sign in with. Install only servers whose source you have reviewed, keep keys in environment variables rather than shared files, and read our MCP security questions first.
Find servers by client
Each MCP server listing on Kitbay notes which clients its own documentation covers. To build your own, see how to build an MCP server.
Questions
- How do I add an MCP server to Claude Desktop?
- For a local server, open Settings, then Developer, then Edit Config, add the server under mcpServers in claude_desktop_config.json and restart the app. For a remote server, go to Settings, then Connectors, and add a custom connector with the server's URL.
- Can ChatGPT use local MCP servers?
- OpenAI's documentation describes adding a server by URL or through a Secure MCP Tunnel, so a server running only on your computer needs a tunnel or a public HTTPS address. ChatGPT web does not read local Codex configuration.
- Where is Cursor's MCP config file?
- Cursor reads .cursor/mcp.json in a project for that project's servers, and ~/.cursor/mcp.json in your home folder for servers available everywhere.
- Do Codex CLI and the Codex IDE extension share MCP settings?
- Yes. OpenAI's documentation says the ChatGPT desktop app, Codex CLI and the IDE extension share the same MCP configuration, stored in ~/.codex/config.toml by default.
Sources
- Connect Claude Code to tools via MCP (Claude Code docs)checked Nov 14, 2026
- Connect to local MCP servers (MCP docs)checked Nov 14, 2026
- Connect to remote MCP servers (MCP docs)checked Nov 14, 2026
- Developer mode and custom MCP servers in ChatGPT (OpenAI docs)checked Nov 14, 2026
- Model Context Protocol (Cursor docs)checked Nov 14, 2026
- Add and manage MCP servers in VS Codechecked Nov 14, 2026
- MCP configuration reference (VS Code docs)checked Nov 14, 2026
- MCP in Codex (OpenAI docs)checked Nov 14, 2026
- MCP servers with Gemini CLIchecked Nov 14, 2026
- MCP architecture overviewchecked Nov 14, 2026