Connecting MCP servers to Claude permits it to work with exterior instruments, recordsdata, databases, repositories, and different methods as an alternative 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 discover ways to join MCP servers with Claude Desktop and Claude Code, a sensible step-by-step information for getting every setup operating appropriately.
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 device by 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 occasions 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 |
| Shopper | 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 by way of MCP. | GitHub MCP server, Filesystem MCP server |
Whenever you ask Claude to “examine my open GitHub PRs”, here’s what occurs behind the scenes:
- Claude identifies it wants an exterior device to fulfil the request.
- The MCP shopper in Claude sends a JSON-RPC request to the GitHub MCP server.
- The server queries GitHub’s API and returns structured information.
- Claude incorporates that information into its context and generates your reply.
The entire move takes underneath a second. You by no means see the plumbing.
As of April 2026, Streamable HTTP is Anthropic’s official really useful 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 recordsdata, previously .dxt) and the normal JSON config methodology. Use Extensions for supported servers; use JSON config for something customized.
Methodology 1: Desktop Extensions (One-Click on, No JSON)
As of early 2026, Claude Desktop helps Desktop Extensions, pre-packaged MCP servers distributed as .mcpb recordsdata (MCP Bundle; older guides could name these .dxt recordsdata, which nonetheless work however are the legacy title). These set up with a double-click. No JSON enhancing, no Node.js PATH points.
- Open Claude Desktop.
- Click on the “+” button within the bottom-left of the chat enter.
- Choose “Connectors” to open the connectors menu.
- 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).
- Restart Claude Desktop. The server prompts robotically.
Desktop Extensions are the suitable alternative for non-technical customers or servers you need to “set and neglect.” The JSON config methodology under is correct for customized servers, non-public servers, or full management over arguments and surroundings variables.
Methodology 2: JSON Config (Full Management)
Claude Desktop reads its MCP configuration from claude_desktop_config.json. The file location is dependent 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 is dependent upon the way you put in Claude Desktop, and this journeys up lots of people. There are two utterly totally different areas:
- 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 an alternative of the usual location each piece 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, appropriately escaped config appears to be like like:

Enhancing the Config File
Open Claude Desktop → prime 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 an inventory of servers you need Claude to find out about. Every server will get its personal entry inside that listing, and also you choose 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 start out that server (normally npx, since most servers are distributed as npm packages)
- args: the listing of arguments handed to that command, precisely such as you’d kind them in a terminal
- env:Â any surroundings 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 occurring in every of the three servers:
filesystem doesn’t want any credentials, so it solely has command and args. The args listing tells npx which bundle to run (@modelcontextprotocol/server-filesystem) and which folders in your laptop it’s allowed to the touch, on this case Paperwork and tasks.
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 surroundings variable when it begins up, the identical approach a program run out of your terminal would.
Getting a GitHub token, step-by-step:
- Go to github.com and register. Click on your profile photograph within the top-right nook, then click on Settings.
- Within the left sidebar, click on Developer settings (it’s close to the underside).
- Click on Private entry tokens, then Superb-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 an alternative of your entire account.
- Give it a Token title (something memorable, like “claude-mcp”), and set an Expiration. GitHub warns in opposition to “no expiration” for good purpose, choose 90 days and put a renewal reminder in your calendar.
- Beneath Useful resource proprietor, choose your private account (or the group whose repos you want). Beneath Repository entry, select Solely choose repositories and choose simply those Claude truly wants, not all of them.
- 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) if you need Claude opening or reviewing PRs.
- Click on Generate token on the backside, then copy it instantly. GitHub reveals a fine-grained token precisely as soon as, when you 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 rather than “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 listing to run the suitable 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 by way of 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 possibly can 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 an alternative 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 an alternative 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 strive. 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 |
| Challenge | .mcp.json in mission root | Your entire staff (dedicated) | Shared servers like Linear, Sentry |
| Person | ~/.claude.json (top-level mcpServers key) | Solely you, all tasks | Private instruments you need in all places, not project-specific |
To confirm setup, run:
claude mcp listing
The standing column tells you precisely what’s occurring:
| 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 listing its instruments. Run claude mcp get for element |
| ✗ Failed to attach | Server didn’t reply. Run the uncooked command manually to see the actual error |
| âś— Connection error | The connection try itself threw an error |
| ⏸ Pending approval | A project-scoped server you haven’t authorised but |
If it reveals something apart 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 Might 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 start out. Each server provides its device definitions to Claude’s context window, and a bloated device listing visibly degrades Claude’s tool-selection high quality.
| Server | What It Permits | Set up Bundle / Methodology | Greatest For |
|---|---|---|---|
| GitHub (Official) | Create points, evaluate PRs, search code throughout repos | Docker: ghcr.io/github/github-mcp-server |
All builders |
| Filesystem | Learn, search, and organise recordsdata in your machine | @modelcontextprotocol/server-filesystem |
Everybody |
| Courageous Search | Reside 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 |
Information / 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 | Through npx or Claude Code CLI |
Builders constructing with APIs |
| Playwright | Browser automation and net testing immediately 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 not less than 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 reveals “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 skim the error output immediately. The three most typical causes: npx not present in PATH (use absolute path), unsuitable npm bundle title, or lacking surroundings 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 an alternative 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 drive a reconnect. If instruments nonetheless don’t seem, run claude mcp get an empty device listing 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 jsonlint.com or use jq to validate earlier than restarting Claude. That is the only most typical 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/tasks as an alternative of ~/tasks or ./tasks.
Error 5: Context window will get eaten by device definitions
One developer measured 30–40% of their Claude context window going to MCP device schemas that had been by no means utilized in that session. If Claude appears unusually sluggish 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 possibly can all the time add extra later.
Sizzling take: most individuals who assume they want a higher-tier Claude plan truly simply want fewer MCP servers loaded. The context price is invisible however vital. 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 method 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 an alternative 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.device()
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 word that almost all tutorials skip: all the time use scoped permissions when connecting MCP servers. Grant read-only entry first, increase to jot down entry solely when you have got confirmed the server behaves as anticipated. An MCP server with write entry to manufacturing methods and a misinterpreted immediate can do actual harm.
Conclusion
Connecting MCP servers to Claude turns it right into a sensible assistant that may work with recordsdata, repositories, databases, APIs, and different exterior instruments. Claude Desktop provides easy setup by Extensions or JSON configuration, whereas Claude Code makes server set up and administration straightforward by the CLI.
One of the best strategy is to start out with a couple of important servers, use absolute paths, safe your credentials, and grant solely the permissions required. As soon as configured appropriately, 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.
Incessantly Requested Questions
A. MCP stands for Mannequin Context Protocol. It’s an open normal created by Anthropic in November 2024 that lets Claude hook up with exterior instruments, databases, recordsdata, and APIs by a common interface. With MCP enabled, Claude strikes from answering questions primarily based on coaching information to taking actual actions in linked methods studying recordsdata, querying databases, pushing GitHub commits, or sending Slack messages.
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 underneath the mcpServers key utilizing absolute paths, save the file, then absolutely restart Claude Desktop. Alternatively, use Claude Desktop Extensions (.mcpb recordsdata, previously .dxt) for one-click set up of supported servers no JSON enhancing required.
A. Use the CLI command: claude mcp add
Login to proceed studying and luxuriate in expert-curated content material.
