/mcp-builder:mcp-builderfrom mcp-builder
Builds, tests, and deploys MCP (Model Context Protocol) servers. Guides through research, implementation, review, evaluation, and verification using MCP Inspector. Supports TypeScript and Python.
Ships in mcp-builder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Build, test, and deploy MCP servers that enable LLMs to accomplish real-world tasks through well-designed tools. Server quality is measured by how effectively agents can use the tools, not by API coverage alone.
Ask the user which programming language they want to use before doing anything else. Use AskQuestion to prompt for their preferred language. Do not proceed until they answer. Then load the corresponding language-specific reference from references/:
references/typescript.mdreferences/python.mdreferences/guidelines.md and adapt to the chosen languageApply the language-specific conventions (naming, SDK, validation library, project structure, idioms) from the loaded reference throughout the entire build.
Follow six phases in order. Phases 1-5 are mandatory. Do NOT skip any phase. Do NOT declare the server complete until Phase 5 passes.
references/testing.md.uvx runlayer deploy. See references/deploy.md.Determine these upfront:
Transport:
stdio -- local/CLI tools, single user, simple setupStreamable HTTP -- remote/cloud, multi-client, serverless. Avoid SSE (deprecated).State:
Auth:
Language conventions (applied after user selects language):
| Language | Server name | Validation | SDK |
|---|---|---|---|
| TypeScript | {service}-mcp-server | Zod | @modelcontextprotocol/sdk |
| Python | {service}_mcp | Pydantic | mcp (FastMCP) |
| Other | {service}-mcp | JSON Schema | Implement protocol directly |
{service}_{action}_{resource} in snake_case. Always prefix with service name.name, title, description, inputSchema, outputSchema, annotationsreadOnlyHint, destructiveHint, idempotentHint, openWorldHint on every tool..describe() on every field.content (text) and structuredContent (typed data).For detailed patterns, validation examples, response formatting, error handling, pagination, auth, testing, security, logging, and deployment guidance, read references/guidelines.md.
{service}-mcp-server/
├── src/
│ ├── index.ts # Entry point (dual-mode: local + serverless)
│ ├── tools/ # Tool implementations + registry
│ ├── resources/ # MCP resource handlers (if needed)
│ ├── services/ # API clients, external service wrappers
│ ├── schemas/ # Validation schemas
│ ├── utils/ # Shared helpers (retry, formatting, errors)
│ ├── auth/ # Auth, token storage, middleware
│ └── types/ # Type definitions
├── tests/
│ ├── unit/
│ └── integration/
└── README.md
makeApiRequest -- centralized HTTP client with auth, timeout, retrieshandleApiError -- maps HTTP status to MCP error codes with contextcreateToolResponse / createErrorResponse -- consistent response envelopeswithRetry -- exponential backoff (retry 429, 5xx, network errors; skip other 4xx)withRetryhas_more + next_offset)Before declaring the server complete:
has_more / next_offsetany typesThis phase is required. The server is NOT complete until these tests pass. Read references/testing.md for detailed patterns.
Even without API credentials, you MUST verify the server works at the MCP protocol level by piping JSON-RPC messages to the server process:
initialize request, confirm server responds with protocolVersion, capabilities, and serverInfo.tools/list, confirm all expected tools appear with correct names, schemas, and annotations.isError: true response (not a crash) when credentials are missing or the resource doesn't exist.Example for stdio servers:
# Test 1: Initialize
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node dist/index.js 2>/dev/null
# Test 2: List tools (send initialize + notification + list in sequence)
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}\n{"jsonrpc":"2.0","method":"notifications/initialized"}\n{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}\n' | node dist/index.js 2>/dev/null
# Test 3: Call a tool and verify error handling
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}\n{"jsonrpc":"2.0","method":"notifications/initialized"}\n{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"SERVICE_TOOL_NAME","arguments":{}}}\n' | node dist/index.js 2>/dev/null
Adapt node dist/index.js for Python (uv run server.py) as needed.
If any test fails, fix the code and re-run. Do not proceed to Phase 6.
Start MCP Inspector:
npx @anthropic-ai/mcp-inspector npx tsx src/index.tsnpx @anthropic-ai/mcp-inspector uv run server.pyTest each tool systematically:
On failure:
Exit criteria: All tools respond correctly to valid inputs and return proper MCP errors for invalid inputs.
When all interactive tests pass, ask the user:
"Your MCP server is working correctly. Would you like to deploy it to Runlayer?"
If yes, read references/deploy.md for full details, then:
Use AskQuestion to prompt for both values. Do not guess or skip.
https://mycompany.runlayer.com or https://ecs.prod.runlayer.com)"If the server was built with stdio-only transport, add dual-mode support before deploying:
express dependency/health endpoint (returns {"status":"ok"})/mcp POST endpoint with StreamableHTTPServerTransportPORT env var to switch: stdio when no PORT, HTTP when PORT is setcurlreferences/deploy.md. Test locally with docker build . before proceeding..dockerignore — Exclude node_modules, dist, .git, .env, testsuvx runlayer deploy init --secret <API_KEY> --host <TENANT_URL>
This generates runlayer.yaml with the deployment ID. Edit it to set service.port to match your server.uvx runlayer deploy --secret <API_KEY> --host <TENANT_URL>
Show:
https://<tenant>/api/v1/proxy/<deployment-id>/mcpWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub runlayer/plugins --plugin mcp-builderOther plugins' skills for the same job