Claude MCP and Plugins
MCP (Model Context Protocol)
Open standard (Anthropic, 2024), "USB-C for AI": build a server once, any client uses it.
Claude Code (host) ── client 1 ── Server A
── client 2 ── Server B (one client per server)
A server exposes Tools (callable), Resources (readable), Prompts (templates).
Flow: client fetches tools/list → model picks a tool → client sends tools/call → result added to context.
| Transport | Use |
|---|---|
| HTTP | Remote server (recommended) |
| stdio | Local process |
| SSE | Deprecated; v2.1.265+ tries HTTP first and falls back to SSE |
| WebSocket | Via add-json with "type": "ws" |
Commands
claude mcp add --transport http notion https://mcp.notion.com/mcp
claude mcp add --transport http api https://api.example.com/mcp --header "Authorization: Bearer $TOKEN"
claude mcp add --env KEY=value --transport stdio airtable -- npx -y airtable-mcp-server
claude mcp add-json events '{"type":"ws","url":"wss://example.com/socket"}'
claude mcp list | get <name> | remove <name>
claude mcp login <name> | logout <name> | reset-project-choices
/mcp # status, auth, enable/disable
/mcp reconnect all # retry failed servers
Options go before --; the server command goes after.
Tool search is on by default: tool definitions load on demand via ToolSearch instead of all upfront (ENABLE_TOOL_SEARCH=false disables).
Scopes & Config
| Scope | Loads in | Stored in |
|---|---|---|
local (default) | This project, private | ~/.claude.json (under the project path) |
project | This project, shared via git | .mcp.json (needs approval) |
user | All projects | ~/.claude.json |
Precedence: local > project > user > plugin > claude.ai connectors.
{
"mcpServers": {
"api-server": {
"type": "http",
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
"headers": { "Authorization": "Bearer ${API_KEY}" }
},
"weather": { "type": "stdio", "command": "npx", "args": ["-y", "my-mcp-server"], "env": {} }
}
}
${VAR} and ${VAR:-default} expansion supported. Permission rules and approval keys: see Claude Permissions and Claude Settings.
Best Practices
- Fewer servers: every tool description costs context.
--scope userfor universal,.mcp.jsonfor project.- Trust only what you install (they run code, read files, call APIs).
- Pin versions:
npx -y package@1.2.3. - Remove unused servers.
Directory: registry.modelcontextprotocol.io. Reference servers: fetch, filesystem, git, memory, time.
Playwright MCP
claude mcp add playwright npx '@playwright/mcp@latest'
Prompt: "Use playwright mcp to open a browser to example.com" or "write an e2e test for login → create task → logout".
Plugins
Bundle skills, agents, hooks, MCP servers, commands, LSP servers, output styles for sharing.
my-plugin/
├── .claude-plugin/plugin.json # required manifest
├── commands/ agents/ skills/<name>/SKILL.md
├── hooks/hooks.json
├── .mcp.json .lsp.json settings.json bin/ workflows/ monitors/ themes/ output-styles/
└── scripts/ README.md
The manifest is optional; if present only name (kebab-case) is required. Other fields: displayName, version (pins updates), description, author, homepage, repository, license, keywords, defaultEnabled, dependencies, userConfig (prompted values, sensitive option), channels, settings (only agent, subagentStatusLine), and component paths (./-relative, must exist inside the plugin): skills, commands, agents, hooks, mcpServers, lspServers, outputStyles, workflows, experimental.themes|monitors. Extra default dirs: bin/ (on PATH), monitors/, themes/, workflows/, settings.json. claude plugin validate ./my-plugin checks it. A plugin-root CLAUDE.md is not loaded.
Use ${CLAUDE_PLUGIN_ROOT} (changes on update) for bundled files and ${CLAUDE_PLUGIN_DATA} for persistent data. Names starting claude-/anthropic- are reserved.
Marketplaces & Install
- Official marketplace
claude-plugins-officialis added automatically on first interactive start. /plugintabs: Discover, Installed, Marketplaces, Errors./plugin install name@marketplaceopens details and a scope choice.- Scopes: user (
~/.claude/settings.json), project (.claude/settings.json, teammates still runclaude plugin install … --scope project), local (.claude/settings.local.json). Local > project > user. - Add a marketplace:
/plugin marketplace add owner/repo(or git URL, path, hostedmarketplace.json;#refpins); one step:/plugin install name --marketplace owner/repo. Alsoclaude plugin install|enable|disable|uninstall|update|marketplace …from the shell. /reload-pluginsapplies changes;claude plugin details <name>shows token cost;--plugin-dirloads a local plugin for one session.- Auto-update is on for official marketplaces, off for third-party. Cloud sessions don't load locally installed plugins. Admin controls in Claude Settings.
LSP
Protocol between editors and language servers (Microsoft). Replaces M×N editor/language integrations with M+N. Servers handle parsing, AST, symbols, types, diagnostics, completion, go-to-definition.
Claude Code uses it via the LSP tool. Add a language in a plugin:
command and extensionToLanguage are required; optional args, env, initializationOptions, startupTimeout, requestTimeout (60s default), restartOnCrash, maxRestarts, diagnostics.
{ "go": { "command": "gopls", "args": ["serve"], "extensionToLanguage": { ".go": "go" } } }
Related: Claude Skills, Claude Subagents and Teams, Claude Settings