add
Add a new MCP server to your Claude Code configuration. Use this to install an MCP server, configure a new MCP server, set up MCP, register an MCP server, or connect a new tool server.
Add MCP Server
Add a new MCP server to the Claude Code configuration.
Config File Locations (Claude Code only)
- Global scope writes to
~/.claude.jsonundermcpServers. This is NOT~/.cursor/mcp.json. - Project scope writes to
.mcp.jsonat the project root.
Instructions
-
Check if the MCP Manager server is running:
curl -s --max-time 2 http://localhost:4111/api/health -
If the server is NOT running, start it:
cd "$CLAUDE_PLUGIN_ROOT" && nohup node server/index.js > ~/.mcp-manager.log 2>&1 & sleep 2 -
Gather the required information from the user if not already provided:
- name: Server name (e.g., "my-server")
- type: "stdio" or "http"
- scope:
"global"or the full absolute workspace path (e.g.,"/Users/me/my-project") for project scope. Do NOT use the string"project". Default to"global"unless the user specifies a project. - For stdio: command and args (array of strings)
- For http: url
-
Add the server:
curl -s -X POST http://localhost:4111/api/servers \ -H "Content-Type: application/json" \ -d '{ "name": "<NAME>", "scope": "<SCOPE>", "config": { "type": "<TYPE>", "command": "<COMMAND>", "args": ["<ARG1>", "<ARG2>"] } }'For HTTP type, use
"url"instead of"command"and"args". -
Confirm the server was added successfully. Mention which file was modified:
- Global: added to
~/.claude.json - Project: added to
.mcp.jsonin the project root
- Global: added to
-
Remind the user to restart their Claude Code session to activate it.