create-mcp-integration ยท diff
git:20260321.b056f9f to git:20260328.04e9e1c
21 added, 54 removed. Audit A to A.
---
name: create-mcp-integration
- description: >
- Interactive initialization script that scaffolds a new Model Context Protocol (MCP) server
- integration for a plugin. Trigger with "add an MCP", "setup mcp server", "integrate postgres mcp",
- "add a tool server", or when a user wants to connect an external API/database to their plugin
- via the Model Context Protocol.
+ description: Add an MCP server integration to a plugin
+ argument-hint: "[mcp-server-name or service]"
allowed-tools: Bash, Read, Write
---
- ## Dependencies
-
- This skill requires **Python 3.8+** and standard library only. No external packages needed.
-
- **To install this skill's dependencies:**
- ```bash
- pip-compile ./requirements.in
- pip install -r ./requirements.txt
- ```
-
- See `./requirements.txt` for the dependency lockfile (currently empty โ standard library only).
-
- ---
- # MCP Integration Scaffolder
-
- You are an expert MCP Integration Architect. Your job is to lead the user through a guided interview to scaffold a resilient, portable, and secure Model Context Protocol server configuration for their plugin.
-
- Read the deep background in `references/server-types.md` and `references/authentication.md` before beginning.
-
- ## Execution Flow
-
- Execute these phases sequentially. Do not move to the next phase without explicit approval.
+ Follow the `create-mcp-integration` skill workflow to scaffold a new MCP server
+ integration for a Claude Code plugin.
- ### Phase 1: Guided Discovery
- Conduct a short interview to understand the integration target:
- 1. **Server Type**: Are we integrating a local process (`stdio`), a hosted service (`sse` / `http`), or a real-time stream (`ws`)?
- 2. **Server Executable/URL**: What is the `npx` command, Python script, or remote endpoint?
- 3. **Authentication**: Does it require API keys, local config files, or OAuth?
- 4. **Scope**: Should this MCP be bundled inline in the plugin's `plugin.json` or as a dedicated `.mcp.json` file? (Recommend `.mcp.json` for complex or multi-server plugins).
+ ## Inputs
- ### Phase 2: Configuration Plan
- Propose the configuration block.
+ - `$ARGUMENTS` โ optional MCP server name or service description (e.g. `postgres`,
+ `github`, `slack`). Omit to start with discovery.
- **CRITICAL RULE: Portability**
- If the MCP server requires a local path (e.g., to a DB file or a custom script), it **MUST** use `${CLAUDE_PLUGIN_ROOT}` instead of absolute user paths.
- `"command": "${CLAUDE_PLUGIN_ROOT}/scripts/my-server.py"`
+ ## Steps
- **CRITICAL RULE: Security**
- Never hardcode credentials. Use `${API_KEY}` syntax to reference environment variables.
+ 1. If `$ARGUMENTS` names a server or service, use it to seed Phase 1 discovery
+ 2. Follow the create-mcp-integration phased workflow: confirm server type
+ (stdio / SSE / streamable-http), authentication method, which tools to expose,
+ configuration fields, then generate the `.mcp.json` entry and any supporting config
+ 3. Report the generated configuration and setup instructions
- Show the user the proposed JSON structure (whether for `.mcp.json` or `mcpServers` block in `plugin.json`). Wait for approval.
+ ## Output
- ### Phase 3: Scaffold Iteration
- Once approved, use `Write` tools to scaffold the integration:
- 1. Create/update the `.mcp.json` or `plugin.json` file.
- 2. If environment variables are required, create/update `.claude/.local.md` setting a safe default or instructions. Add `.claude/.local.md` to `.gitignore`.
- 3. Scaffold or update `../../CONNECTORS.md` at the plugin root. Map the raw MCP tool names (e.g., `mcp__plugin_name_server__query`) to abstract tag aliases (e.g., `~~database-query`). Explain that this protects commands from breaking if the underlying MCP changes.
+ `.mcp.json` server entry with full configuration (command/url, env vars, allowed tools)
+ and instructions for obtaining credentials and verifying the connection with `/mcp`.
- ### Phase 4: Documentation & Test Stub
- 1. Output instructions on how to start/restart the agent to load the MCP.
- 2. Instruct the user to run `/mcp` to verify the tools mounted correctly.
- 3. Suggest passing the `~~` abstract tags via `allowed-tools` in future command creations.
+ ## Edge Cases
- ## Interaction Style
- - Assume an authoritative, expert persona.
- - Use explicit `<example>` blocks when asking the user for input.
- - End Phase 1 and 2 with an explicit "Should I proceed with these parameters?" approval gate.
+ - If `$ARGUMENTS` is empty: begin with server type selection
+ - If the service requires OAuth: document the auth flow steps explicitly
+ - Prefer `streamable-http` transport for new hosted integrations over SSE
+ - All MCP server URLs must use HTTPS/WSS โ never HTTP/WS