How to Set Up MCP Servers in Claude Desktop (2026 Guide)
The config file location, the correct JSON format, your first MCP server running in under 5 minutes, and every common error fixed. No handwaving.
MCPHubz · Mar 1, 2026 · 7 min read
MCP (Model Context Protocol) lets Claude use external tools — your database, GitHub, the web, your filesystem — directly inside conversations. Setup takes about 5 minutes once you know where the config file lives. Most people get stuck on that part.
1Find your config file
Claude Desktop reads MCP server configuration from a single JSON file. Location by OS:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonOn Mac, you can open it fast from Terminal: open "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
If the file doesn't exist, create it. If the Claude directory doesn't exist, create that too. Claude Desktop will read it on next launch.
2The config format
The file contains one JSON object with an mcpServers key. Each server gets a named entry with a command and args:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}Common mistake: the mcpServers value is an object (curly braces), not an array (square brackets). Every tutorial that gets this wrong will break your setup silently.
3Install your first MCP server — GitHub
GitHub MCP is the most-installed server in the ecosystem. It lets Claude read your repos, create PRs, manage issues, and push commits.
Get a GitHub token
Go to GitHub → Settings → Developer settings → Personal access tokens → Generate new token (classic). Select the repo scope. Copy the token — you won't see it again.
Add it to your config
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxx"
}
}
}
}Restart Claude Desktop
Quit Claude Desktop completely (Cmd+Q on Mac, not just close the window) and relaunch it. Config changes only take effect on full restart.
4Verify it worked
In Claude Desktop, click the plug icon (bottom left of the input box). You should see "github" listed with a green dot. If it's there — you're done. Try asking: "List my recent GitHub repos".
Common errors and fixes
✗ Server doesn't appear in Claude Desktop
- You didn't fully quit Claude — Cmd+Q, not just close the window
- JSON syntax error in your config — run it through jsonlint.com
- Wrong file path — the file must be named claude_desktop_config.json exactly
✗ "npx: command not found"
- Node.js isn't installed. Download it from nodejs.org — Claude Desktop needs npx on your PATH
- On Mac with nvm: Claude Desktop doesn't inherit your shell PATH. Add "command": "/usr/local/bin/npx" with the absolute path
✗ GitHub MCP connects but returns "Bad credentials"
- Your token expired or was revoked — generate a new one
- Token doesn't have the repo scope — check the scopes on your token settings page
- You have SSO enabled on the org — you need to authorize the token for SSO too
✗ MCP server starts then immediately disconnects
- Run the command manually in Terminal first: npx -y @modelcontextprotocol/server-github — it will show the real error
- Check that the package name is correct — many fake/wrong package names exist
Adding more servers
Just add more entries under mcpServers. Here's a config with GitHub, Filesystem, and Brave Search:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxx"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "BSA_xxxx"
}
}
}
}Don't add 10 servers at once. Each MCP server adds context window overhead. Start with 2-3 that match your actual workflow.
MCPHubz Stack Builder generates your config automatically
Describe what you want to build. It picks the right servers and outputs the exact JSON — ready to paste.
Build My Config FreeBrowse all quality-vetted MCP servers → MCPHubz Directory