# Connect an MCP server to Claude Desktop, Cursor and VS Code

> These three apps connect to a local MCP server the same way: a command and its arguments in a JSON config file. Claude Desktop reads `claude_desktop_config.json` and Cursor reads `.cursor/mcp.json`, both under `mcpServers`. VS Code reads `.vscode/mcp.json` under `servers`. Use absolute paths, then reload the app so it picks up the file.

Mindket editors · Published 2026-11-04 · Updated 2026-11-05 · https://mindket.com/learn/mcp/connect-mcp-servers

## In short

- You will register one local server in Claude Desktop, Cursor and VS Code, and know where each app keeps its config.
- The launch command and its arguments are the same in all three. Only the file, the top-level key and the reload step change.
- Claude Desktop and Cursor use `mcpServers`. VS Code's own format uses `servers` and asks for a `type` on every entry.
- Remote servers are different. Claude Desktop takes them as custom connectors.

## One launch command, three config files

A host needs one thing from you: a command it can start as a child process and talk to over stdin and stdout. The servers from [lesson 1](https://mindket.com/learn/mcp/build-mcp-server-python) and [lesson 2](https://mindket.com/learn/mcp/build-mcp-server-typescript) already have one. The TypeScript server starts with `npx tsx src/index.ts` from its project folder, and the Python one with `uv --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/weather run weather.py`. Each app wants that split into a `command` and an `args` list, in a file of its own.

Claude Code takes the same command through `claude mcp add`, which [this post](https://mindket.com/blog/add-mcp-server-claude-code) covers, so this lesson leaves it out.

1. Run the launch command in a terminal first. A healthy stdio server prints nothing, or one line to stderr, and waits. A traceback or an immediate exit is a bug to fix before you touch any app.
2. Open the app's config file from the table below, and create it if it does not exist.
3. Add the server under the app's top-level key with a `command` and `args`. Use absolute paths everywhere except where the app resolves a variable for you.
4. Reload the app. Claude Desktop needs a full quit and restart. In VS Code, restart the server from MCP: List Servers. In Cursor, the server and its toggle are under Customize in the sidebar.
5. Ask for something only the server knows, such as the active weather alerts in Texas, and approve the tool call when the app asks.

| App | Config file | Top-level key |
| --- | --- | --- |
| Claude Desktop | macOS `~/Library/Application Support/Claude/claude_desktop_config.json`, Windows `%APPDATA%\Claude\claude_desktop_config.json`, Linux `~/.config/Claude/claude_desktop_config.json` | `mcpServers` |
| Cursor | `.cursor/mcp.json` in a project, or `~/.cursor/mcp.json` for every project | `mcpServers` |
| VS Code | `.vscode/mcp.json` in a workspace, or `mcp.json` in your user profile | `servers` |

## Claude Desktop: claude_desktop_config.json

Open Settings from the Claude menu in your system's menu bar, not the settings inside the chat window. In the Developer tab, press Edit Config. That creates the file if it is missing and opens it. Add the server under `mcpServers`, save, then quit Claude Desktop completely and open it again.

The block below is the MCP documentation's first example, the filesystem server, written for macOS. Windows paths take double backslashes in JSON. Swap in your own server's launch command to connect the weather server. A server that needs a key takes it in an `env` object next to `args`.

If you only want to use a server rather than build one, [Anthropic's help center](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop) describes desktop extensions, single-click installable packages for local servers.

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

````

## Cursor: mcp.json

Cursor reads `.cursor/mcp.json` in a project and `~/.cursor/mcp.json` in your home folder, and both hold the same `mcpServers` object. The block below is the weather server from lesson 2, using the entry the TypeScript SDK's guide gives for Cursor.

Cursor resolves variables in `command`, `args`, `env`, `url` and `headers`. `${workspaceFolder}` is the project root and `${env:NAME}` reads an environment variable, so a project file can avoid absolute paths and keep keys out of the file. One oddity in the docs: the field table marks `type` as required for stdio servers, but the JSON examples leave it out. Copy the examples, and check that field first if an entry does not load.

Cursor asks before it runs an MCP tool, and the arrow beside the tool name shows its arguments. To see why a server failed, open the Output panel and choose MCP Logs from the dropdown.

````json
{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["tsx", "src/index.ts"]
    }
  }
}

````

## VS Code: .vscode/mcp.json

VS Code's own format uses `servers`, not `mcpServers`, and every stdio entry names its `type`. The reference describes only the VS Code format, not a shared schema for all MCP clients, so a Cursor snippet pasted in unchanged will not match. Below is the weather server entry as the TypeScript SDK's guide writes it.

MCP: Add Server in the Command Palette is the newer guided route, and its user-level destination is `~/.copilot/mcp-config.json` unless `COPILOT_HOME` is set, in a second, portable format that uses `mcpServers`. The `.vscode/mcp.json` destination stays available for compatibility, and that guided flow labels it deprecated. The reference page still documents it, and it is the format that supports `inputs`, which prompt you for a secret.

In a trusted workspace, workspace servers can start without a separate MCP trust prompt. Run MCP: List Servers to see a server's status and pick Show Output for its log.

````json
{
  "servers": {
    "weather": {
      "type": "stdio",
      "command": "npx",
      "args": ["tsx", "src/index.ts"]
    }
  }
}

````

## Local and remote servers are set up differently

A remote server is one at a web address rather than a program on your machine. Cursor takes it as a `url` with a `headers` object, and VS Code as a `type` of `http` with a `url`. Claude Desktop takes remote servers as custom connectors. Anthropic's help article calls local servers configured in `claude_desktop_config.json` a separate mechanism, and the connector flow is Connectors, then Add custom connector, where you enter a name and the server's URL. The MCP guide puts Connectors under Settings, and Anthropic's help article puts it under Customize.

**What each app takes from its config**

| | Claude Desktop | Cursor | VS Code |
| --- | --- | --- | --- |
| A local server from the JSON file | ✓ Yes | ✓ Yes | ✓ Yes |
| A remote server as a url entry in the JSON file | Use Connectors | ✓ Yes | ✓ Yes |
| A config file per project | One user-level file | ✓ Yes | ✓ Yes |
| Where a key goes | An env object | ${env:NAME} | ${env:NAME} or a prompt |

Sources: [MCP docs: Connect to remote MCP servers](https://modelcontextprotocol.io/docs/2026-07-28/develop/connect-remote-servers) (read 2026-11-04), [Cursor docs: Model Context Protocol](https://cursor.com/docs/mcp) (read 2026-11-04), [VS Code docs: MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration) (read 2026-11-04)

## Before you connect a server you did not write

A local server runs with your user account's permissions, so it can do anything you can do by hand. Claude's help center says custom connectors can reach services Anthropic has not verified, and Cursor's docs say to install servers only from sources you trust and to use restricted API keys. VS Code's docs say to review a repository's MCP configuration before trusting it, because stdio servers can run code.

> [Are MCP servers safe?](https://mindket.com/blog/are-mcp-servers-safe) covers what to check first.

## VS Code's Agent Plugins and Kenton Varda on MCP auth

The Visual Studio Code team [posted on X](https://x.com/code/status/2087640853783232562) on 12 August 2026 that Agent Plugins 1.0 work in VS Code: skills, MCP servers and AI extensions packed into one installable plugin. GitHub's [changelog](https://github.blog/changelog/2026-08-12-agent-plugins-1-0-in-vs-code-copilot-cli-and-the-copilot-app/) names the parts, a `plugin.json`, a `skills/` folder and an `mcp.json`, installed from a marketplace. Once your server runs from a config file, a plugin hands it to teammates without each of them editing JSON.

Kenton Varda, tech lead for Cloudflare Workers, [posted on X](https://x.com/KentonVarda/status/1987208904724652273) on 8 November 2025 that MCP's big advantage over OpenAPI is how clear it is about auth. OpenAPI allows too many auth mechanisms, and its schema may not give a robot enough to finish the sign-in. When a service offers a remote server with OAuth and a local one that wants a key, the remote one keeps long-lived keys out of your JSON files.

> OpenAPI supports too many different auth mechanisms, and the schema doesn't necessarily have enough information for a robot to be able to complete the auth flow.
>
> Kenton Varda, Tech lead for Cloudflare Workers, [X](https://x.com/KentonVarda/status/1987208904724652273) (read 2026-11-05)

[![Visual Studio Code (@code) on X, 12 August 2026. Agent Plugins 1.0 are now supported in VS Code. Package your skills, MCP servers, and AI extensions into one installable plugin.](https://mindket.com/blog/shots/x-code-agent-plugins-1-0.webp?v=d67fab0d83eb)](https://x.com/code/status/2087640853783232562)

Visual Studio Code on X, 12 August 2026

[![Kenton Varda (@KentonVarda) on X, 8 November 2025, quoting a post by Steve Krouse about the code mode Anthropic and Cloudflare announced. He names the big advantage of MCP over OpenAPI: it is clear about auth. OpenAPI supports too many different auth mechanisms, and the schema doesn't necessarily have enough information for a robot to be able to complete the auth flow.](https://mindket.com/blog/shots/x-kentonvarda-mcp-auth.webp?v=c758357843c9)](https://x.com/KentonVarda/status/1987208904724652273)

Kenton Varda on X, 8 November 2025

> Screenshots of X's own embeds of the posts, taken on 5 November 2026, with the time in UTC. X cuts the VS Code post short with Show more. Select one to open the post on X.

## Common mistakes

- A relative path. Hosts start servers from their own working directory, which may be undefined, so `./data` or `weather.py` alone fails. Use absolute paths.
- A syntax error in the JSON. The MCP troubleshooting list starts with the file's syntax.
- Pasting one app's snippet into another unchanged. The top-level key differs, and VS Code's own format also wants `type`.
- Closing the Claude Desktop window instead of quitting the app. The debugging guide says to fully quit and reopen, and that closing the window is not enough.
- A command the app cannot find. The guide says you may need the full path to `uv` in the `command` field, and `which uv` or `where uv` prints it.
- On Windows, an ENOENT error that mentions `${APPDATA}` in a server's log. The MCP docs' fix is to add the expanded `APPDATA` path to the entry's `env` key, and to install npm globally.

| App | Where the log is |
| --- | --- |
| Claude Desktop | `mcp.log` and one `mcp-server-NAME.log` per server in `~/Library/Logs/Claude` on macOS, `%APPDATA%\Claude\logs` on Windows, `~/.config/Claude/logs` on Linux |
| Cursor | The Output panel, with MCP Logs chosen in the dropdown |
| VS Code | MCP: List Servers, pick the server, then Show Output |

## Try it yourself

- Register the weather server from lesson 1 or 2 in one app, then ask about alerts in a state other than Texas.
- Open that app's log and find the line where the server starts.
- Move the same entry to a second app and write down each change you had to make.

## Next: the Claude API

That finishes the MCP course. You built a server in two languages, tested it with the Inspector and connected it to three apps. To compare your server with ready-made ones, browse the MCP servers on Mindket.

The [Claude API course](https://mindket.com/learn/claude-api/claude-api-quickstart) is the natural next step. It starts with your first API call, then covers tool use, prompt caching and an agent loop, so you write the model-side code that asks for a tool and runs it.

## Check yourself

1. Which top-level key does VS Code's `.vscode/mcp.json` use for MCP servers?

   A. `mcpServers`
   B. `servers`
   C. `mcp`

   Answer: B. VS Code's own format uses `servers` and every stdio entry names its `type`, while Claude Desktop and Cursor use `mcpServers`.

2. You edited `claude_desktop_config.json` but the server does not show up. What should you do?

   A. Close the Claude Desktop window and open it again
   B. Start a new conversation to refresh the list
   C. Run `claude mcp add` in a terminal
   D. Quit Claude Desktop completely and open it again

   Answer: D. Closing the window is not enough, so the app has to fully quit and reopen before it reads the file.

3. A server entry points at `weather.py` with no folder in front of it. What goes wrong?

   A. The host starts it from its own working directory, so a relative path may not resolve
   B. The host runs only servers written in TypeScript
   C. The host copies the file into its config folder first

   Answer: A. The working directory a host starts servers from may be undefined, so use absolute paths.

4. How do you add a remote MCP server in Claude Desktop?

   A. As a `url` entry under `mcpServers` in `claude_desktop_config.json`
   B. In `.vscode/mcp.json` under `servers`
   C. As a custom connector, through Connectors and then Add custom connector

   Answer: C. Claude Desktop takes remote servers as custom connectors, which is a separate mechanism from the local config file.

## Frequently asked questions

### How do I add a remote MCP server to Claude Desktop?

Add it as a custom connector instead of editing the JSON file. Open Connectors, press Add, then Add custom connector, and enter the server's name and URL. Free plans are limited to one custom connector.

### Can VS Code use the servers I already set up in Claude Desktop or Cursor?

It can find them. The setting `chat.mcp.discovery.enabled` controls discovery from other apps, and VS Code's reference page says it is off by default for Claude Desktop and Cursor.

### Can one MCP config file work in every app?

Not as one file, since the wrapper around each entry differs. Keep the server's `command` and `args` values in your project's README, and paste them into each app's own format when you add the server there.

### Do I have to restart the app after I edit the config?

Claude Desktop does, since it reads the file only when it starts. VS Code has Restart Server in the MCP: List Servers menu, which its docs list for use after changing configuration. Cursor's docs describe a toggle for each server under Customize.

### How do I give a local server an API key?

In Claude Desktop, add an `env` object to the server's entry and put the key inside. Cursor accepts `${env:API_KEY}` references, which keep the key out of the file. VS Code can ask for it through an `inputs` entry with `password` set to true, referenced as `${input:id}`.

### Does Claude Code use the same config file?

No. Claude Code adds servers with the `claude mcp add` command, which the Mindket post on adding an MCP server to Claude Code walks through.

## Sources

- [MCP docs: Connect to local MCP servers](https://modelcontextprotocol.io/docs/2026-07-28/develop/connect-local-servers) (read 2026-11-04)
- [MCP docs: Connect to remote MCP servers](https://modelcontextprotocol.io/docs/2026-07-28/develop/connect-remote-servers) (read 2026-11-04)
- [MCP docs: Debugging](https://modelcontextprotocol.io/docs/2026-07-28/tools/debugging) (read 2026-11-04)
- [Claude Help Center: Get started with custom connectors using remote MCP](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp) (read 2026-11-04)
- [Claude Help Center: Getting started with local MCP servers on Claude Desktop](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop) (read 2026-11-04)
- [Cursor docs: Model Context Protocol](https://cursor.com/docs/mcp) (read 2026-11-04)
- [VS Code docs: MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration) (read 2026-11-04)
- [VS Code docs: Manage and troubleshoot MCP servers](https://code.visualstudio.com/docs/agents/run/manage-mcp-servers) (read 2026-11-04)
- [VS Code docs: Add and manage MCP servers](https://code.visualstudio.com/docs/agent-customization/mcp-servers) (read 2026-11-04)
- [MCP TypeScript SDK docs: Plug into a real host](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/docs/get-started/real-host.md) (read 2026-11-04)
- [MCP Python SDK docs: Connect to a real host](https://py.sdk.modelcontextprotocol.io/get-started/real-host/) (read 2026-11-04)
- [GitHub changelog: Agent Plugins 1.0 in VS Code, Copilot CLI and the Copilot app](https://github.blog/changelog/2026-08-12-agent-plugins-1-0-in-vs-code-copilot-cli-and-the-copilot-app/) (read 2026-11-05)
- [Visual Studio Code on X: Agent Plugins 1.0](https://x.com/code/status/2087640853783232562) (read 2026-11-05)
- [Kenton Varda on X: MCP is very clear about auth](https://x.com/KentonVarda/status/1987208904724652273) (read 2026-11-05)

[Browse MCP servers](https://mindket.com/mcp-servers)
