managing-mcp-servers
Provides comprehensive guidance for managing MCP (Model Context Protocol) servers using the claude mcp CLI. Covers adding servers across scopes (project, local, user), transport types (stdio, sse, http), security best practices, and common patterns. Strongly recommends project scope for team consistency and version control.
What this skill does
# Managing MCP Servers
Comprehensive guidance for managing MCP (Model Context Protocol) servers in Claude Code.
## Overview
MCP servers extend Claude Code's capabilities by providing additional tools, resources, and prompts. They can be configured at three scopes:
- **project** (`.mcp.json` in project root) - **PREFERRED**: Project-specific servers (committed to version control)
- **local** (`~/.config/claude/mcp.json`) - Local machine configuration
- **user** (`~/.claude/mcp.json`) - Available globally across all projects
## Default Recommendation
**๐ฏ Always add MCP servers to project scope (`--scope project`) unless you have a specific reason to use local or user scope.**
Benefits of project scope:
- โ
Team consistency - everyone uses the same tools
- โ
Self-documenting - `.mcp.json` shows what tools the project needs
- โ
Easy onboarding - new team members get tools automatically
- โ
Version controlled - changes are tracked in git
- โ
Reproducible - same setup across all environments
Only use `user` scope for truly personal productivity tools unrelated to development (e.g., personal task managers). Development tools, documentation servers, testing frameworks, etc. should all be in project scope.
## Transport Types
MCP servers support three transport mechanisms:
1. **stdio** - Standard input/output (most common, e.g., `npx` commands)
2. **sse** - Server-Sent Events over HTTP
3. **http** - HTTP-based communication
## Commands
### List Servers
```bash
claude mcp list
```
Shows all configured MCP servers with health status:
- โ Connected
- โ Needs authentication
- โ Failed to connect
### Add Server
#### stdio Transport (Default)
```bash
# Basic stdio server
claude mcp add <name> <command> [args...]
# With environment variables
claude mcp add <name> --env KEY1=value1 --env KEY2=value2 -- <command> [args...]
# Specify scope explicitly
claude mcp add --scope user <name> <command> [args...]
claude mcp add --scope local <name> <command> [args...]
claude mcp add --scope project <name> <command> [args...]
```
**Examples:**
```bash
# Playwright MCP server (project scope - DEFAULT)
claude mcp add --scope project playwright npx @playwright/mcp@latest
# Airtable with API key (project scope with env var)
claude mcp add --transport stdio --scope project airtable \
--env AIRTABLE_API_KEY="${AIRTABLE_API_KEY}" -- npx -y airtable-mcp-server
# Context7 with API key (project scope - team uses same docs)
claude mcp add --scope project context7 \
--env UPSTASH_API_KEY="${UPSTASH_API_KEY}" -- npx -y @upstash/context7-mcp
```
**Important:** Use `--` separator before the command when using `--env` or other flags to prevent argument parsing conflicts.
#### SSE Transport
```bash
# Basic SSE server
claude mcp add --transport sse <name> <url>
# With custom headers
claude mcp add --transport sse <name> --header "X-Api-Key: abc123" <url>
# With multiple headers
claude mcp add --transport sse <name> \
--header "Authorization: Bearer token" \
--header "X-Custom: value" \
<url>
```
**Examples:**
```bash
# Asana MCP server
claude mcp add --transport sse asana https://mcp.asana.com/sse
# Atlassian with authentication
claude mcp add --transport sse atlassian \
--header "Authorization: Bearer YOUR_TOKEN" \
https://mcp.atlassian.com/v1/sse
# Custom SSE server with headers
claude mcp add --transport sse --scope project myserver \
--header "X-Api-Key: secret123" \
https://example.com/mcp/sse
```
#### HTTP Transport
```bash
# Basic HTTP server
claude mcp add --transport http <name> <url>
# With custom headers
claude mcp add --transport http <name> --header "X-Api-Key: abc123" <url>
```
**Examples:**
```bash
# Sentry MCP server
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
# Custom HTTP server with authentication
claude mcp add --transport http --scope user analytics \
--header "Authorization: Bearer YOUR_TOKEN" \
https://analytics.example.com/mcp
```
### Add Server from JSON
For complex configurations, you can add servers using JSON:
```bash
claude mcp add-json <name> '<json-config>'
```
**Examples:**
```bash
# stdio server JSON
claude mcp add-json myserver '{
"command": "npx",
"args": ["-y", "@my/mcp-server"],
"env": {
"API_KEY": "secret",
"DEBUG": "true"
}
}'
# SSE server JSON
claude mcp add-json myserver '{
"url": "https://example.com/sse",
"headers": {
"Authorization": "Bearer token",
"X-Custom": "value"
}
}'
# With scope
claude mcp add-json --scope project myserver '{"command": "npx", "args": ["-y", "mcp-server"]}'
```
### Remove Server
```bash
# Remove from any scope (auto-detects)
claude mcp remove <name>
# Remove from specific scope
claude mcp remove --scope user <name>
claude mcp remove --scope local <name>
claude mcp remove --scope project <name>
```
### Get Server Details
```bash
claude mcp get <name>
```
Shows detailed configuration for a specific MCP server.
### Import from Claude Desktop
```bash
# Import all servers from Claude Desktop config
claude mcp add-from-claude-desktop
# Import to specific scope
claude mcp add-from-claude-desktop --scope user
```
**Note:** Only works on Mac and WSL (Windows Subsystem for Linux).
### Reset Project Choices
```bash
claude mcp reset-project-choices
```
Resets all approved and rejected project-scoped (`.mcp.json`) servers within the current project. Useful when you want to re-evaluate which project servers to enable.
### Start MCP Server
```bash
# Start Claude Code MCP server
claude mcp serve
# With debug output
claude mcp serve --debug
# With verbose logging
claude mcp serve --verbose
```
## Scope Selection Guide
**DEFAULT: Always prefer project scope unless there's a specific reason not to.**
### When to use **project** scope (`.mcp.json`) - **PREFERRED**
- **DEFAULT CHOICE**: Most MCP servers should be configured here
- Project-specific integrations and tools
- Servers required by the project team
- Shared configuration committed to version control
- Ensures consistency across team members
- Self-documenting - team can see what tools the project uses
- Makes onboarding easier for new developers
### When to use **local** scope (`~/.config/claude/mcp.json`)
- Machine-specific configurations (paths, local services)
- Servers with machine-specific credentials that shouldn't be shared
- Local development servers running on your machine
- Testing MCP servers before adding to project
### When to use **user** scope (`~/.claude/mcp.json`)
- **ONLY for truly personal tools** that you use across ALL projects
- Personal productivity tools unrelated to any specific project
- Your personal integrations (e.g., your personal task manager)
- **AVOID using for development tools** - these should be in project scope
## Best Practices
### Security
1. **Never commit secrets to `.mcp.json`** - Use environment variables instead:
```bash
claude mcp add --scope project myserver \
--env API_KEY="${MY_API_KEY}" -- npx mcp-server
```
2. **Use headers for authentication** with remote servers:
```bash
claude mcp add --transport sse myserver \
--header "Authorization: Bearer ${TOKEN}" \
https://api.example.com/sse
```
3. **Store sensitive servers in user/local scope** rather than project scope
### Organization
1. **Use meaningful names** - `github-prod` instead of `gh1`
2. **Document project servers** - Add comments to `.mcp.json` explaining what each server does
3. **Keep scopes clean** - Regularly run `claude mcp list` and remove unused servers
### Debugging
1. **Check health first**: `claude mcp list` shows connection status
2. **Test with debug mode**: `claude mcp serve --debug`
3. **Verify configuration**: `claude mcp get <name>`
## Common Patterns
### Development vs Production
```bash
# Development (project scope - DEFAULT for team)
claude mcp add --scope project myapp-dev \
--env API_URL=http://localhost:3000 -- npx myapp-mcp
# Production (project scope - team uses same pRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts โ single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score โฅ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.