Guide

How to Add MCP to Claude Code and Desktop

Learn how to add MCP servers to Claude Code, Claude Desktop, and Cursor with JSON setup, safe permissions, auth checks, and fixes for common errors.

Editorial Team 7 min read
How to Add MCP to Claude Code and Desktop

Understanding MCP and Claude Integration

MCP means Model Context Protocol. It gives Claude a shared way to use outside tools and data.

An MCP server offers tools, files, or records to an MCP client. Claude can then search data or take approved actions.

The MCP architecture guide explains how clients, servers, and tools fit together.

The short answer to “how to add MCP to Claude” is this. Add a server through a command or a JSON settings file.

Claude starts the server when it needs one. The server sends back results in a shared format.

Why Add MCP Servers?

Modular MCP tools linked to a central hub for real-time data access and automation
Connected MCP tool nodes

MCP can give Claude fresh data instead of old pasted notes. A code server can search a repository or inspect an issue.

A work server can find tickets, pages, or team records. Claude can also link steps across tools.

These benefits make MCP useful for both small tasks and daily work:

  • Search current files, code, and work records
  • Reduce copy and paste work
  • Run repeat tasks with clear approval points
  • Keep tool access in one shared setup
  • Limit access through narrow server permissions

Start with one low-risk server. Test it before adding more tools.

Server quality still matters. A poor server may return stale data or request broad access.

How to Add MCP Servers to Claude Code

If you need to know how to add MCP to Claude Code, use the command line first. It is quick, clear, and easy to check.

First, choose a trusted server. Find its launch command or its remote endpoint.

  1. Pick a short server name, such as github-read.
  2. Choose local stdio or remote HTTP transport.
  3. Add the command or endpoint to Claude Code.
  4. Set any needed values through environment variables.
  5. List the server and test one small request.

For a local server, run this example in your shell:

claude mcp add --transport stdio my-tools -- npx -y @example/mcp-server

Replace the name and package with the values from your server guide. Keep the name unique.

For a remote server, use an HTTP endpoint:

claude mcp add --transport http team-data https://example.com/mcp

Run claude mcp list after saving the entry. This is the core answer for how to add MCP servers to Claude Code.

It also covers “claude code how to add MCP” and “how do I add MCP servers to Claude Code?”

Provider Examples for Claude Code

Distinct MCP provider modules connected to one shared Claude Code integration board
MCP provider connection modules

Provider setup follows the same pattern. The server guide supplies the package, endpoint, and access scope.

For GitHub, users often search how to add GitHub MCP to Claude Code. Pick a server that supports your needed GitHub actions.

For Atlassian, use the same check when asking how to add Atlassian MCP to Claude Code. Confirm whether it covers Jira, Confluence, or both.

Other common searches include how to add Jira MCP to Claude Code and how to add Linear MCP to Claude Code. The steps stay the same.

  • Check the server owner and source code
  • Review each tool before granting access
  • Use read-only access for the first test
  • Limit access to one repo, team, or project
  • Save write access for tasks that need it

Not every provider uses the same login flow. Some use a token, while others use a browser sign-in.

Never place a live token in a public file. Store it in your shell or a trusted secret store.

JSON Settings, Names, and Authentication

JSON setup helps when you need more control. The file path can vary by tool version and setup scope.

Check the current Claude Code help output before editing a file. A typical local entry looks like this:

{"mcpServers":{"github-read":{"command":"npx","args":["-y","@example/github-mcp"],"env":{"GITHUB_TOKEN":"${GITHUB_TOKEN}"}}}}

The command starts the server. The args list passes launch options.

The env block passes values at run time. It should not hold the real secret.

A remote entry may look like this:

{"mcpServers":{"team-data":{"url":"https://example.com/mcp","headers":{"Authorization":"Bearer ${MCP_TOKEN}"}}}}

Use names that show both the tool and its risk. Names like jira-read beat vague names like server-one.

Save the file, then start a new Claude Code session. Run claude mcp list again.

How to Add MCP to Claude Desktop and Cursor

Claude Desktop uses a separate settings file from Claude Code. Its file still uses an mcpServers object.

That answers how to add MCP to Claude Desktop and how to add MCP servers to Claude Desktop. Find the current file path in Anthropic’s setup guide.

Paste the server entry, save the file, and fully restart Claude Desktop. A new chat may then show the server tools.

Cursor also has its own MCP settings. People often ask how to add MCP servers to Cursor.

For GitHub, that becomes how to add GitHub MCP to Cursor. For Jira, it becomes how to add Jira MCP to Cursor.

  • Open the MCP settings in the app
  • Add the server command or remote URL
  • Set secrets outside the shared file
  • Save the settings and restart the app
  • Check that the expected tool appears

Do not copy a Claude Code file into Cursor without checking its format. Each client may support different fields.

Testing and Troubleshooting MCP Connections

Carefully arranged MCP connection hardware for testing and troubleshooting server access
MCP connection testing setup

Test one server before you add another. Ask for a simple read action with a narrow scope.

Then confirm the result against the source system. This catches stale data and wrong account access.

Use this quick fault check:

ProblemLikely causeFirst check
Server is missingBad file or scopeRun the list command
Launch failsWrong command or packageRun it in the shell
Login failsMissing or expired tokenCheck the environment value
Tools do not showOld app sessionRestart the client
Request is deniedScope lacks accessReview account permissions

Read the exact error text before changing settings. Small spelling errors can stop a server from loading.

Check quotes, commas, braces, and field names in JSON. Use a trusted JSON checker if the file will not load.

For deeper client details, use Anthropic’s Claude Code MCP guide. It is the best source for current commands.

Manage Several Servers Safely

Several servers can work well when each has one clear job. Keep names short and group them by use.

Read access should be the default. Add write access only after a small, safe test.

Server nameGood useSafer first scope
github-readSearch code and issuesOne repository
jira-readFind project workOne project
linear-readReview team tasksOne team
local-filesRead work filesOne folder

Keep secrets out of source control and shared settings. Rotate tokens when a team member leaves.

Review server tools from time to time. Remove entries that you no longer use.

Conclusion and Next Steps

The answer to how to use MCP servers with Claude Code starts with one small server. Add it, list it, and test one safe request.

The same approach works for Claude Desktop and Cursor. Their settings paths and supported fields may differ.

Common provider searches include how to add Notion MCP to Claude Code, how to add Puppeteer MCP to Claude Code, and how to add Slack MCP to Claude Code.

Use the provider’s current guide for each package. Confirm its access rules before you connect it.

Good setup is simple. Clear names, narrow access, safe secrets, and fresh sessions prevent most trouble.

Step-by-step

  1. 01
    Choose a trusted server

    Review the server source, tools, and access needs. Start with a low-risk, read-only use case.

  2. 02
    Pick a server name

    Use a short unique name that shows the tool and its access level. Names like github-read make later checks easier.

  3. 03
    Add the server

    Use the Claude Code add command for a local or remote server. You can also add the entry to the JSON settings file.

  4. 04
    Set safe authentication

    Pass tokens through environment variables or a secure secret store. Do not save live secrets in shared JSON.

  5. 05
    Save and restart

    Save the settings, then start a fresh Claude session or restart the client. This loads the new server entry.

  6. 06
    Test one request

    List the server and run one narrow read request. Confirm the result before granting wider access.

Frequently asked questions

How do I add MCP servers to Claude Code?
Use the Claude Code MCP add command or edit its JSON settings. Then run the list command and test one safe request.
How do I add MCP to Claude Desktop?
Add an mcpServers entry to Claude Desktop’s settings file. Save the file and fully restart the app.
How do I use MCP servers with Claude Code?
Add a trusted server, grant narrow access, and ask Claude to use one tool. Check the result against the source system.
How do I add GitHub MCP to Claude Code?
Choose a GitHub MCP server, add its command, and set the token through an environment variable. Start with one repository and read access.
How do I add Jira MCP to Cursor?
Open Cursor’s MCP settings and add the Jira server command or URL. Check the server format and restart Cursor after saving.
Why are my MCP tools missing in Claude?
The client may still use an old session, or the server may have failed to start. Check the saved entry, error text, and server list.
MCP server setupClaude Code configurationClaude Desktop settingsJSON server configurationMCP authentication setupMCP connection troubleshootingread-only server accessCursor MCP settings

Related reading