# Add an MCP server with claude mcp add in Claude Code, claude_desktop_config.json in Claude Desktop, or mcp.json in Cursor

> Claude Code uses claude mcp add or .mcp.json, Claude Desktop uses claude_desktop_config.json for local servers and Custom Connectors for remote ones, and Cursor uses .cursor/mcp.json for both.

## Answer

In Claude Code, run `claude mcp add --transport http <name> <url>` for a remote server, or `claude mcp add --transport stdio <name> -- <command> [args]` for a local one. In Cursor, put the server in `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global) under `mcpServers`. In Claude Desktop, edit `claude_desktop_config.json` for local servers. The Model Context Protocol docs add remote servers there through Settings > Connectors. I checked these docs on 2026-09-28. Menus and flags change, so re-check them.

## Details

### Comparison

| Client | Local (stdio) | Remote (HTTP) | Config location |
|---|---|---|---|
| Claude Code | `claude mcp add --transport stdio ... -- cmd args` | `claude mcp add --transport http name url` | `~/.claude.json` (local and user scope), `.mcp.json` in the project root (project scope) |
| Claude Desktop | `mcpServers` with `command` and `args` | Settings > Connectors > Add custom connector | `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS), `%APPDATA%\Claude\claude_desktop_config.json` (Windows) |
| Cursor | `mcpServers` with `command`, `args`, optional `env` | `mcpServers` with `url` and optional `headers` | `.cursor/mcp.json` (project), `~/.cursor/mcp.json` (global) |

### Claude Code

```sh
# remote, HTTP
claude mcp add --transport http wiki https://wiki.drfritzi.at/mcp
# local, stdio: everything after -- is the server command
claude mcp add --transport stdio files -- npx -y @modelcontextprotocol/server-filesystem /path/to/dir
```

`--scope` (`-s`) takes `local` (default, only you, this project), `project` (shared through `.mcp.json`) or `user` (all your projects). The equivalent `.mcp.json`:

```json
{
  "mcpServers": {
    "wiki": { "type": "http", "url": "https://wiki.drfritzi.at/mcp" },
    "files": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
    }
  }
}
```

Claude Code asks for approval before it uses a project-scoped server from `.mcp.json`. `claude mcp list`, `claude mcp get <name>` and `claude mcp remove <name>` manage servers.

### Claude Desktop

Open Settings > Developer > Edit Config, or edit the file directly, and add:

```json
{
  "mcpServers": {
    "files": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/username/Desktop"]
    }
  }
}
```

Use absolute paths, then quit and restart Claude Desktop completely. For a remote server such as `https://wiki.drfritzi.at/mcp`, the MCP docs use Settings > Connectors > Add > Add custom connector and paste the URL. This page does not show a config-file form for remote servers in Claude Desktop because the sources above do not document one.

### Cursor

```json
{
  "mcpServers": {
    "wiki": { "url": "https://wiki.drfritzi.at/mcp" },
    "files": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
    }
  }
}
```

Cursor lists stdio, SSE and Streamable HTTP as supported transports.

### Checklist: did it connect?

1. Run the server command by hand first. A stdio server that crashes there will not connect anywhere.
2. Claude Code: check the server's status in `claude mcp list`, or inside a session with `/mcp`. A project-scoped server also needs your approval before it runs.
3. Claude Desktop: after a full restart, open "Add files, connectors, and more" and check that the server's tools appear. If not, read `mcp.log` in `~/Library/Logs/Claude` (macOS) or `%APPDATA%\Claude\logs` (Windows).
4. Any client: ask for a tool by name and confirm that a call succeeds. The wiki endpoint offers `search_answers` and `get_answer`.
5. Check JSON syntax and that `mcpServers` is the top-level key.

## See also

- [[mcp-transports-stdio-vs-http]]
- [[mcp-connection-errors]]
- [[mcp-remote-server-cloudflare-pages]]
- [[mcp-server-typescript-minimal]]

## Sources

- [Claude Code — Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp)
- [Model Context Protocol — Connect to local MCP servers (Claude Desktop)](https://modelcontextprotocol.io/docs/develop/connect-local-servers)
- [Model Context Protocol — Connect to remote MCP servers (Custom Connectors)](https://modelcontextprotocol.io/docs/develop/connect-remote-servers)
- [Cursor — Model Context Protocol (MCP)](https://cursor.com/docs/context/mcp)

## Sources

- [Claude Code — Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp)
- [Model Context Protocol — Connect to local MCP servers (Claude Desktop)](https://modelcontextprotocol.io/docs/develop/connect-local-servers)
- [Model Context Protocol — Connect to remote MCP servers (Custom Connectors)](https://modelcontextprotocol.io/docs/develop/connect-remote-servers)
- [Cursor — Model Context Protocol (MCP)](https://cursor.com/docs/context/mcp)