Use this skill when configuring, installing, or managing MCP (Model Context Protocol) servers in Claude Code. Intended for situations where users need to connect Claude Code to external tools, databases, APIs, or services via MCP integration.
Guide Claude through configuring and managing MCP (Model Context Protocol) servers to connect Claude Code with external tools, databases, and services.
MCP servers enable Claude Code to interact with external tools and data sources through a standardized protocol. This skill helps install, configure, and manage MCP servers across different scopes (local, project, user), authenticate with remote services, and troubleshoot connection issues.
Use this skill when:
Do NOT use this skill for:
MCP servers can connect using three transport mechanisms:
Best for cloud-based services with REST APIs.
Basic syntax:
claude mcp add --transport http <name> <url>
Examples:
# Simple HTTP server
claude mcp add --transport http notion https://mcp.notion.com/mcp
# With authentication header
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"
# With custom headers
claude mcp add --transport http custom-api https://api.example.com/mcp \
--header "X-API-Key: key123" \
--header "X-Custom-Header: value"
Server-Sent Events transport. Use HTTP where available.
Basic syntax:
claude mcp add --transport sse <name> <url>
Example:
claude mcp add --transport sse asana https://mcp.asana.com/sse
For local processes needing direct system access.
Basic syntax:
claude mcp add --transport stdio <name> [--env KEY=value] -- <command> [args...]
Examples:
# NPM package
claude mcp add --transport stdio airtable \
--env AIRTABLE_API_KEY=YOUR_KEY \
-- npx -y airtable-mcp-server
# Local script
claude mcp add --transport stdio custom-tool \
--env CONFIG_PATH=/path/to/config \
-- /usr/local/bin/custom-mcp-server
# Python package
claude mcp add --transport stdio python-tool \
-- python -m my_mcp_server
Important: Use -- to separate Claude CLI flags from MCP server command/arguments.
MCP servers can be configured at three different scopes:
.mcp.json (gitignored)claude mcp add --scope local (or omit --scope).mcp.json (committed to git)claude mcp add --scope project~/.claude/mcp.jsonclaude mcp add --scope userScope precedence: Local > Project > User
When the same server name exists in multiple scopes, the highest precedence wins.
To configure an MCP server, follow this process:
Determine what information is needed:
Example questions to ask:
Based on the requirements:
Choose HTTP when:
Choose stdio when:
Choose SSE when:
Choose scope based on:
Use the appropriate claude mcp add command based on transport and scope.
HTTP example:
claude mcp add --transport http --scope project \
notion https://mcp.notion.com/mcp
Stdio example:
claude mcp add --transport stdio --scope user \
airtable \
--env AIRTABLE_API_KEY=${AIRTABLE_API_KEY} \
-- npx -y airtable-mcp-server
With multiple environment variables:
claude mcp add --transport stdio --scope project \
custom-db \
--env DB_HOST=${DB_HOST} \
--env DB_PORT=${DB_PORT:-5432} \
--env DB_NAME=analytics \
-- /usr/local/bin/db-mcp-server
After installation:
List servers:
claude mcp list
Get server details:
claude mcp get <server-name>
Test in Claude Code:
/mcp to see server statusSome servers require OAuth or additional authentication:
/mcp command/mcp menuTokens are securely stored and auto-refreshed. Clear with "Clear authentication" from /mcp menu.
If the server isn't working:
Check server status:
claude mcp list
Get detailed information:
claude mcp get <server-name>
Common issues:
Server not starting (stdio)
which npx, which pythoncmd /c wrapper: -- cmd /c npx -y packageAuthentication failures (HTTP/SSE)
/mcp to re-authenticate OAuth serversServer timeout
MCP_TIMEOUT=10000 claudeOutput limit warnings
export MAX_MCP_OUTPUT_TOKENS=50000For additional details on popular MCP servers and their specific configurations, consult the official MCP documentation.
claude mcp add --transport http --scope user \
service-name https://api.service.com/mcp \
--header "Authorization: Bearer ${API_KEY}"
claude mcp add --transport stdio --scope user \
package-name \
--env API_KEY=${API_KEY} \
-- npx -y @org/mcp-package
claude mcp add --transport stdio --scope project \
analytics-db \
--env DB_URL=${ANALYTICS_DB_URL} \
-- npx -y @bytebase/dbhub
claude mcp add --transport stdio --scope user \
my-tool \
-- /usr/local/bin/my-mcp-tool
MCP configurations support environment variable expansion:
Syntax:
${VAR} - Required variable (error if not set)${VAR:-default} - Optional with default valueExamples:
# Required variable
--env DB_HOST=${DB_HOST}
# Optional with default
--env DB_PORT=${DB_PORT:-5432}
# Literal value
--env ENVIRONMENT=production
# Multiple variables
--env API_URL=${API_URL} \
--env API_KEY=${API_KEY} \
--env TIMEOUT=${TIMEOUT:-30}
Setting environment variables:
# In shell (temporary)
export API_KEY=your-key-here
claude mcp add --transport stdio tool --env API_KEY=${API_KEY} -- npx tool
# In .env file (project)
echo "API_KEY=your-key-here" >> .env
source .env
claude mcp add ...
# In shell profile (permanent)
echo 'export API_KEY=your-key-here' >> ~/.zshrc
source ~/.zshrc
claude mcp list
Shows all configured servers across all scopes with status.
claude mcp get <server-name>
Shows configuration, scope, transport type, and status.
claude mcp remove <server-name>
Removes from the scope where it was added.
Within Claude Code, use /mcp command to:
Once servers are connected:
Claude Code automatically sees MCP tools. Just ask:
> "Check Sentry for errors in the last 24 hours"
> "Create a GitHub issue for this bug"
> "Query the database for user count"
Type @ to list available resources:
> "Analyze @github:issue://123"
> "Review @notion:page://abc123"
Resources are auto-fetched and attached to context.
MCP prompts appear as slash commands:
/mcp__github__list_prs
/mcp__github__pr_review 456
/mcp__jira__create_issue "Bug in login" high
Plugins can bundle MCP servers that start automatically:
Plugin configuration (.mcp.json in plugin root):
{
"database-tools": {
"command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server",
"args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"],
"env": {
"DB_URL": "${DB_URL}"
}
}
}
Key points:
/mcp commands${CLAUDE_PLUGIN_ROOT} for plugin-relative paths/mcp menu but managed by pluginFor team-wide MCP server setup:
Use project scope for shared integrations:
claude mcp add --scope project \
github https://api.githubcopilot.com/mcp/
Commit .mcp.json to repository
Document required environment variables in README:
## Required Environment Variables
- `GITHUB_TOKEN` - GitHub personal access token
- `JIRA_API_KEY` - Jira API key
Team members set environment variables locally:
export GITHUB_TOKEN=ghp_xxxx
export JIRA_API_KEY=xxxx
For sensitive values:
.mcp.json${VAR} expansion.env files (gitignored) for local valuesFor non-sensitive values:
--env ENVIRONMENT=productionImport existing MCP servers from Claude Desktop:
claude mcp add-from-claude-desktop
Interactively select which servers to import. Configurations are copied to appropriate scope.
Add servers via JSON for programmatic setup:
# HTTP server
claude mcp add-json weather-api '{
"type": "http",
"url": "https://api.weather.com/mcp",
"headers": {
"Authorization": "Bearer token"
}
}'
# Stdio server
claude mcp add-json db-tool '{
"type": "stdio",
"command": "npx",
"args": ["-y", "@tool/mcp"],
"env": {
"DB_URL": "${DB_URL}"
}
}'
For additional information about MCP:
Symptoms: Server added but not visible in /mcp
Solutions:
claude mcp listclaude mcp get <name>Symptoms: OAuth flow fails or API returns 401/403
Solutions:
/mcp to re-authenticate"Authorization: Bearer token"/mcp → Clear authenticationSymptoms: "command not found" for stdio servers
Solutions:
which npx, which python-- /usr/local/bin/tool-- cmd /c npx -y packageSymptoms: ${VAR} appears literally in configuration
Solutions:
echo $VARexport VAR=value--env VAR=$VAR (expanded by shell)Symptoms: Server connection times out
Solutions:
MCP_TIMEOUT=10000 claudeThis skill works alongside other claude-code-meta skills:
claude-code-plugins - For bundling MCP servers in pluginsActivate these skills when working on plugin-provided MCP servers or automated MCP configuration workflows.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer