Repository navigation
How do I add an MCP server to Claude Code? #1
Unanswered
nemesisLLC
asked this question in
Q&A
Replies: 1 comment
|
You can add an MCP server to Claude Code via the CLI: # Local stdio server
claude mcp add my-server -- npx -y @modelcontextprotocol/server-filesystem /path
# Remote HTTP/SSE server
claude mcp add --transport http my-server https://example.com/mcpUse |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Short answer: one command, then start a new session.
The
--separates Claude Code's own options from the server's command.API keys and headers
claude mcp add --env AIRTABLE_API_KEY=your_key airtable -- npx -y airtable-mcp-server claude mcp add --transport http my-api https://api.example.com/mcp --header "Authorization: Bearer your-token"Servers that use OAuth open a browser the first time. You can also run
/mcpin a session orclaude mcp login <name>.Which scope?
local(default)~/.claude.json, under the project pathproject.mcp.jsonin the repo rootuser~/.claude.jsonCheck it worked
If it says "Failed to connect", run the server's command yourself in a terminal first (
npx -y @upstash/context7-mcp). If it fails there, the problem is the server or a missing Node/Python, not Claude Code.Full guide, including
.mcp.jsonwith${VAR}placeholders: https://calyban.com/blog/install-mcp-servers-claude-code-codex(If you'd rather not touch config files, Calyban is a free Windows app that writes this for you and for five other agents. The commands above work fine without it.)
All reactions