mcp-builder
Guide developers in creating Model Context Protocol (MCP) servers. Use for building MCP tools that enable LLMs to interact with external services. Covers…
от oimiragieo★ 48 звёзд на GitHub
Установить mcp-builder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
MCP Server Development Guide
"The quality of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks."
Overview
This skill guides you through creating Model Context Protocol (MCP) servers — tools that enable LLMs to interact with external services. MCP servers expose capabilities as typed tools that agents can discover and invoke.
When to Invoke
- User asks to "build an MCP server" or "create MCP tools"
- Integrating an external API with Claude
- Exposing local system capabilities (files, databases, services) to an agent
- Creating tools for an agent to call
Four-Phase Development Workflow
Phase 1: Deep Research and Planning
Before writing any code, understand the target API or service thoroughly.
Study MCP protocol documentation
- Visit
https://modelcontextprotocol.io/sitemap.xmlfor current docs - Understand tool definitions, resource types, and prompt patterns
- Visit
Analyze the target service
- What operations does the API support?
- Which operations are read-only vs destructive?
- What are the authentication requirements?
- What are the rate limits and pagination patterns?
Design tool coverage
- Balance: API coverage (breadth) vs workflow tools (depth, combining multiple API calls)
- Prefer workflow tools for common agent tasks
- Design tool names as snake_case verb-noun pairs:
get_user,create_issue,list_repos
Choose transport
- Remote servers: Streamable HTTP transport
- Local servers: stdio transport
- Default to stdio unless there's a specific need for HTTP
Phase 2: Implementation
Language Selection
TypeScript (recommended) — high-quality SDK, strong type safety, better IDE support:
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { z } from 'zod';
const server = new McpServer({
name: 'my-service',
version: '1.0.0',
});
Python (FastMCP) — simpler syntax, good for Python-native services:
from mcp.server.fastmcp import FastMCP
from pydantic import BaseModel
mcp = FastMCP("my-service")
Project Structure (TypeScript)
mcp-server/
├── src/
│ ├── index.ts # Server entry point
│ ├── client.ts # API client + auth
│ ├── tools/
│ │ ├── read.ts # Read-only tools
│ │ └── write.ts # Mutating tools
│ └── utils/
│ ├── pagination.ts
│ └── errors.ts
├── package.json
├── tsconfig.json
└── README.md
Tool Annotations (MANDATORY)
Every tool MUST declare intent annotations:
server.tool(
'get_repository',
'Fetch a GitHub repository by owner and name',
{
owner: z.string().describe('Repository owner (username or org)'),
repo: z.string().describe('Repository name'),
},
{
// Annotations
readOnlyHint: true, // Does not modify external state
destructiveHint: false, // Not destructive
idempotentHint: true, // Safe to call multiple times
openWorldHint: true, // Makes external network calls
},
async ({ owner, repo }) => {
// implementation
}
);
Annotation reference:
| Annotation | Type | Meaning |
|---|---|---|
readOnlyHint |
boolean | Does not modify external state |
destructiveHint |
boolean | May destroy data irreversibly |
idempotentHint |
boolean | Multiple identical calls have same effect |
openWorldHint |
boolean | Interacts with external systems (network, disk) |
Input Validation with Zod (TypeScript)
// Good: explicit, descriptive schemas
const schema = {
query: z.string().min(1).max(500).describe('Search query'),
limit: z.number().int().min(1).max(100).default(20).describe('Max results'),
cursor: z.string().optional().describe('Pagination cursor from previous call'),
};
Input Validation with Pydantic (Python)
from pydantic import BaseModel, Field
from typing import Optional
class SearchParams(BaseModel):
query: str = Field(..., min_length=1, max_length=500, description="Search query")
limit: int = Field(20, ge=1, le=100, description="Max results")
cursor: Optional[str] = Field(None, description="Pagination cursor")
Response Format
Include both text (for human-readable output) and structured data (for agent parsing):
return {
content: [
{
type: 'text',
text: `Found ${results.length} results for "${query}"`,
},
{
type: 'text',
text: JSON.stringify(results, null, 2),
},
],
};
Shared Utilities
Always build these utilities before implementing tools:
- API client — centralized HTTP client with auth headers, retry logic
- Error handler — converts API error
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Read - 02
Write - 03
Edit - 04
Bash - 05
Glob - 06
Grep - 07
WebFetch
Вложенные файлы
- commands/mcp-builder.md
- hooks/post-execute.cjs
- hooks/pre-execute.cjs
- references/research-requirements.md
- rules/mcp-builder.md
- schemas/input.schema.json
- schemas/output.schema.json
- scripts/main.cjs
- templates/implementation-template.md
FAQ
Что делает скилл mcp-builder?
Guide developers in creating Model Context Protocol (MCP) servers. Use for building MCP tools that enable LLMs to interact with external services. Covers TypeScript (primary) and Python FastMCP (secondary), tool annotations, Zod/Pydantic validation, and evaluation question creation.
Как установить скилл mcp-builder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mcp-builder запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis 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…