@amsterdamdatalabs/enact-extensions 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -21
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +171 -1
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +402 -49
- package/dist/install.js.map +1 -1
- package/dist/internal/codex.d.ts.map +1 -1
- package/dist/internal/codex.js +7 -1
- package/dist/internal/codex.js.map +1 -1
- package/dist/internal/platform.d.ts +8 -0
- package/dist/internal/platform.d.ts.map +1 -1
- package/dist/internal/platform.js +46 -2
- package/dist/internal/platform.js.map +1 -1
- package/dist/provision.d.ts +30 -0
- package/dist/provision.d.ts.map +1 -0
- package/dist/provision.js +202 -0
- package/dist/provision.js.map +1 -0
- package/dist/validate/index.d.ts +44 -0
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +157 -0
- package/dist/validate/index.js.map +1 -1
- package/extensions/cmux/.agents/plugin.json +37 -0
- package/extensions/cmux/skills/cmux/SKILL.md +82 -0
- package/extensions/cmux/skills/cmux/agents/openai.yaml +4 -0
- package/extensions/cmux/skills/cmux/references/handles-and-identify.md +35 -0
- package/extensions/cmux/skills/cmux/references/panes-surfaces.md +37 -0
- package/extensions/cmux/skills/cmux/references/trigger-flash-and-health.md +23 -0
- package/extensions/cmux/skills/cmux/references/windows-workspaces.md +31 -0
- package/extensions/cmux/skills/cmux-vm-monitor/SKILL.md +122 -0
- package/extensions/cmux/skills/cmux-vm-monitor/agents/openai.yaml +4 -0
- package/extensions/cmux/skills/cmux-vm-monitor/references/cmux-commands.md +66 -0
- package/extensions/cmux/skills/cmux-vm-monitor/scripts/codex_vm_monitor.sh +45 -0
- package/extensions/cmux/skills/cmux-workspace/SKILL.md +93 -0
- package/extensions/dev-state/.agents/plugin.json +35 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/SKILL.md +194 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/agents/openai.yaml +4 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/references/reference.md +130 -0
- package/extensions/devops/.agents/plugin.json +36 -0
- package/extensions/devops/skills/azure-devops-cli/SKILL.md +431 -0
- package/extensions/devops/skills/azure-devops-cli/agents/openai.yaml +4 -0
- package/extensions/devops/skills/ci-pipeline-strategy/SKILL.md +217 -0
- package/extensions/devops/skills/ci-pipeline-strategy/agents/openai.yaml +4 -0
- package/extensions/enact-context/.agents/plugin.json +40 -0
- package/extensions/enact-context/.mcp.json +8 -0
- package/extensions/enact-context/README.md +25 -0
- package/extensions/enact-context/assets/icon.png +0 -0
- package/extensions/enact-context/assets/logo.png +0 -0
- package/extensions/enact-context/hooks/hooks.json +115 -0
- package/extensions/enact-context/skills/enact-context/SKILL.md +149 -0
- package/extensions/enact-context/skills/enact-context/scripts/install.sh +69 -0
- package/extensions/enact-factory/.agents/plugin.json +42 -0
- package/extensions/enact-factory/.mcp.json +8 -0
- package/extensions/enact-factory/assets/icon.png +0 -0
- package/extensions/enact-factory/assets/logo.png +0 -0
- package/extensions/enact-factory/hooks/user-prompt-submit.mjs +67 -0
- package/extensions/enact-factory/skills/testing-strategy/SKILL.md +167 -0
- package/extensions/enact-factory/skills/workitem-triage/SKILL.md +22 -0
- package/extensions/enact-operator/.agents/plugin.json +57 -0
- package/extensions/enact-operator/.app.json +3 -0
- package/extensions/enact-operator/.mcp.json +10 -0
- package/extensions/enact-operator/_taxonomy.md +86 -0
- package/extensions/enact-operator/agents/README.md +5 -0
- package/extensions/enact-operator/agents/architect.toml +25 -0
- package/extensions/enact-operator/agents/code-reviewer.toml +24 -0
- package/extensions/enact-operator/agents/critic.toml +30 -0
- package/extensions/enact-operator/agents/executor.toml +24 -0
- package/extensions/enact-operator/agents/explore.toml +23 -0
- package/extensions/enact-operator/agents/planner.toml +24 -0
- package/extensions/enact-operator/agents/verifier.toml +24 -0
- package/extensions/enact-operator/assets/icon.png +0 -0
- package/extensions/enact-operator/assets/logo.png +0 -0
- package/extensions/enact-operator/commands/doctor.md +39 -0
- package/extensions/enact-operator/commands/setup.md +51 -0
- package/extensions/enact-operator/hooks/hooks.json +146 -0
- package/extensions/enact-operator/skills/_variants.md +44 -0
- package/extensions/enact-operator/skills/ai-slop-cleaner/SKILL.md +50 -0
- package/extensions/enact-operator/skills/analyze/SKILL.md +91 -0
- package/extensions/enact-operator/skills/ask/SKILL.md +47 -0
- package/extensions/enact-operator/skills/autopilot/SKILL.md +170 -0
- package/extensions/enact-operator/skills/autoresearch-goal/SKILL.md +79 -0
- package/extensions/enact-operator/skills/cancel/SKILL.md +99 -0
- package/extensions/enact-operator/skills/configure-notifications/SKILL.md +77 -0
- package/extensions/enact-operator/skills/deep-interview/SKILL.md +80 -0
- package/extensions/enact-operator/skills/doctor/SKILL.md +48 -0
- package/extensions/enact-operator/skills/hud/SKILL.md +49 -0
- package/extensions/enact-operator/skills/hyperplan/SKILL.md +47 -0
- package/extensions/enact-operator/skills/plan/SKILL.md +78 -0
- package/extensions/enact-operator/skills/ralph/SKILL.md +201 -0
- package/extensions/enact-operator/skills/ralph/gemini.md +18 -0
- package/extensions/enact-operator/skills/ralplan/SKILL.md +151 -0
- package/extensions/enact-operator/skills/remove-deadcode/SKILL.md +45 -0
- package/extensions/enact-operator/skills/research/SKILL.md +74 -0
- package/extensions/enact-operator/skills/review/SKILL.md +58 -0
- package/extensions/enact-operator/skills/security-research/SKILL.md +54 -0
- package/extensions/enact-operator/skills/setup/SKILL.md +91 -0
- package/extensions/enact-operator/skills/setup/scripts/install.sh +50 -0
- package/extensions/enact-operator/skills/skill/SKILL.md +82 -0
- package/extensions/enact-operator/skills/tdd/SKILL.md +59 -0
- package/extensions/enact-operator/skills/team/SKILL.md +199 -0
- package/extensions/enact-operator/skills/trace/SKILL.md +41 -0
- package/extensions/enact-operator/skills/ultragoal/SKILL.md +99 -0
- package/extensions/enact-operator/skills/ultraqa/SKILL.md +113 -0
- package/extensions/enact-operator/skills/ultrawork/SKILL.md +145 -0
- package/extensions/enact-operator/skills/ultrawork/planner.md +28 -0
- package/extensions/enact-operator/skills/wiki/SKILL.md +41 -0
- package/extensions/enact-operator/skills/work-with-workitem/SKILL.md +51 -0
- package/extensions/enact-wiki/.agents/plugin.json +42 -0
- package/extensions/enact-wiki/.mcp.json +15 -0
- package/extensions/enact-wiki/README.md +44 -0
- package/extensions/enact-wiki/assets/icon.png +0 -0
- package/extensions/enact-wiki/assets/logo.png +0 -0
- package/extensions/enact-wiki/skills/document-parser/SKILL.md +17 -0
- package/extensions/enact-wiki/skills/document-parser/scripts/parse.sh +60 -0
- package/extensions/enact-wiki/skills/document-parser/skill.json +9 -0
- package/extensions/enact-wiki/skills/enact-wiki/SKILL.md +30 -0
- package/extensions/enact-wiki/skills/enact-wiki/references/ingest.md +62 -0
- package/extensions/enact-wiki/skills/enact-wiki/references/manage.md +34 -0
- package/extensions/enact-wiki/skills/enact-wiki/references/query.md +59 -0
- package/extensions/enact-wiki/skills/search-lab/SKILL.md +57 -0
- package/extensions/enact-wiki/skills/search-lab/scripts/analyze.ts +23 -0
- package/{plugins/net-revenue-management/.codex-plugin → extensions/net-revenue-management/.agents}/plugin.json +10 -6
- package/extensions/plugin-dev/.agents/plugin.json +42 -0
- package/extensions/plugin-dev/.mcp.json +3 -0
- package/extensions/plugin-dev/agents/agent-creator.md +199 -0
- package/extensions/plugin-dev/agents/plugin-validator.md +91 -0
- package/extensions/plugin-dev/agents/skill-reviewer.md +212 -0
- package/extensions/plugin-dev/commands/_archive/create-marketplace.md +427 -0
- package/extensions/plugin-dev/commands/_archive/plugin-dev-guide.md +12 -0
- package/extensions/plugin-dev/commands/create-plugin.md +498 -0
- package/extensions/plugin-dev/commands/start.md +81 -0
- package/extensions/plugin-dev/hooks/hooks.json +3 -0
- package/extensions/plugin-dev/skills/agent-development/SKILL.md +641 -0
- package/extensions/plugin-dev/skills/agent-development/examples/agent-creation-prompt.md +250 -0
- package/extensions/plugin-dev/skills/agent-development/examples/complete-agent-examples.md +461 -0
- package/extensions/plugin-dev/skills/agent-development/references/advanced-agent-fields.md +246 -0
- package/extensions/plugin-dev/skills/agent-development/references/agent-creation-system-prompt.md +216 -0
- package/extensions/plugin-dev/skills/agent-development/references/permission-modes-rules.md +226 -0
- package/extensions/plugin-dev/skills/agent-development/references/system-prompt-design.md +464 -0
- package/extensions/plugin-dev/skills/agent-development/references/triggering-examples.md +474 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/create-agent-skeleton.sh +176 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/test-agent-trigger.sh +227 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/validate-agent.sh +227 -0
- package/extensions/plugin-dev/skills/command-development/SKILL.md +763 -0
- package/extensions/plugin-dev/skills/command-development/examples/plugin-commands.md +612 -0
- package/extensions/plugin-dev/skills/command-development/examples/simple-commands.md +527 -0
- package/extensions/plugin-dev/skills/command-development/references/advanced-workflows.md +762 -0
- package/extensions/plugin-dev/skills/command-development/references/documentation-patterns.md +769 -0
- package/extensions/plugin-dev/skills/command-development/references/frontmatter-reference.md +508 -0
- package/extensions/plugin-dev/skills/command-development/references/interactive-commands.md +966 -0
- package/extensions/plugin-dev/skills/command-development/references/marketplace-considerations.md +943 -0
- package/extensions/plugin-dev/skills/command-development/references/plugin-features-reference.md +637 -0
- package/extensions/plugin-dev/skills/command-development/references/plugin-integration.md +191 -0
- package/extensions/plugin-dev/skills/command-development/references/skill-tool.md +447 -0
- package/extensions/plugin-dev/skills/command-development/references/testing-strategies.md +723 -0
- package/extensions/plugin-dev/skills/command-development/scripts/check-frontmatter.sh +234 -0
- package/extensions/plugin-dev/skills/command-development/scripts/validate-command.sh +160 -0
- package/extensions/plugin-dev/skills/hook-development/SKILL.md +861 -0
- package/extensions/plugin-dev/skills/hook-development/examples/load-context.sh +55 -0
- package/extensions/plugin-dev/skills/hook-development/examples/validate-bash.sh +57 -0
- package/extensions/plugin-dev/skills/hook-development/examples/validate-write.sh +48 -0
- package/extensions/plugin-dev/skills/hook-development/references/advanced.md +871 -0
- package/extensions/plugin-dev/skills/hook-development/references/hook-input-schemas.md +145 -0
- package/extensions/plugin-dev/skills/hook-development/references/migration.md +392 -0
- package/extensions/plugin-dev/skills/hook-development/references/patterns.md +430 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/README.md +181 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/hook-linter.sh +153 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/test-hook.sh +276 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
- package/extensions/plugin-dev/skills/mcp-integration/SKILL.md +775 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/http-server.json +20 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/sse-server.json +19 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/stdio-server.json +38 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/ws-server.json +26 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/authentication.md +601 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/server-discovery.md +190 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/server-types.md +572 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/tool-usage.md +623 -0
- package/extensions/plugin-dev/skills/plugin-dev-guide/SKILL.md +222 -0
- package/extensions/plugin-dev/skills/plugin-structure/SKILL.md +705 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md +774 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/minimal-plugin.md +83 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/standard-plugin.md +611 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/advanced-topics.md +289 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/component-patterns.md +592 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/github-actions.md +233 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/headless-ci-mode.md +193 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/manifest-reference.md +625 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/output-styles.md +116 -0
- package/extensions/plugin-dev/skills/skill-development/SKILL.md +564 -0
- package/extensions/plugin-dev/skills/skill-development/examples/complete-skill.md +465 -0
- package/extensions/plugin-dev/skills/skill-development/examples/frontmatter-templates.md +167 -0
- package/extensions/plugin-dev/skills/skill-development/examples/minimal-skill.md +111 -0
- package/extensions/plugin-dev/skills/skill-development/references/advanced-frontmatter.md +225 -0
- package/extensions/plugin-dev/skills/skill-development/references/commands-vs-skills.md +39 -0
- package/extensions/plugin-dev/skills/skill-development/references/skill-creation-workflow.md +379 -0
- package/extensions/plugin-dev/skills/skill-development/references/skill-creator-original.md +210 -0
- package/package.json +8 -11
- package/scripts/enact-extensions.mjs +823 -21
- package/scripts/hooks/session-start-drift-check.mjs +58 -0
- package/scripts/lib/build-index.mjs +50 -0
- package/scripts/lib/bundle-hash.mjs +137 -0
- package/scripts/lib/hooks.mjs +741 -0
- package/scripts/lib/ledger.mjs +163 -0
- package/scripts/lib/list-bundles.mjs +70 -0
- package/scripts/lib/outdated.mjs +144 -0
- package/scripts/lib/provision-mcp.mjs +16 -0
- package/scripts/lib/resolve-bundle.mjs +121 -0
- package/scripts/lib/run-install.mjs +402 -38
- package/scripts/lib/run-prune.mjs +73 -0
- package/scripts/lib/run-sync.mjs +9 -1
- package/scripts/lib/run-uninstall.mjs +244 -0
- package/scripts/lib/run-update.mjs +152 -0
- package/scripts/lib/run-validate.mjs +21 -18
- package/scripts/lib/serve.mjs +472 -0
- package/scripts/postinstall.mjs +63 -0
- package/scripts/setup-enact-context.sh +2 -2
- package/scripts/version-bump.sh +463 -0
- package/spec/codex.json +1 -11
- package/spec/index.json +59 -0
- package/web/assets/README.md +111 -0
- package/web/assets/logo-full.png +0 -0
- package/web/assets/logo-slim.png +0 -0
- package/web/assets/tokens/base.css +45 -0
- package/web/assets/tokens/colors.css +248 -0
- package/web/assets/tokens/effects.css +24 -0
- package/web/assets/tokens/fonts.css +8 -0
- package/web/assets/tokens/index.css +18 -0
- package/web/assets/tokens/spacing.css +50 -0
- package/web/index.html +1188 -0
- package/.agents/plugins/marketplace.json +0 -20
- package/catalog/enact-context.json +0 -9
- package/catalog/enact-factory.json +0 -7
- package/catalog/enact-operator.json +0 -7
- package/catalog/enact-wiki.json +0 -7
- package/catalog/net-revenue-management.json +0 -8
- package/scripts/rename-supervisor-to-operator.pl +0 -66
- package/scripts/sync-manifests.mjs +0 -23
- package/scripts/validate-catalog.mjs +0 -37
- package/scripts/validate-plugin.mjs +0 -10
- /package/{plugins → extensions}/net-revenue-management/.mcp.json +0 -0
- /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-risks/SKILL.md +0 -0
- /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-scenario/SKILL.md +0 -0
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcp-integration
|
|
3
|
+
description: This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", discusses MCP server types (SSE, stdio, HTTP, WebSocket), or asks to "find MCP server", "discover MCP servers", "what MCP servers exist", "recommend MCP server for [service]", "MCP prompts", "MCP prompts as commands", "tool search", "tool search threshold", "claude mcp serve", "allowedMcpServers", "deniedMcpServers", "managed MCP". Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MCP Integration for Claude Code Plugins
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Model Context Protocol (MCP) enables Claude Code plugins to integrate with external services and APIs by providing structured tool access. Use MCP integration to expose external service capabilities as tools within Claude Code.
|
|
11
|
+
|
|
12
|
+
**Key capabilities:**
|
|
13
|
+
|
|
14
|
+
- Connect to external services (databases, APIs, file systems)
|
|
15
|
+
- Provide 10+ related tools from a single service
|
|
16
|
+
- Handle OAuth and complex authentication flows
|
|
17
|
+
- Bundle MCP servers with plugins for automatic setup
|
|
18
|
+
|
|
19
|
+
## MCP Server Configuration Methods
|
|
20
|
+
|
|
21
|
+
Plugins can bundle MCP servers in two ways:
|
|
22
|
+
|
|
23
|
+
### Method 1: Dedicated .mcp.json (Recommended)
|
|
24
|
+
|
|
25
|
+
Create `.mcp.json` at plugin root:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"database-tools": {
|
|
30
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server",
|
|
31
|
+
"args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"],
|
|
32
|
+
"env": {
|
|
33
|
+
"DB_URL": "${DB_URL}"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Benefits:**
|
|
40
|
+
|
|
41
|
+
- Clear separation of concerns
|
|
42
|
+
- Easier to maintain
|
|
43
|
+
- Better for multiple servers
|
|
44
|
+
|
|
45
|
+
### Method 2: Inline in plugin.json
|
|
46
|
+
|
|
47
|
+
Add `mcpServers` field to plugin.json:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"name": "my-plugin",
|
|
52
|
+
"version": "1.0.0",
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"plugin-api": {
|
|
55
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/servers/api-server",
|
|
56
|
+
"args": ["--port", "8080"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Benefits:**
|
|
63
|
+
|
|
64
|
+
- Single configuration file
|
|
65
|
+
- Good for simple single-server plugins
|
|
66
|
+
|
|
67
|
+
### MCP Scope System
|
|
68
|
+
|
|
69
|
+
MCP server configurations follow scope precedence: Local > Project > User.
|
|
70
|
+
|
|
71
|
+
| Scope | Storage | Sharing | Best For |
|
|
72
|
+
| ------- | ------------------------------ | -------------------- | ---------------------------------- |
|
|
73
|
+
| Local | `~/.claude.json` (project path) | Private, current project | Experimental, sensitive credentials |
|
|
74
|
+
| Project | `.mcp.json` in project root | Via version control | Team-shared, project-specific |
|
|
75
|
+
| User | `~/.claude.json` (global) | All projects | Personal utilities, cross-project |
|
|
76
|
+
|
|
77
|
+
Plugin-bundled MCP servers (via `.mcp.json` or inline in `plugin.json`) auto-start when the plugin is enabled. They interact with user/project MCP configs — if a user has a server with the same name, scope precedence determines which loads.
|
|
78
|
+
|
|
79
|
+
## Discovering MCP Servers
|
|
80
|
+
|
|
81
|
+
Find existing MCP servers for your plugin using PulseMCP, the comprehensive MCP server directory with 6,800+ servers.
|
|
82
|
+
|
|
83
|
+
**Discovery workflow:**
|
|
84
|
+
|
|
85
|
+
1. Search PulseMCP using Tavily extract on `https://www.pulsemcp.com/servers?q=[keyword]`
|
|
86
|
+
2. Evaluate results by classification (official vs community), popularity, and relevance
|
|
87
|
+
3. Fetch detail pages for GitHub links and configuration examples
|
|
88
|
+
4. Generate `.mcp.json` configuration based on server type
|
|
89
|
+
|
|
90
|
+
**See `references/server-discovery.md`** for detailed search instructions, URL patterns, and curated server recommendations by category.
|
|
91
|
+
|
|
92
|
+
## MCP Server Types
|
|
93
|
+
|
|
94
|
+
### stdio (Local Process)
|
|
95
|
+
|
|
96
|
+
Execute local MCP servers as child processes. Best for local tools and custom servers.
|
|
97
|
+
|
|
98
|
+
**Configuration:**
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"filesystem": {
|
|
103
|
+
"command": "npx",
|
|
104
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/allowed/path"],
|
|
105
|
+
"env": {
|
|
106
|
+
"LOG_LEVEL": "debug"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Use cases:**
|
|
113
|
+
|
|
114
|
+
- File system access
|
|
115
|
+
- Local database connections
|
|
116
|
+
- Custom MCP servers
|
|
117
|
+
- NPM-packaged MCP servers
|
|
118
|
+
|
|
119
|
+
**Process management:**
|
|
120
|
+
|
|
121
|
+
- Claude Code spawns and manages the process
|
|
122
|
+
- Communicates via stdin/stdout
|
|
123
|
+
- Terminates when Claude Code exits
|
|
124
|
+
|
|
125
|
+
### SSE (Server-Sent Events)
|
|
126
|
+
|
|
127
|
+
Connect to hosted MCP servers with OAuth support. Best for cloud services.
|
|
128
|
+
|
|
129
|
+
**Configuration:**
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"asana": {
|
|
134
|
+
"type": "sse",
|
|
135
|
+
"url": "https://mcp.asana.com/sse"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Use cases:**
|
|
141
|
+
|
|
142
|
+
- Official hosted MCP servers (Asana, GitHub, etc.)
|
|
143
|
+
- Cloud services with MCP endpoints
|
|
144
|
+
- OAuth-based authentication
|
|
145
|
+
- No local installation needed
|
|
146
|
+
|
|
147
|
+
**Authentication:**
|
|
148
|
+
|
|
149
|
+
- OAuth flows handled automatically
|
|
150
|
+
- User prompted on first use
|
|
151
|
+
- Tokens managed by Claude Code
|
|
152
|
+
|
|
153
|
+
### HTTP (REST API)
|
|
154
|
+
|
|
155
|
+
Connect to RESTful MCP servers with token authentication.
|
|
156
|
+
|
|
157
|
+
**Configuration:**
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"api-service": {
|
|
162
|
+
"type": "http",
|
|
163
|
+
"url": "https://api.example.com/mcp",
|
|
164
|
+
"headers": {
|
|
165
|
+
"Authorization": "Bearer ${API_TOKEN}",
|
|
166
|
+
"X-Custom-Header": "value"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Use cases:**
|
|
173
|
+
|
|
174
|
+
- REST API-based MCP servers
|
|
175
|
+
- Token-based authentication
|
|
176
|
+
- Custom API backends
|
|
177
|
+
- Stateless interactions
|
|
178
|
+
|
|
179
|
+
### WebSocket (Real-time)
|
|
180
|
+
|
|
181
|
+
Connect to WebSocket MCP servers for real-time bidirectional communication.
|
|
182
|
+
|
|
183
|
+
**Configuration:**
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"realtime-service": {
|
|
188
|
+
"type": "ws",
|
|
189
|
+
"url": "wss://mcp.example.com/ws",
|
|
190
|
+
"headers": {
|
|
191
|
+
"Authorization": "Bearer ${TOKEN}"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Use cases:**
|
|
198
|
+
|
|
199
|
+
- Real-time data streaming
|
|
200
|
+
- Persistent connections
|
|
201
|
+
- Push notifications from server
|
|
202
|
+
- Low-latency requirements
|
|
203
|
+
|
|
204
|
+
## Environment Variable Expansion
|
|
205
|
+
|
|
206
|
+
All MCP configurations support environment variable substitution:
|
|
207
|
+
|
|
208
|
+
**${CLAUDE_PLUGIN_ROOT}** - Plugin directory (always use for portability):
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/servers/my-server"
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**User environment variables** - From user's shell:
|
|
217
|
+
|
|
218
|
+
```json
|
|
219
|
+
{
|
|
220
|
+
"env": {
|
|
221
|
+
"API_KEY": "${MY_API_KEY}",
|
|
222
|
+
"DATABASE_URL": "${DB_URL}"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Env vars support fallback values: `${VAR:-default_value}`. If `VAR` is unset, `default_value` is used. Supported in `command`, `args`, `env`, `url`, and `headers` fields.
|
|
228
|
+
|
|
229
|
+
**Best practice:** Document all required environment variables in plugin README.
|
|
230
|
+
|
|
231
|
+
## MCP Tool Naming
|
|
232
|
+
|
|
233
|
+
When MCP servers provide tools, they're automatically prefixed:
|
|
234
|
+
|
|
235
|
+
**Format:** `mcp__plugin_<plugin-name>_<server-name>__<tool-name>`
|
|
236
|
+
|
|
237
|
+
**Example:**
|
|
238
|
+
|
|
239
|
+
- Plugin: `asana`
|
|
240
|
+
- Server: `asana`
|
|
241
|
+
- Tool: `create_task`
|
|
242
|
+
- **Full name:** `mcp__plugin_asana_asana__asana_create_task`
|
|
243
|
+
|
|
244
|
+
## MCP Resources
|
|
245
|
+
|
|
246
|
+
MCP servers can expose resources that Claude can access using the `@` syntax:
|
|
247
|
+
|
|
248
|
+
### Resource Syntax
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
@server-name:protocol://path
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Examples:**
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
@filesystem:file:///Users/me/project/README.md
|
|
258
|
+
@database:postgres://localhost/mydb/users
|
|
259
|
+
@github:https://github.com/user/repo
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Using Resources in Prompts
|
|
263
|
+
|
|
264
|
+
Reference resources directly in your prompts:
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
Look at @filesystem:file:///path/to/config.json and suggest improvements
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Claude will fetch the resource content and include it in context.
|
|
271
|
+
|
|
272
|
+
### Resource Types
|
|
273
|
+
|
|
274
|
+
- **file://** - Local file system paths
|
|
275
|
+
- **https://** - HTTP resources
|
|
276
|
+
- **Custom protocols** - Server-specific (postgres://, s3://, etc.)
|
|
277
|
+
|
|
278
|
+
## MCP Prompts as Commands
|
|
279
|
+
|
|
280
|
+
MCP servers can expose **prompts** that appear as slash commands in Claude Code:
|
|
281
|
+
|
|
282
|
+
**Format:** `/mcp__servername__promptname`
|
|
283
|
+
|
|
284
|
+
**Example:**
|
|
285
|
+
|
|
286
|
+
- Server `github` exposes prompt `create-pr`
|
|
287
|
+
- Available as: `/mcp__github__create-pr`
|
|
288
|
+
|
|
289
|
+
MCP prompts appear alongside regular commands in the `/` menu. They accept arguments and execute the server's prompt template with Claude. This enables MCP servers to provide guided workflows beyond simple tool calls.
|
|
290
|
+
|
|
291
|
+
**Plugin design note:** If your MCP server exposes prompts, document their names and expected arguments in your plugin README so users can discover them.
|
|
292
|
+
|
|
293
|
+
**Plugin-provided MCP prompts:** If your plugin bundles an MCP server, that server can expose prompts that automatically become slash commands for users. This provides guided workflows beyond simple tool calls — for example, a `/mcp__myserver__setup-project` prompt that walks users through project configuration.
|
|
294
|
+
|
|
295
|
+
## Tool Search
|
|
296
|
+
|
|
297
|
+
For MCP servers with many tools, use Tool Search to find relevant tools:
|
|
298
|
+
|
|
299
|
+
**When to use:**
|
|
300
|
+
|
|
301
|
+
- Server provides 10+ tools
|
|
302
|
+
- You don't know exact tool names
|
|
303
|
+
- Exploring server capabilities
|
|
304
|
+
|
|
305
|
+
**How it works:**
|
|
306
|
+
|
|
307
|
+
1. Claude Code indexes MCP tool names and descriptions
|
|
308
|
+
2. Search by natural language or partial names
|
|
309
|
+
3. Get filtered list of matching tools
|
|
310
|
+
|
|
311
|
+
### Auto-Enable Behavior
|
|
312
|
+
|
|
313
|
+
Tool Search activates automatically when MCP servers collectively provide more tools than fit efficiently in Claude's context window (default threshold: 10% of context). Instead of loading all tool descriptions upfront, Claude searches for relevant tools on-demand.
|
|
314
|
+
|
|
315
|
+
**Plugin design implications:**
|
|
316
|
+
|
|
317
|
+
- **Many-tool servers**: Tools may not be immediately visible; use descriptive tool names and descriptions
|
|
318
|
+
- **Documentation**: Note tool search behavior in README if your server provides 20+ tools
|
|
319
|
+
- **Environment control**: `ENABLE_TOOL_SEARCH=auto:5` (custom 5% threshold) or `ENABLE_TOOL_SEARCH=false` (disable)
|
|
320
|
+
|
|
321
|
+
This feature is automatic - just ask Claude about available tools or describe what you want to do.
|
|
322
|
+
|
|
323
|
+
### Using MCP Tools in Commands
|
|
324
|
+
|
|
325
|
+
Pre-allow specific MCP tools in command frontmatter:
|
|
326
|
+
|
|
327
|
+
```markdown
|
|
328
|
+
---
|
|
329
|
+
allowed-tools: mcp__plugin_asana_asana__asana_create_task, mcp__plugin_asana_asana__asana_search_tasks
|
|
330
|
+
---
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**Wildcard (use sparingly):**
|
|
334
|
+
|
|
335
|
+
```markdown
|
|
336
|
+
---
|
|
337
|
+
allowed-tools: mcp__plugin_asana_asana__*
|
|
338
|
+
---
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Best practice:** Pre-allow specific tools, not wildcards, for security.
|
|
342
|
+
|
|
343
|
+
## Lifecycle Management
|
|
344
|
+
|
|
345
|
+
**Automatic startup:**
|
|
346
|
+
|
|
347
|
+
- MCP servers start when plugin enables
|
|
348
|
+
- Connection established before first tool use
|
|
349
|
+
- Restart required for configuration changes
|
|
350
|
+
|
|
351
|
+
**Lifecycle:**
|
|
352
|
+
|
|
353
|
+
1. Plugin loads
|
|
354
|
+
2. MCP configuration parsed
|
|
355
|
+
3. Server process started (stdio) or connection established (SSE/HTTP/WS)
|
|
356
|
+
4. Tools discovered and registered
|
|
357
|
+
5. Tools available as `mcp__plugin_...__...`
|
|
358
|
+
|
|
359
|
+
**Viewing servers:**
|
|
360
|
+
Use `/mcp` command to see all servers including plugin-provided ones.
|
|
361
|
+
|
|
362
|
+
## Authentication Patterns
|
|
363
|
+
|
|
364
|
+
### OAuth (SSE/HTTP)
|
|
365
|
+
|
|
366
|
+
OAuth handled automatically by Claude Code:
|
|
367
|
+
|
|
368
|
+
```json
|
|
369
|
+
{
|
|
370
|
+
"type": "sse",
|
|
371
|
+
"url": "https://mcp.example.com/sse"
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
User authenticates in browser on first use. No additional configuration needed.
|
|
376
|
+
|
|
377
|
+
### Token-Based (Headers)
|
|
378
|
+
|
|
379
|
+
Static or environment variable tokens:
|
|
380
|
+
|
|
381
|
+
```json
|
|
382
|
+
{
|
|
383
|
+
"type": "http",
|
|
384
|
+
"url": "https://api.example.com",
|
|
385
|
+
"headers": {
|
|
386
|
+
"Authorization": "Bearer ${API_TOKEN}"
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Document required environment variables in README.
|
|
392
|
+
|
|
393
|
+
### Environment Variables (stdio)
|
|
394
|
+
|
|
395
|
+
Pass configuration to MCP server:
|
|
396
|
+
|
|
397
|
+
```json
|
|
398
|
+
{
|
|
399
|
+
"command": "python",
|
|
400
|
+
"args": ["-m", "my_mcp_server"],
|
|
401
|
+
"env": {
|
|
402
|
+
"DATABASE_URL": "${DB_URL}",
|
|
403
|
+
"API_KEY": "${API_KEY}",
|
|
404
|
+
"LOG_LEVEL": "info"
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
## Integration Patterns
|
|
410
|
+
|
|
411
|
+
### Pattern 1: Simple Tool Wrapper
|
|
412
|
+
|
|
413
|
+
Commands use MCP tools with user interaction:
|
|
414
|
+
|
|
415
|
+
```markdown
|
|
416
|
+
# Command: create-item.md
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
allowed-tools: `mcp__plugin_name_server__create_item`
|
|
421
|
+
|
|
422
|
+
Steps:
|
|
423
|
+
|
|
424
|
+
1. Gather item details from user
|
|
425
|
+
2. Use `mcp__plugin_name_server__create_item`
|
|
426
|
+
3. Confirm creation
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
**Use for:** Adding validation or preprocessing before MCP calls.
|
|
430
|
+
|
|
431
|
+
### Pattern 2: Autonomous Agent
|
|
432
|
+
|
|
433
|
+
Agents use MCP tools autonomously:
|
|
434
|
+
|
|
435
|
+
```markdown
|
|
436
|
+
# Agent: data-analyzer.md
|
|
437
|
+
|
|
438
|
+
Analysis Process:
|
|
439
|
+
|
|
440
|
+
1. Query data via `mcp__plugin_db_server__query`
|
|
441
|
+
2. Process and analyze results
|
|
442
|
+
3. Generate insights report
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
**Use for:** Multi-step MCP workflows without user interaction.
|
|
446
|
+
|
|
447
|
+
### Pattern 3: Multi-Server Plugin
|
|
448
|
+
|
|
449
|
+
Integrate multiple MCP servers:
|
|
450
|
+
|
|
451
|
+
```json
|
|
452
|
+
{
|
|
453
|
+
"github": {
|
|
454
|
+
"type": "sse",
|
|
455
|
+
"url": "https://mcp.github.com/sse"
|
|
456
|
+
},
|
|
457
|
+
"jira": {
|
|
458
|
+
"type": "sse",
|
|
459
|
+
"url": "https://mcp.jira.com/sse"
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
**Use for:** Workflows spanning multiple services.
|
|
465
|
+
|
|
466
|
+
## Security Best Practices
|
|
467
|
+
|
|
468
|
+
### Use HTTPS/WSS
|
|
469
|
+
|
|
470
|
+
Always use secure connections:
|
|
471
|
+
|
|
472
|
+
```json
|
|
473
|
+
✅ "url": "https://mcp.example.com/sse"
|
|
474
|
+
❌ "url": "http://mcp.example.com/sse"
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### Token Management
|
|
478
|
+
|
|
479
|
+
**DO:**
|
|
480
|
+
|
|
481
|
+
- ✅ Use environment variables for tokens
|
|
482
|
+
- ✅ Document required env vars in README
|
|
483
|
+
- ✅ Let OAuth flow handle authentication
|
|
484
|
+
|
|
485
|
+
**DON'T:**
|
|
486
|
+
|
|
487
|
+
- ❌ Hardcode tokens in configuration
|
|
488
|
+
- ❌ Commit tokens to git
|
|
489
|
+
- ❌ Share tokens in documentation
|
|
490
|
+
|
|
491
|
+
### Permission Scoping
|
|
492
|
+
|
|
493
|
+
Pre-allow only necessary MCP tools:
|
|
494
|
+
|
|
495
|
+
```markdown
|
|
496
|
+
✅ allowed-tools: `mcp__plugin_api_server__read_data`, `mcp__plugin_api_server__create_item`
|
|
497
|
+
|
|
498
|
+
❌ allowed-tools: mcp__plugin_api_server__*
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
### Managed MCP Controls (Enterprise)
|
|
502
|
+
|
|
503
|
+
Organizations can control MCP server access through managed settings.
|
|
504
|
+
|
|
505
|
+
Place `managed-mcp.json` at the system-wide managed settings path for exclusive control over MCP server configuration. Alternatively, use allow/deny lists in managed settings:
|
|
506
|
+
|
|
507
|
+
```json
|
|
508
|
+
{
|
|
509
|
+
"allowedMcpServers": [
|
|
510
|
+
{ "serverName": "github" },
|
|
511
|
+
{ "serverCommand": ["npx", "-y", "@company/mcp-server"] },
|
|
512
|
+
{ "serverUrl": "https://mcp.company.com/*" }
|
|
513
|
+
],
|
|
514
|
+
"deniedMcpServers": [
|
|
515
|
+
{ "serverName": "untrusted-server" }
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
**Matcher types:**
|
|
521
|
+
|
|
522
|
+
- `serverName` — Match by configured server name
|
|
523
|
+
- `serverCommand` — Match by exact command array
|
|
524
|
+
- `serverUrl` — Match by URL pattern (supports `*` wildcards)
|
|
525
|
+
|
|
526
|
+
These settings are configured by administrators and cannot be overridden by users or plugins.
|
|
527
|
+
|
|
528
|
+
## Claude Code as MCP Server
|
|
529
|
+
|
|
530
|
+
Claude Code can itself act as an MCP server, exposing its capabilities to other tools:
|
|
531
|
+
|
|
532
|
+
```bash
|
|
533
|
+
claude mcp serve
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
This enables other MCP-compatible clients to use Claude Code's tools. Useful for building tool chains where Claude Code is one component.
|
|
537
|
+
|
|
538
|
+
### Importing from Claude Desktop
|
|
539
|
+
|
|
540
|
+
Users who already have MCP servers configured in Claude Desktop can import them:
|
|
541
|
+
|
|
542
|
+
```bash
|
|
543
|
+
claude mcp add-from-claude-desktop
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
This copies MCP server configurations from Claude Desktop into Claude Code. Plugin developers should note that users may already have servers configured this way — avoid name conflicts with commonly used server names.
|
|
547
|
+
|
|
548
|
+
## Dynamic Tool Updates
|
|
549
|
+
|
|
550
|
+
MCP servers can notify Claude Code when their available tools change at runtime using the `list_changed` notification. This enables servers that dynamically add or remove tools based on context (e.g., loading project-specific tools after initialization). Claude Code automatically re-discovers tools when `list_changed` fires, without requiring a restart.
|
|
551
|
+
|
|
552
|
+
**Plugin design note:** If your MCP server's available tools depend on runtime state, implement `list_changed` to ensure Claude Code always has an up-to-date tool list.
|
|
553
|
+
|
|
554
|
+
## MCP Output Limits
|
|
555
|
+
|
|
556
|
+
MCP tool responses are subject to size limits:
|
|
557
|
+
|
|
558
|
+
- **Warning threshold**: 10,000 tokens
|
|
559
|
+
- **Default maximum**: 25,000 tokens (responses exceeding this are truncated)
|
|
560
|
+
- **Configuration**: Set `MAX_MCP_OUTPUT_TOKENS` environment variable to adjust the maximum
|
|
561
|
+
|
|
562
|
+
Design MCP tools to return concise, relevant data. Use pagination or filtering for large datasets.
|
|
563
|
+
|
|
564
|
+
## Error Handling
|
|
565
|
+
|
|
566
|
+
### Connection Failures
|
|
567
|
+
|
|
568
|
+
Handle MCP server unavailability:
|
|
569
|
+
|
|
570
|
+
- Provide fallback behavior in commands
|
|
571
|
+
- Inform user of connection issues
|
|
572
|
+
- Check server URL and configuration
|
|
573
|
+
|
|
574
|
+
### Tool Call Errors
|
|
575
|
+
|
|
576
|
+
Handle failed MCP operations:
|
|
577
|
+
|
|
578
|
+
- Validate inputs before calling MCP tools
|
|
579
|
+
- Provide clear error messages
|
|
580
|
+
- Check rate limiting and quotas
|
|
581
|
+
|
|
582
|
+
### Configuration Errors
|
|
583
|
+
|
|
584
|
+
Validate MCP configuration:
|
|
585
|
+
|
|
586
|
+
- Test server connectivity during development
|
|
587
|
+
- Validate JSON syntax
|
|
588
|
+
- Check required environment variables
|
|
589
|
+
|
|
590
|
+
## Performance Considerations
|
|
591
|
+
|
|
592
|
+
### Lazy Loading
|
|
593
|
+
|
|
594
|
+
MCP servers connect on-demand:
|
|
595
|
+
|
|
596
|
+
- Not all servers connect at startup
|
|
597
|
+
- First tool use triggers connection
|
|
598
|
+
- Connection pooling managed automatically
|
|
599
|
+
|
|
600
|
+
### Batching
|
|
601
|
+
|
|
602
|
+
Batch similar requests when possible:
|
|
603
|
+
|
|
604
|
+
```
|
|
605
|
+
# Good: Single query with filters
|
|
606
|
+
tasks = search_tasks(project="X", assignee="me", limit=50)
|
|
607
|
+
|
|
608
|
+
# Avoid: Many individual queries
|
|
609
|
+
for id in task_ids:
|
|
610
|
+
task = get_task(id)
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
## Testing MCP Integration
|
|
614
|
+
|
|
615
|
+
### Local Testing
|
|
616
|
+
|
|
617
|
+
1. Configure MCP server in `.mcp.json`
|
|
618
|
+
2. Install plugin locally (`.claude-plugin/`)
|
|
619
|
+
3. Run `/mcp` to verify server appears
|
|
620
|
+
4. Test tool calls in commands
|
|
621
|
+
5. Check `claude --debug` logs for connection issues
|
|
622
|
+
|
|
623
|
+
### Validation Checklist
|
|
624
|
+
|
|
625
|
+
- [ ] MCP configuration is valid JSON
|
|
626
|
+
- [ ] Server URL is correct and accessible
|
|
627
|
+
- [ ] Required environment variables documented
|
|
628
|
+
- [ ] Tools appear in `/mcp` output
|
|
629
|
+
- [ ] Authentication works (OAuth or tokens)
|
|
630
|
+
- [ ] Tool calls succeed from commands
|
|
631
|
+
- [ ] Error cases handled gracefully
|
|
632
|
+
|
|
633
|
+
## MCP CLI Commands
|
|
634
|
+
|
|
635
|
+
For testing and managing MCP servers during development:
|
|
636
|
+
|
|
637
|
+
```bash
|
|
638
|
+
# Add servers
|
|
639
|
+
claude mcp add --transport stdio <name> -- <command> [args...]
|
|
640
|
+
claude mcp add --transport http <name> <url>
|
|
641
|
+
claude mcp add --transport http <name> <url> --header "Authorization: Bearer token"
|
|
642
|
+
|
|
643
|
+
# Manage servers
|
|
644
|
+
claude mcp list # List configured servers
|
|
645
|
+
claude mcp get <name> # Show server details
|
|
646
|
+
claude mcp remove <name> # Remove a server
|
|
647
|
+
|
|
648
|
+
# Advanced
|
|
649
|
+
claude mcp add-json <name> '<json>' # Add from JSON config
|
|
650
|
+
claude mcp add-from-claude-desktop # Import from Claude Desktop
|
|
651
|
+
claude mcp reset-project-choices # Reset project MCP approval choices
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
Key flags: `--scope` (local/project/user), `--env KEY=value`, `--callback-port` (for OAuth).
|
|
655
|
+
|
|
656
|
+
## Debugging
|
|
657
|
+
|
|
658
|
+
### Enable Debug Logging
|
|
659
|
+
|
|
660
|
+
```bash
|
|
661
|
+
claude --debug
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
Look for:
|
|
665
|
+
|
|
666
|
+
- MCP server connection attempts
|
|
667
|
+
- Tool discovery logs
|
|
668
|
+
- Authentication flows
|
|
669
|
+
- Tool call errors
|
|
670
|
+
|
|
671
|
+
### Common Issues
|
|
672
|
+
|
|
673
|
+
**Server not connecting:**
|
|
674
|
+
|
|
675
|
+
- Check URL is correct
|
|
676
|
+
- Verify server is running (stdio)
|
|
677
|
+
- Check network connectivity
|
|
678
|
+
- Review authentication configuration
|
|
679
|
+
|
|
680
|
+
**Tools not available:**
|
|
681
|
+
|
|
682
|
+
- Verify server connected successfully
|
|
683
|
+
- Check tool names match exactly
|
|
684
|
+
- Run `/mcp` to see available tools
|
|
685
|
+
- Restart Claude Code after config changes
|
|
686
|
+
|
|
687
|
+
**Authentication failing:**
|
|
688
|
+
|
|
689
|
+
- Clear cached auth tokens
|
|
690
|
+
- Re-authenticate
|
|
691
|
+
- Check token scopes and permissions
|
|
692
|
+
- Verify environment variables set
|
|
693
|
+
|
|
694
|
+
## Quick Reference
|
|
695
|
+
|
|
696
|
+
### MCP Server Types
|
|
697
|
+
|
|
698
|
+
| Type | Transport | Best For | Auth |
|
|
699
|
+
| ----- | --------- | --------------------------- | -------- |
|
|
700
|
+
| stdio | Process | Local tools, custom servers | Env vars |
|
|
701
|
+
| SSE | HTTP | Hosted services, cloud APIs | OAuth |
|
|
702
|
+
| HTTP | REST | API backends, token auth | Tokens |
|
|
703
|
+
| ws | WebSocket | Real-time, streaming | Tokens |
|
|
704
|
+
|
|
705
|
+
### Configuration Checklist
|
|
706
|
+
|
|
707
|
+
- [ ] Server type specified (stdio/SSE/HTTP/ws)
|
|
708
|
+
- [ ] Type-specific fields complete (command or url)
|
|
709
|
+
- [ ] Authentication configured
|
|
710
|
+
- [ ] Environment variables documented
|
|
711
|
+
- [ ] HTTPS/WSS used (not HTTP/WS)
|
|
712
|
+
- [ ] ${CLAUDE_PLUGIN_ROOT} used for paths
|
|
713
|
+
|
|
714
|
+
### Best Practices
|
|
715
|
+
|
|
716
|
+
**DO:**
|
|
717
|
+
|
|
718
|
+
- ✅ Use ${CLAUDE_PLUGIN_ROOT} for portable paths
|
|
719
|
+
- ✅ Document required environment variables
|
|
720
|
+
- ✅ Use secure connections (HTTPS/WSS)
|
|
721
|
+
- ✅ Pre-allow specific MCP tools in commands
|
|
722
|
+
- ✅ Test MCP integration before publishing
|
|
723
|
+
- ✅ Handle connection and tool errors gracefully
|
|
724
|
+
|
|
725
|
+
**DON'T:**
|
|
726
|
+
|
|
727
|
+
- ❌ Hardcode absolute paths
|
|
728
|
+
- ❌ Commit credentials to git
|
|
729
|
+
- ❌ Use HTTP instead of HTTPS
|
|
730
|
+
- ❌ Pre-allow all tools with wildcards
|
|
731
|
+
- ❌ Skip error handling
|
|
732
|
+
- ❌ Forget to document setup
|
|
733
|
+
|
|
734
|
+
## Additional Resources
|
|
735
|
+
|
|
736
|
+
### Reference Files
|
|
737
|
+
|
|
738
|
+
For detailed information, consult:
|
|
739
|
+
|
|
740
|
+
- **`references/server-discovery.md`** - Find MCP servers using PulseMCP directory
|
|
741
|
+
- **`references/server-types.md`** - Deep dive on each server type
|
|
742
|
+
- **`references/authentication.md`** - Authentication patterns and OAuth
|
|
743
|
+
- **`references/tool-usage.md`** - Using MCP tools in commands and agents
|
|
744
|
+
|
|
745
|
+
### Example Configurations
|
|
746
|
+
|
|
747
|
+
Working examples in `examples/`:
|
|
748
|
+
|
|
749
|
+
- **`stdio-server.json`** - Local stdio MCP server
|
|
750
|
+
- **`sse-server.json`** - Hosted SSE server with OAuth
|
|
751
|
+
- **`http-server.json`** - REST API with token auth
|
|
752
|
+
- **`ws-server.json`** - WebSocket server for real-time communication
|
|
753
|
+
|
|
754
|
+
### External Resources
|
|
755
|
+
|
|
756
|
+
- **Official MCP Docs**: <https://modelcontextprotocol.io/>
|
|
757
|
+
- **Claude Code MCP Docs**: <https://docs.claude.com/en/docs/claude-code/mcp>
|
|
758
|
+
- **MCP SDK**: @modelcontextprotocol/sdk
|
|
759
|
+
- **Testing**: Use `claude --debug` and `/mcp` command
|
|
760
|
+
|
|
761
|
+
## Implementation Workflow
|
|
762
|
+
|
|
763
|
+
To add MCP integration to a plugin:
|
|
764
|
+
|
|
765
|
+
1. Choose MCP server type (stdio, SSE, HTTP, ws)
|
|
766
|
+
2. Create `.mcp.json` at plugin root with configuration
|
|
767
|
+
3. Use ${CLAUDE_PLUGIN_ROOT} for all file references
|
|
768
|
+
4. Document required environment variables in README
|
|
769
|
+
5. Test locally with `/mcp` command
|
|
770
|
+
6. Pre-allow MCP tools in relevant commands
|
|
771
|
+
7. Handle authentication (OAuth or tokens)
|
|
772
|
+
8. Test error cases (connection failures, auth errors)
|
|
773
|
+
9. Document MCP integration in plugin README
|
|
774
|
+
|
|
775
|
+
Focus on stdio for custom/local servers, SSE for hosted services with OAuth.
|