Module 1.5
MCP Servers
What MCP Is
Model Context Protocol is an open standard created by Anthropic that lets Claude connect to external tools, data sources, and APIs. Think of it as a universal plugin system for AI.
Without MCP, Claude only works with what's in its context window. With MCP, it can talk to GitHub, query your database, search Slack, control a browser, call your internal APIs, and hundreds more.
The mental model: MCP servers expose tools Claude can call, just like its built-in tools (Read, Write, Bash). The difference is these tools come from the outside world.
What You Can Do With MCP
"Add the feature from JIRA issue ENG-4521 and create a PR on GitHub."
"Check Sentry for errors introduced by the last deployment."
"Find users who used this feature in our PostgreSQL database."
"Update the email template based on the new Figma designs in Slack."
"Create Gmail drafts inviting those users to a feedback session."
All in one session, driven by natural language.
Three Server Types
| Type | How it runs | Use when |
|---|---|---|
| HTTP | Remote server | Cloud services - recommended |
| SSE | Remote server, older | Legacy - use HTTP instead |
| stdio | Local process | Local tools, custom scripts |
Installing MCP Servers
HTTP (cloud services):
claude mcp add --transport http <name> <url>
# Examples
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
# With auth header
claude mcp add --transport http my-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"stdio (local tools):
claude mcp add --transport stdio <name> -- <command> [args...]
# Example: PostgreSQL database
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \
--dsn "postgresql://user:pass@localhost:5432/mydb"
# Example: with env vars
claude mcp add --transport stdio airtable \
--env AIRTABLE_API_KEY=your-key \
-- npx -y airtable-mcp-serverWindows: Wrap npx with
cmd /c:-- cmd /c npx -y @some/package
The Three Scopes
| Scope | Stored in | Visible to |
|---|---|---|
local (default) | ~/.claude.json | Just you, current project |
project | .mcp.json in project root | Your whole team (commit this file) |
user | ~/.claude.json | Just you, all projects |
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ --scope project
claude mcp add --transport http notion https://mcp.notion.com/mcp --scope userWhen same server name exists at multiple scopes: local > project > user.
Managing Servers
claude mcp list # list all servers
claude mcp get github # details on a specific server
claude mcp remove github # remove a server
/mcp # check status inside Claude CodeAuthentication
# 1. Add the server
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
# 2. Inside Claude Code:
/mcp
# Select server → Authenticate → follow browser OAuth flow
# Tokens stored securely and auto-refreshedPopular MCP Servers
| Server | What it adds |
|---|---|
| GitHub | Issues, PRs, repos, code review |
| Sentry | Error tracking, stack traces |
| Notion | Read/write pages and databases |
| Slack | Read/send messages |
| PostgreSQL | Query your database |
| Filesystem | Extended file system access |
| Airtable | Read/write Airtable bases |
Find hundreds more: github.com/modelcontextprotocol/servers
MCP Resources - The @ Mention System
MCP servers expose resources you can reference with @ like files:
> Analyze @github:issue://456 and suggest a fix
> Compare @postgres:schema://users with @docs:file://database/user-model
Type @ in Claude Code to see all available resources in autocomplete.
MCP Prompts as Slash Commands
Servers can expose prompts as / commands:
/mcp__github__list_prs
/mcp__github__pr_review 456
/mcp__jira__create_issue "Bug in login flow" high
Format: /mcp__<servername>__<promptname> [arguments]
Using Claude Code as an MCP Server
Run Claude Code itself as an MCP server to expose its tools to other apps:
claude mcp serveAdd to Claude Desktop config:
{
"mcpServers": {
"claude-code": {
"type": "stdio",
"command": "claude",
"args": ["mcp", "serve"]
}
}
}Tool Search
When you have many servers, their tool definitions consume context. Tool Search loads tools on-demand instead:
ENABLE_TOOL_SEARCH=auto # default - activates at 10% of context
ENABLE_TOOL_SEARCH=auto:5 # activate at 5% threshold
ENABLE_TOOL_SEARCH=true # always on
ENABLE_TOOL_SEARCH=false # always offEnvironment Variables in .mcp.json
Share configs with your team without exposing credentials:
{
"mcpServers": {
"api-server": {
"type": "http",
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
"headers": {
"Authorization": "Bearer ${API_KEY}"
}
}
}
}${VAR} - required | ${VAR:-default} - with fallback
Security Notes
- Only install MCP servers you trust - they run with your permissions
- stdio servers can access your file system
- Servers fetching untrusted web content carry prompt injection risk
- For teams:
managed-mcp.jsonlets admins lock down which servers employees can use
Sources
- Claude Code MCP Documentation (official docs)
- Model Context Protocol (open standard)