Claude Code MCP Guide -- Knowledge Bank
Expert guidance for connecting Claude Code to external tools via MCP (Model Context Protocol). Covers server setup, configuration scopes, Tool Search, plugin integration, best practices, and troubleshooting.
Source Authority
This skill draws from:
- Official Claude Code documentation at code.claude.com/docs/en/mcp
- Anthropic engineering blog posts on MCP patterns
- Claude Code settings and configuration reference
- Plugin system reference documentation
Community Perspective (Opt-In)
This skill does NOT maintain a community intel cache. For live community signal on MCP usage patterns, hand off to /research:newsroom when the user asks for community perspective.
Auto-detect these signals -- if the user's question contains any of these, offer to run community research:
- "what MCP servers are people using", "popular MCP servers"
- "has anyone", "examples", "real-world"
- "community", "Reddit", "what's trending"
- "MCP vs skills debate", "should I use MCP or skills"
When detected: Answer from reference files first, then offer to run /research:newsroom for community perspective.
Step 1: Classify the Question
Parse the user's question into one or more intent categories. If a question spans multiple categories, identify the primary intent and address it first, then connect to secondary categories.
| Intent |
Trigger Signals |
Reference File |
| Setup & Installation |
add MCP, install MCP, connect, remote, HTTP, SSE, stdio, OAuth, Claude Desktop import, popular servers, MCP server list, JSON config, claude mcp add |
setup-and-installation.md |
| Scopes & Configuration |
.mcp.json, local scope, project scope, user scope, precedence, managed-mcp.json, enableAllProjectMcpServers, allowedMcpServers, deniedMcpServers, env var, environment variable, scope hierarchy |
scopes-and-configuration.md |
| Tool Search & Scaling |
Tool Search, lazy loading, ENABLE_TOOL_SEARCH, too many tools, context overhead, tool definitions, MCP output limits, MAX_MCP_OUTPUT_TOKENS, MCP_TIMEOUT, MCP_TOOL_TIMEOUT, token cost, accuracy |
tool-search-and-scaling.md |
| MCP in Plugins |
plugin MCP, .mcp.json in plugin, plugin.json mcp, CLAUDE_PLUGIN_ROOT, plugin server, auto-start, plugin MCP troubleshoot |
mcp-in-plugins.md |
| Best Practices |
best practice, MCP vs skills, when to use MCP, when to use skills, context cost, response_format, code execution pattern, CLI vs MCP, subagent, architecture, design pattern |
best-practices.md |
| Troubleshooting |
not working, not connecting, error, broken, debug, server not appearing, permission, timeout, output truncated, MCP failed, connection refused, config error |
troubleshooting.md |
Step 2: Read Reference Files
Read the relevant reference file(s) based on the classification. For multi-intent questions, read all relevant files.
Step 3: Synthesize Answer
Response Structure
Every response should follow this structure:
- Direct answer -- one-line answer, no preamble
- Configuration -- .mcp.json snippets, settings.json configs, or CLI commands (copy-paste ready)
- Why it works -- brief explanation of the design decision
- Verify step -- how to confirm it works (
/mcp menu, claude mcp list, etc.)
- Common failure -- what goes wrong and how to fix
- Source -- reference file cited
For Setup Questions
- Show the exact CLI command or .mcp.json config
- Specify transport type (HTTP, SSE, stdio) and when to use each
- Include authentication steps if applicable
- Show how to verify with
/mcp or claude mcp list
For Scope/Config Questions
- Show the config file path and format
- Explain precedence (local > project > user)
- Show environment variable expansion syntax
- Note managed policy implications if relevant
For Tool Search Questions
- Explain how lazy loading works (deferred tool definitions)
- Show the ENABLE_TOOL_SEARCH configuration options
- Provide token cost numbers (before/after)
- Note accuracy improvements with citations
For Plugin MCP Questions
- Show .mcp.json format in plugin context
- Explain auto-start behavior
- Show ${CLAUDE_PLUGIN_ROOT} path variable usage
- Note the distinction from user/project MCP config
For Best Practice Questions
- Use the MCP vs Skills comparison table
- Show concrete examples of when each is appropriate
- Include the code execution pattern for token efficiency
- Reference context cost data
For Troubleshooting Questions
- Match symptoms to the troubleshooting table
- Provide debug steps in order of likelihood
- Include exact commands (
/mcp, claude mcp list, claude --debug)
- Check config file locations
Response Guidelines
- Always cite the reference file you draw from
- Provide copy-paste configs -- users should be able to use .mcp.json and settings.json snippets immediately
- Show CLI commands --
claude mcp add commands for quick setup
- Be direct -- answer first, then context
- Tables for comparisons -- transports, scopes, MCP vs skills
- Warn about common mistakes -- wrong scope, missing env vars, output limits
- Link to sibling skills when the question crosses boundaries (hooks for MCP hooks, skills-guide for skill authoring)
Examples
Example 1: Adding an MCP Server
User: How do I add an MCP server to Claude Code?
Skill: [Reads setup-and-installation.md]
Three transport options:
1. **Remote HTTP** (recommended for hosted servers):
claude mcp add my-server --transport http https://api.example.com/mcp
2. **Remote SSE** (legacy streaming):
claude mcp add my-server --transport sse https://api.example.com/sse
3. **Local stdio** (local process):
claude mcp add my-server -- npx -y @example/mcp-server
Verify: run `/mcp` to see connected servers and their tools.
**Common mistake:** Forgetting `--transport http` for remote servers.
Default is stdio, which tries to spawn a local process.
Source: setup-and-installation.md
Example 2: MCP vs Skills
User: When should I use MCP tools vs skills?
Skill: [Reads best-practices.md]
MCP = tool connectivity (the kitchen). Skills = workflow knowledge (the recipes).
| Use MCP When | Use Skills When |
|-------------|----------------|
| Need database access | Need workflow orchestration |
| Need API integration | Need domain knowledge |
| High-frequency ops (test runner, linter) | Multi-step processes |
| Need to control output format/tokens | Need to teach Claude patterns |
**Best together:** MCP server for tool access + skill for workflow guidance.
Example: Sentry MCP for error data + skill for triage workflow.
The code execution pattern (Anthropic engineering blog) shows
presenting MCP tools as code APIs rather than direct calls can reduce
token usage by 98.7%.
Source: best-practices.md
Example 3: Tool Search / Context Bloat
User: My MCP servers are using too many tokens
Skill: [Reads tool-search-and-scaling.md]
Tool Search (shipped Claude Code 2.1.7, Jan 2026) auto-defers MCP tool
definitions when they exceed 10% of context. This reduces overhead
by 85-95% (from ~51-77K to ~5-8.5K tokens).
Check if it's active:
- Run `/mcp` to see per-server token costs
- Run `/context` to see total context usage
Configure:
export ENABLE_TOOL_SEARCH=auto:3 # defer when >3 servers (default)
export ENABLE_TOOL_SEARCH=true # always on
export ENABLE_TOOL_SEARCH=false # always off
For MCP server authors: write clear, descriptive tool names and
descriptions -- Tool Search uses these to find tools at runtime.
Source: tool-search-and-scaling.md
Example 4: Troubleshooting
User: My MCP server isn't connecting
Skill: [Reads troubleshooting.md]
Debug steps in order of likelihood:
1. **Check config location** -- run `claude mcp list` to see registered servers.
Config lives in:
- .mcp.json (project scope)
- ~/.claude.json (user scope)
2. **Verify transport** -- HTTP servers need `--transport http`.
Without it, Claude tries to spawn a local process.
3. **Check server is running** -- for local stdio servers, ensure the
command works standalone: `npx -y @example/mcp-server`
4. **Permission denied** -- first use requires trust verification.
Check `/mcp` for pending approvals.
5. **Environment variables** -- .mcp.json supports ${VAR} expansion.
Ensure vars are set in your shell profile.
Debug: `claude --debug` shows MCP connection attempts.
Source: troubleshooting.md
Example 5: Cross-Skill Boundary
User: How do I add hooks to my MCP server?
Skill: [Detects cross-skill boundary -> hooks domain]
MCP-related hooks are configured in settings.json, not .mcp.json.
Use PreToolUse/PostToolUse events with matchers targeting MCP tool names.
Quick example -- log all MCP tool calls:
{
"hooks": {
"PostToolUse": [{
"matcher": "mcp__.*",
"hooks": [{ "type": "command", "command": "echo $TOOL_NAME >> mcp.log" }]
}]
}
}
For full hook configuration, event types, and decision control,
ask /hooks about hook types and configuration.
Sources: best-practices.md (MCP patterns), hooks skill (hook mechanics)
Source: nathanvale/side-quest-plugins — distributed by TomeVault.
1---2name: nathanvale-side-quest-plugins-mcp-guide3description: Claude Code MCP Guide -- Knowledge Bank4---56# Claude Code MCP Guide -- Knowledge Bank78Expert guidance for connecting Claude Code to external tools via MCP (Model Context Protocol). Covers server setup, configuration scopes, Tool Search, plugin integration, best practices, and troubleshooting.910## Source Authority1112This skill draws from:13- Official Claude Code documentation at code.claude.com/docs/en/mcp14- Anthropic engineering blog posts on MCP patterns15- Claude Code settings and configuration reference16- Plugin system reference documentation1718## Community Perspective (Opt-In)1920This skill does NOT maintain a community intel cache. For live community signal on MCP usage patterns, hand off to `/research:newsroom` when the user asks for community perspective.2122**Auto-detect these signals** -- if the user's question contains any of these, offer to run community research:23- "what MCP servers are people using", "popular MCP servers"24- "has anyone", "examples", "real-world"25- "community", "Reddit", "what's trending"26- "MCP vs skills debate", "should I use MCP or skills"2728**When detected**: Answer from reference files first, then offer to run `/research:newsroom` for community perspective.2930## Step 1: Classify the Question3132Parse the user's question into one or more intent categories. If a question spans multiple categories, identify the primary intent and address it first, then connect to secondary categories.3334| Intent | Trigger Signals | Reference File |35|--------|----------------|----------------|36| **Setup & Installation** | add MCP, install MCP, connect, remote, HTTP, SSE, stdio, OAuth, Claude Desktop import, popular servers, MCP server list, JSON config, claude mcp add | [setup-and-installation.md](references/setup-and-installation.md) |37| **Scopes & Configuration** | .mcp.json, local scope, project scope, user scope, precedence, managed-mcp.json, enableAllProjectMcpServers, allowedMcpServers, deniedMcpServers, env var, environment variable, scope hierarchy | [scopes-and-configuration.md](references/scopes-and-configuration.md) |38| **Tool Search & Scaling** | Tool Search, lazy loading, ENABLE_TOOL_SEARCH, too many tools, context overhead, tool definitions, MCP output limits, MAX_MCP_OUTPUT_TOKENS, MCP_TIMEOUT, MCP_TOOL_TIMEOUT, token cost, accuracy | [tool-search-and-scaling.md](references/tool-search-and-scaling.md) |39| **MCP in Plugins** | plugin MCP, .mcp.json in plugin, plugin.json mcp, CLAUDE_PLUGIN_ROOT, plugin server, auto-start, plugin MCP troubleshoot | [mcp-in-plugins.md](references/mcp-in-plugins.md) |40| **Best Practices** | best practice, MCP vs skills, when to use MCP, when to use skills, context cost, response_format, code execution pattern, CLI vs MCP, subagent, architecture, design pattern | [best-practices.md](references/best-practices.md) |41| **Troubleshooting** | not working, not connecting, error, broken, debug, server not appearing, permission, timeout, output truncated, MCP failed, connection refused, config error | [troubleshooting.md](references/troubleshooting.md) |4243## Step 2: Read Reference Files4445Read the relevant reference file(s) based on the classification. For multi-intent questions, read all relevant files.4647## Step 3: Synthesize Answer4849### Response Structure5051Every response should follow this structure:52531. **Direct answer** -- one-line answer, no preamble542. **Configuration** -- .mcp.json snippets, settings.json configs, or CLI commands (copy-paste ready)553. **Why it works** -- brief explanation of the design decision564. **Verify step** -- how to confirm it works (`/mcp` menu, `claude mcp list`, etc.)575. **Common failure** -- what goes wrong and how to fix586. **Source** -- reference file cited5960### For Setup Questions61621. Show the exact CLI command or .mcp.json config632. Specify transport type (HTTP, SSE, stdio) and when to use each643. Include authentication steps if applicable654. Show how to verify with `/mcp` or `claude mcp list`6667### For Scope/Config Questions68691. Show the config file path and format702. Explain precedence (local > project > user)713. Show environment variable expansion syntax724. Note managed policy implications if relevant7374### For Tool Search Questions75761. Explain how lazy loading works (deferred tool definitions)772. Show the ENABLE_TOOL_SEARCH configuration options783. Provide token cost numbers (before/after)794. Note accuracy improvements with citations8081### For Plugin MCP Questions82831. Show .mcp.json format in plugin context842. Explain auto-start behavior853. Show ${CLAUDE_PLUGIN_ROOT} path variable usage864. Note the distinction from user/project MCP config8788### For Best Practice Questions89901. Use the MCP vs Skills comparison table912. Show concrete examples of when each is appropriate923. Include the code execution pattern for token efficiency934. Reference context cost data9495### For Troubleshooting Questions96971. Match symptoms to the troubleshooting table982. Provide debug steps in order of likelihood993. Include exact commands (`/mcp`, `claude mcp list`, `claude --debug`)1004. Check config file locations101102## Response Guidelines103104- **Always cite the reference file** you draw from105- **Provide copy-paste configs** -- users should be able to use .mcp.json and settings.json snippets immediately106- **Show CLI commands** -- `claude mcp add` commands for quick setup107- **Be direct** -- answer first, then context108- **Tables for comparisons** -- transports, scopes, MCP vs skills109- **Warn about common mistakes** -- wrong scope, missing env vars, output limits110- **Link to sibling skills** when the question crosses boundaries (hooks for MCP hooks, skills-guide for skill authoring)111112## Examples113114### Example 1: Adding an MCP Server115116```text117User: How do I add an MCP server to Claude Code?118119Skill: [Reads setup-and-installation.md]120121Three transport options:1221231. **Remote HTTP** (recommended for hosted servers):124 claude mcp add my-server --transport http https://api.example.com/mcp1251262. **Remote SSE** (legacy streaming):127 claude mcp add my-server --transport sse https://api.example.com/sse1281293. **Local stdio** (local process):130 claude mcp add my-server -- npx -y @example/mcp-server131132Verify: run `/mcp` to see connected servers and their tools.133134**Common mistake:** Forgetting `--transport http` for remote servers.135Default is stdio, which tries to spawn a local process.136137Source: setup-and-installation.md138```139140### Example 2: MCP vs Skills141142```text143User: When should I use MCP tools vs skills?144145Skill: [Reads best-practices.md]146147MCP = tool connectivity (the kitchen). Skills = workflow knowledge (the recipes).148149| Use MCP When | Use Skills When |150|-------------|----------------|151| Need database access | Need workflow orchestration |152| Need API integration | Need domain knowledge |153| High-frequency ops (test runner, linter) | Multi-step processes |154| Need to control output format/tokens | Need to teach Claude patterns |155156**Best together:** MCP server for tool access + skill for workflow guidance.157Example: Sentry MCP for error data + skill for triage workflow.158159The code execution pattern (Anthropic engineering blog) shows160presenting MCP tools as code APIs rather than direct calls can reduce161token usage by 98.7%.162163Source: best-practices.md164```165166### Example 3: Tool Search / Context Bloat167168```text169User: My MCP servers are using too many tokens170171Skill: [Reads tool-search-and-scaling.md]172173Tool Search (shipped Claude Code 2.1.7, Jan 2026) auto-defers MCP tool174definitions when they exceed 10% of context. This reduces overhead175by 85-95% (from ~51-77K to ~5-8.5K tokens).176177Check if it's active:178- Run `/mcp` to see per-server token costs179- Run `/context` to see total context usage180181Configure:182 export ENABLE_TOOL_SEARCH=auto:3 # defer when >3 servers (default)183 export ENABLE_TOOL_SEARCH=true # always on184 export ENABLE_TOOL_SEARCH=false # always off185186For MCP server authors: write clear, descriptive tool names and187descriptions -- Tool Search uses these to find tools at runtime.188189Source: tool-search-and-scaling.md190```191192### Example 4: Troubleshooting193194```text195User: My MCP server isn't connecting196197Skill: [Reads troubleshooting.md]198199Debug steps in order of likelihood:2002011. **Check config location** -- run `claude mcp list` to see registered servers.202 Config lives in:203 - .mcp.json (project scope)204 - ~/.claude.json (user scope)2052062. **Verify transport** -- HTTP servers need `--transport http`.207 Without it, Claude tries to spawn a local process.2082093. **Check server is running** -- for local stdio servers, ensure the210 command works standalone: `npx -y @example/mcp-server`2112124. **Permission denied** -- first use requires trust verification.213 Check `/mcp` for pending approvals.2142155. **Environment variables** -- .mcp.json supports ${VAR} expansion.216 Ensure vars are set in your shell profile.217218Debug: `claude --debug` shows MCP connection attempts.219220Source: troubleshooting.md221```222223### Example 5: Cross-Skill Boundary224225```text226User: How do I add hooks to my MCP server?227228Skill: [Detects cross-skill boundary -> hooks domain]229230MCP-related hooks are configured in settings.json, not .mcp.json.231Use PreToolUse/PostToolUse events with matchers targeting MCP tool names.232233Quick example -- log all MCP tool calls:234 {235 "hooks": {236 "PostToolUse": [{237 "matcher": "mcp__.*",238 "hooks": [{ "type": "command", "command": "echo $TOOL_NAME >> mcp.log" }]239 }]240 }241 }242243For full hook configuration, event types, and decision control,244ask /hooks about hook types and configuration.245246Sources: best-practices.md (MCP patterns), hooks skill (hook mechanics)247```248249---250> Source: [nathanvale/side-quest-plugins](https://github.com/nathanvale/side-quest-plugins) — distributed by [TomeVault](https://tomevault.io).251<!-- tomevault:4.0:skill_md:2026-06-16 -->