15.9 C
Canberra
Sunday, July 19, 2026

Find out how to Join MCP Servers to Claude (Desktop & Code)


Connecting MCP servers to Claude permits it to work with exterior instruments, information, databases, repositories, and different programs as a substitute of working solely inside the chat window. The setup differs barely between Claude Desktop and Claude Code, however each may be configured in only a few steps.

On this article, you’ll learn to join MCP servers with Claude Desktop and Claude Code, a sensible step-by-step information for getting every setup operating accurately.

What Is MCP and Why Does It Matter?

MCP (Mannequin Context Protocol) is the common connector layer that lets any AI mannequin speak to any exterior software by means of a single standardised interface with out customized integration code for each mixture.

Earlier than MCP, connecting Claude to GitHub required one customized integration. Connecting it to Slack required a special one. Connecting it to your database required a 3rd. Anthropic referred to as this the “N×M downside”: N AI fashions instances M exterior instruments meant N×M bespoke connectors. MCP solves it by turning that into N+M. Construct one MCP server for GitHub, and each MCP-compatible AI shopper Claude, Cursor, Windsurf, and dozens extra can use it instantly.

How MCP Works in 3 Easy Components

Understanding the 3-part structure takes 2 minutes and prevents 90% of setup confusion.

Element What It Is Instance in Claude
Host The AI app the consumer talks to, manages context, safety, and which servers can be found. Claude Desktop, Claude Code, Cursor
Consumer Lives contained in the host. Handles protocol-level communication with every MCP server. Constructed into Claude Desktop / Claude Code
Server An exterior course of that exposes instruments, assets, or prompts to the AI through MCP. GitHub MCP server, Filesystem MCP server

If you ask Claude to “test my open GitHub PRs”, here’s what occurs behind the scenes:

  1. Claude identifies it wants an exterior software to fulfil the request.
  2. The MCP shopper in Claude sends a JSON-RPC request to the GitHub MCP server.
  3. The server queries GitHub’s API and returns structured information.
  4. Claude incorporates that information into its context and generates your reply.

The entire move takes below a second. You by no means see the plumbing.

As of April 2026, Streamable HTTP is Anthropic’s official beneficial transport, and the older SSE transport is being deprecated.

Claude Desktop: Step-by-Step MCP Setup

Claude Desktop reads its MCP configuration from a single JSON file. There are two methods to put in servers: the brand new one-click Desktop Extensions (.mcpb information, previously .dxt) and the normal JSON config technique. Use Extensions for supported servers; use JSON config for something customized.

Technique 1: Desktop Extensions (One-Click on, No JSON)

As of early 2026, Claude Desktop helps Desktop Extensions, pre-packaged MCP servers distributed as .mcpb information (MCP Bundle; older guides could name these .dxt information, which nonetheless work however are the legacy title). These set up with a double-click. No JSON enhancing, no Node.js PATH points.

  1. Open Claude Desktop.
  2. Click on the “+” button within the bottom-left of the chat enter.
  3. Choose “Connectors” to open the connectors menu.
  4. Discover your server (e.g., GitHub, Google Drive) and click on Set up (or Click on onn add connectors to search out one on the connectors listing).
  5. Restart Claude Desktop. The server prompts robotically.
Claude Dashboard

Desktop Extensions are the proper selection for non-technical customers or servers you need to “set and overlook.” The JSON config technique under is correct for customized servers, personal servers, or full management over arguments and atmosphere variables.

Technique 2: JSON Config (Full Management)

Claude Desktop reads its MCP configuration from claude_desktop_config.json. The file location depends upon your OS:

macOS: ~/Library/Utility Help/Claude/claude_desktop_config.json

Home windows: %APPDATApercentClaudeclaude_desktop_config.json

On Home windows, which folder truly has this file depends upon the way you put in Claude Desktop, and this journeys up lots of people. There are two fully totally different places:

  • Direct .exe installer (from claude.ai/downloads): %APPDATApercentClaudeclaude_desktop_config.json
  • Microsoft Retailer, WinGet, or MSIX set up: %LOCALAPPDATApercentPackagesClaude_pzs8sxrjxfjjcLocalCacheRoamingClaudeclaude_desktop_config.json

If %APPDATApercentClaude doesn’t exist in your machine, you nearly actually have the Retailer/MSIX set up, and your actual file is at that second, uglier path. Home windows’ app-packaging mannequin silently redirects it there as a substitute of the usual location every bit of documentation assumes.

If neither path has the file but, open Claude Desktop itself, go to Settings → Developer → Edit Config. That creates the file at whichever path your particular set up truly makes use of, so that you don’t need to guess.

One Home windows-specific entice: paths inside JSON want double backslashes. C:UsersyournameDocuments in a JSON string have to be written as C:CustomersyournamePaperwork, a single backslash breaks the JSON parser. Right here’s what an entire, accurately escaped config seems like:

Claude Desktop json file

Modifying the Config File

Open Claude Desktop → high menu bar → Settings → Developer → Edit Config. This opens the file in your default editor and creates it if it doesn’t exist.

The file has only one top-level key, mcpServers. Consider it as a listing of servers you need Claude to find out about. Every server will get its personal entry inside that record, and also you decide no matter title you need for that entry (like “filesystem” or “github” under).

Inside every server’s entry, there are three issues you’ll be able to set:

  • command: the precise program Claude runs to begin that server (normally npx, since most servers are distributed as npm packages)
  • argsthe record of arguments handed to that command, precisely such as you’d sort them in a terminal
  • env: any atmosphere variables the server wants, mostly API keys or entry tokens

Right here’s a sensible starter config for a developer workflow: filesystem entry, GitHub integration, and net search:

{
  "mcpServers": {
    "filesystem": {
      "command": "/usr/native/bin/npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem",
               "/Users/yourname/Documents", "/Users/yourname/projects"]
    },
    "github": {
      "command": "/usr/native/bin/npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
      }
    },
    "brave-search": {
      "command": "/usr/native/bin/npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": { "BRAVE_API_KEY": "your_brave_api_key" }
    }
  }
}

What’s taking place in every of the three servers:

filesystem doesn’t want any credentials, so it solely has command and args. The args record tells npx which bundle to run (@modelcontextprotocol/server-filesystem) and which folders in your pc it’s allowed to the touch, on this case Paperwork and initiatives.

github must show who you might be to GitHub’s API, so it has an additional env block. GITHUB_PERSONAL_ACCESS_TOKEN is the place you paste your personal GitHub token. The server reads it as an atmosphere variable when it begins up, the identical approach a program run out of your terminal would.

Getting a GitHub token, step-by-step:

  1. Go to github.com and check in. Click on your profile picture within the top-right nook, then click on Settings.
  2. Within the left sidebar, click on Developer settings (it’s close to the underside).
  3. Click on Private entry tokens, then Positive-grained tokens, then Generate new token. GitHub now recommends fine-grained tokens over the older “traditional” ones, since you’ll be able to restrict them to particular repos as a substitute of your entire account.
  4. Give it a Token title (something memorable, like “claude-mcp”), and set an Expiration. GitHub warns in opposition to “no expiration” for good purpose, decide 90 days and put a renewal reminder in your calendar.
  5. Beneath Useful resource proprietor, decide your private account (or the group whose repos you want). Beneath Repository entry, select Solely choose repositories and decide simply those Claude truly wants, not all of them.
  6. Beneath Permissions, grant solely what you’ll use. For many workflows, Contents (learn and write) and Points (learn and write) cowl it. Add Pull requests (learn and write) in order for you Claude opening or reviewing PRs.
  7. Click on Generate token on the backside, then copy it instantly. GitHub exhibits a fine-grained token precisely as soon as, if you happen to navigate away earlier than copying it, you’ll need to generate a brand new one.

That token (it begins with github_pat_) is what goes instead of “ghp_your_token_here” within the JSON config above:

"GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_your_actual_token"

brave-search follows the identical sample as github: one command, one args record to run the proper bundle, and one env variable for its API key.

That’s the entire sample. Each server you ever add to this file follows the identical form: a reputation you select, a command to run it, arguments to configure it, and (if it must authenticate) an env block for its secrets and techniques.

Claude Code: Including MCP Servers through CLI

Claude Code has its personal MCP configuration floor separate from Claude Desktop, and it comes with a devoted CLI command that makes setup quicker than enhancing JSON manually.

You’ll be able to set up Claude Code following this information: Claude Code Information

Have already got servers arrange in Claude Desktop? Run claude mcp add-from-claude-desktop (macOS or WSL) to repeat them straight into Claude Code as a substitute of re-adding each by hand.

Including a Server with claude mcp add

The fundamental syntax is:

claude mcp add  --  [args...]

That’s the sample for a neighborhood server, one Claude Code runs itself as a subprocess. Hosted servers reached over a URL use –transport http as a substitute and skip the — command solely:

claude mcp add --transport http docs-server https://instance.com/mcp

Hosted servers want no Node.js, no native course of, and nothing to put in. They’re the simplest first server to attempt. Native servers, just like the Postgres instance under, want a command Claude Code can truly run in your machine.

For a Postgres database server:

claude mcp add --transport stdio project-db 
  -- npx -y @modelcontextprotocol/server-postgres 
     postgresql://localhost:5432/mydb

Claude Code helps three scopes for server configuration:

Scope Config Location Who Sees It Greatest For
Native (default) ~/.claude.json (per-project) You solely Private instruments, like GitHub, Slack, your DB
Undertaking .mcp.json in challenge root Your entire workforce (dedicated) Shared servers like Linear, Sentry
Consumer ~/.claude.json (top-level mcpServers key) Solely you, all initiatives Private instruments you need in all places, not project-specific

To confirm setup, run:

claude mcp record

The standing column tells you precisely what’s taking place:

Standing That means
✓ Linked Prepared to make use of
! Wants authentication Reachable, however wants a browser sign-in or a token
! Linked · instruments fetch failed Linked, however couldn’t record its instruments. Run claude mcp get for element
✗ Failed to attach Server didn’t reply. Run the uncooked command manually to see the true error
✗ Connection error The connection try itself threw an error
⏸ Pending approval A project-scoped server you haven’t authorised but

If it exhibits something aside from “Linked”, run the precise set up command manually in your terminal. The error it prints is way extra helpful than something within the standing line.

The Greatest MCP Servers to Set up First

The MCP ecosystem has over 2,300 public servers in Could 2026. Most are deserted demos. Those under are actively maintained, production-tested, and canopy 80% of actual workflows. My sincere take: set up 3–5 servers most to begin. Each server provides its software definitions to Claude’s context window, and a bloated software record visibly degrades Claude’s tool-selection high quality.

Server What It Allows Set up Bundle / Technique Greatest For
GitHub (Official) Create points, overview PRs, search code throughout repos Docker: ghcr.io/github/github-mcp-server All builders
Filesystem Learn, search, and organise information in your machine @modelcontextprotocol/server-filesystem Everybody
Courageous Search Stay net search with out rate-limit friction @modelcontextprotocol/server-brave-search Analysis duties
Postgres Question and handle your database in plain English @modelcontextprotocol/server-postgres Knowledge / backend groups
Notion Learn pages, question databases, replace docs from Claude Official Notion MCP server (OAuth) Data-heavy groups
Slack Learn channels, search historical past, ship messages @modelcontextprotocol/server-slack Workforce comms + ops
Context7 Up-to-date library docs, fixing the stale coaching information downside By way of npx or Claude Code CLI Builders constructing with APIs
Playwright Browser automation and net testing instantly in Claude Code @playwright/mcp QA and frontend engineers

For builders, the sensible starter pack is GitHub + Filesystem + Context7. That mixture covers 80% of coding workflows with out burning context tokens on unused instruments.

Frequent Errors and Fixes

73% of first-time MCP customers hit at the very least one connection error. Listed here are the 5 patterns that account for the overwhelming majority of failures, and the repair for every.

Error 1: Standing exhibits “Failed to attach” or “Connection error”

Each statuses imply the server didn’t begin, or an HTTP server’s URL didn’t reply. Run the precise set up command manually in your terminal and browse the error output instantly. The three commonest causes: npx not present in PATH (use absolute path), mistaken npm bundle title, or lacking atmosphere variable. Repair the underlying error earlier than touching the Claude config.

If it’s a neighborhood server timing out on its first run (npx downloading the bundle for the primary time can take some time), elevate the startup timeout as a substitute of assuming it’s damaged:

MCP_TIMEOUT=60000 claude

Error 2: Instruments don’t seem after connecting

Use the /mcp slash command inside a Claude Code session to pressure a reconnect. If instruments nonetheless don’t seem, run claude mcp get an empty software record means the server began however declared no instruments, normally a server-side config error. Restart with the up to date server config.

Error 3: JSON syntax error silently breaks all servers

A single lacking comma or mismatched bracket in claude_desktop_config.json silently disables each server. Run your JSON by means of jsonlint.com or use jq to validate earlier than restarting Claude. That is the one commonest first-install failure mode.

Error 4: Relative paths fail

Claude Desktop begins MCP servers with an undefined working listing, so relative paths like ./mydir by no means resolve. At all times use absolute paths: /Customers/yourname/initiatives as a substitute of ~/initiatives or ./initiatives.

Error 5: Context window will get eaten by software definitions

One developer measured 30–40% of their Claude context window going to MCP software schemas that had been by no means utilized in that session. If Claude appears unusually gradual or costly, the wrongdoer is sort of all the time too many linked servers. Prune to the three–5 servers you truly use in your present workflow. You’ll be able to all the time add extra later.

Scorching take: most individuals who suppose they want a higher-tier Claude plan truly simply want fewer MCP servers loaded. The context value is invisible however important. For a comparability of Claude plan options and what they really unlock

Superior: Construct Your Personal MCP Server

Constructing a customized MCP server is the quickest option to give Claude entry to inner instruments, proprietary APIs, or information that no public server covers. The Python SDK makes this surprisingly accessible: you outline instruments with decorators as a substitute of writing JSON schemas by hand.

The minimal viable MCP server in Python:

!pip set up mcp

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("my-server")

@mcp.software()
def get_data(question: str) -> str:
    """Fetch information from my inner API."""
    return my_api.fetch(question)

if __name__ == "__main__":
    mcp.run()

Register it in your Claude Desktop config the identical approach as another server level command at your Python interpreter and args on the server file path.

One safety notice that almost all tutorials skip: all the time use scoped permissions when connecting MCP servers. Grant read-only entry first, increase to put in writing entry solely when you’ve got confirmed the server behaves as anticipated. An MCP server with write entry to manufacturing programs and a misinterpreted immediate can do actual injury.

Conclusion

Connecting MCP servers to Claude turns it right into a sensible assistant that may work with information, repositories, databases, APIs, and different exterior instruments. Claude Desktop gives easy setup by means of Extensions or JSON configuration, whereas Claude Code makes server set up and administration simple by means of the CLI.

The most effective method is to begin with a number of important servers, use absolute paths, safe your credentials, and grant solely the permissions required. As soon as configured accurately, MCP creates a dependable bridge between Claude and the instruments you already use. With that basis in place, Claude turns into much more succesful, helpful, and prepared for real-world workflows.

Ceaselessly Requested Questions

Q1. What’s MCP in Claude AI?

A. MCP stands for Mannequin Context Protocol. It’s an open commonplace created by Anthropic in November 2024 that lets Claude hook up with exterior instruments, databases, information, and APIs by means of a common interface. With MCP enabled, Claude strikes from answering questions based mostly on coaching information to taking actual actions in linked programs studying information, querying databases, pushing GitHub commits, or sending Slack messages.

Q2. How do I arrange MCP in Claude Desktop?

A. Claude Desktop reads MCP configuration from claude_desktop_config.json. On macOS, the file is at ~/Library/Utility Help/Claude/claude_desktop_config.json. On Home windows, it’s at %APPDATApercentClaudeclaude_desktop_config.json. Add your server definitions below the mcpServers key utilizing absolute paths, save the file, then totally restart Claude Desktop. Alternatively, use Claude Desktop Extensions (.mcpb information, previously .dxt) for one-click set up of supported servers no JSON enhancing required.

Q3. How do I add MCP servers to Claude Code?

A. Use the CLI command: claude mcp add [args]. For instance, so as to add a Postgres server: claude mcp add project-db — npx -y @modelcontextprotocol/server-postgres postgresql://localhost:5432/mydb. Run claude mcp record to confirm the server linked. Claude Code helps native scope (private, default), challenge scope (team-shared through .mcp.json), and consumer scope (private, however lively throughout all of your initiatives).

Hello , I’m Sree Vamsi a passionate Knowledge Science fanatic at present working at Analytics Vidhya. My journey into information science started with a curiosity for uncovering insights from advanced information and has developed into constructing end-to-end Generative AI purposes, RAG pipelines, agentic AI workflows, and multi-agent programs that clear up real-world enterprise issues.

Login to proceed studying and revel in expert-curated content material.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles