create-mcp-integration · git:20260321.a5031ab · 2026-03-21 · sha256 3a1e13a5c0131839
create-mcp-integration git:20260321.a5031abA
Immutable. This exact content is served forever at /api/v1/blob/3a1e13a5c0131839.
---
name: create-mcp-integration
accreditation: Patterns, examples, and terminology gratefully adapted from Anthropic public plugin-dev and skill-creator repositories.
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.
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.
### 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).
### Phase 2: Configuration Plan
Propose the configuration block.
**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"`
**CRITICAL RULE: Security**
Never hardcode credentials. Use `${API_KEY}` syntax to reference environment variables.
Show the user the proposed JSON structure (whether for `.mcp.json` or `mcpServers` block in `plugin.json`). Wait for approval.
### 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.
### 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.
## 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.