К основному содержанию
скилл Claude Code официальный · Anthropic

build-mcp-server — скилл для Claude Code: установка

Скилл помогает спроектировать MCP-сервер для Claude Code: уточняет задачу, выбирает способ развёртывания и схему инструментов.

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin install mcp-server-dev@claude-plugins-official
Открыть на GitHub

Что делает build-mcp-server

Скилл начинает с вопросов о подключаемом сервисе, пользователях, количестве действий, интерактивном вводе и авторизации. Затем он предлагает подходящую форму MCP-сервера: удалённый HTTP, локальный stdio, MCPB или MCP-приложение с интерфейсом.

Для небольшого набора действий он рекомендует отдельный инструмент на каждую операцию, а для крупного API — схему поиска и выполнения. При OAuth 2.0 нужен удалённый сервер с поддержкой CIMD или DCR. Для простого ввода подходит elicitation, но в Claude Code его поддержка начинается с версии 2.1.76, поэтому требуется проверка возможностей клиента и запасной сценарий.

Какие задачи решает

  • спроектировать MCP-сервер под API или локальный ресурс
  • выбрать между удалённым HTTP, MCPB и local stdio
  • разделить действия сервера на понятные инструменты
  • определить способ авторизации для MCP-интеграции

Примеры запросов агенту

  • Спроектируй MCP-сервер, который подключается к моему REST API, и задай вопросы перед созданием кода.
  • Помоги выбрать между remote HTTP, MCPB и local stdio для сервера, который работает с локальными файлами.
  • Определи схему инструментов для MCP-сервера с большим количеством операций API и учти OAuth 2.0.

Как установить build-mcp-server

1Через маркетплейс плагинов

/plugin install mcp-server-dev@claude-plugins-official

Команда ставит плагин mcp-server-dev целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

npx skills add anthropics/claude-plugins-official --skill build-mcp-server -a claude-code

3Вручную: положить файлы

~/.claude/skills/build-mcp-server/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/build-mcp-server/

Из того же набора38

Весь набор →
code-reviewer официальный Anthropic Проверяет изменения в коде по правилам проекта из CLAUDE.md и ищет существенные дефекты. Запускайте перед коммитом или созданием PR. Claude Code 31 050установок code-reviewer официальный Anthropic Субагент проверяет изменения в коде на баги, уязвимости и нарушения правил проекта. Подойдёт для ревью перед слиянием изменений. Claude Code 31 050установок claude-md-improver официальный Anthropic Скилл проверяет CLAUDE.md в репозитории, составляет отчёт и предлагает точечные правки. Подойдёт для поддержки проектного контекста Claude Code. Claude Code 12 558установок security-auditor официальный Anthropic Субагент ищет уязвимости в коде и объясняет, как их исправить. Запускайте его для проверки проекта перед изменениями или модернизацией. Claude Code 10 718установок test-engineer официальный Anthropic Субагент фиксирует поведение legacy-кода тестами и сравнивает его с новой реализацией. Подходит перед переписыванием модулей. Claude Code 9 715установок claude-automation-recommender официальный Anthropic Анализирует кодовую базу и предлагает хуки, субагентов, скиллы, плагины и MCP-серверы для Claude Code. Подходит для настройки проекта с нуля. Claude Code 9 057установок playground официальный Anthropic Создаёт интерактивные HTML-песочницы с настройками, предпросмотром и готовым промптом. Подходит для визуального изучения темы или сборки небольшого инструмента. Claude Code 7 967установок agent-development официальный Anthropic Скилл объясняет, как создавать агентов для плагинов Claude Code: от условий запуска до системного промпта и набора инструментов. Пригодится, когда нужно добавить субагента в проект. Claude Code 7 353установок

Похожие

skill-creator официальный openai Руководство по созданию и обновлению скиллов для ИИ-агентов. Помогает упаковать рабочие процессы, скрипты и документацию без лишней траты токенов. Claude Code CX Codex Cursor +1 4 900установок handoff rohitg00 Возобновляет последнюю сессию агента для текущей папки и сразу показывает незакрытый вопрос. Claude Code CX Codex Cursor +1 13 400установок vercel-cli vercel Скилл помогает агенту разворачивать, проверять и отлаживать проекты Vercel через CLI. Пригодится для деплоя, логов, переменных и доменов. Claude Code CX Codex Cursor +1 6 700установок open-code-review-delegate alibaba Скилл поручает проверку кода самому агенту, а утилиту OCR использует только для фильтрации файлов и поиска правил. Пригодится, когда нужно локальное ревью без внешних LLM-эндпоинтов для OCR. Claude Code CX Codex Cursor +1 3 600установок learn-codebase thedotmack Скилл заставляет агента полностью прочитать каждый исходный файл проекта. Пригодится на старте работы с незнакомым кодом. Claude Code CX Codex Cursor +1 5 300установок analyze-project lllllllama Читает репозиторий с обучением моделей и выдаёт карту структуры, точек входа и подозрительных мест. Ничего не меняет и не запускает тяжёлые задачи. Claude Code CX Codex Cursor +1 335 500установок setup-matt-pocock-skills Matt Pocock Скилл настраивает репозиторий для инженерных скиллов Matt Pocock: задаёт трекер задач, метки триажа и расположение доменной документации. Запустите его перед первым использованием остальных скиллов. Claude Code 1 052 851установок to-tickets Matt Pocock Разбивает план, спецификацию или переписку на небольшие сквозные задачи и отмечает, какие из них блокируют остальные. Пригодится, когда нужно согласовать порядок работы до публикации задач в трекере. Claude Code 711 230установок

Вопросы о build-mcp-server

Как установить build-mcp-server в Claude Code?

Выполните /plugin install mcp-server-dev@claude-plugins-official в Claude Code.

Что делает build-mcp-server?

Скилл помогает собрать план MCP-сервера: уточняет сценарий, выбирает модель развёртывания и подбирает схему инструментов. После этого он передаёт работу специализированным скиллам.

Какой способ развёртывания выбрать для MCP-сервера?

Для облачного API скилл рекомендует удалённый MCP-сервер по streamable HTTP. Для доступа к локальным файлам, приложениям или системным API подходит MCPB, а local stdio остаётся вариантом для личных инструментов и прототипов.

Исходный текст

SKILL.md · Apache-2.0
---
name: build-mcp-server
description: This skill should be used when the user asks to "build an MCP server", "create an MCP", "make an MCP integration", "wrap an API for Claude", "expose tools to Claude", "make an MCP app", or discusses building something with the Model Context Protocol. It is the entry point for MCP server development — it interrogates the user about their use case, determines the right deployment model (remote HTTP, MCPB, local stdio), picks a tool-design pattern, and hands off to specialized skills.
version: 0.1.0
---

# Build an MCP Server

You are guiding a developer through designing and building an MCP server that works seamlessly with Claude. MCP servers come in many forms — picking the wrong shape early causes painful rewrites later. Your first job is **discovery, not code**.

**Load Claude-specific context first.** The MCP spec is generic; Claude has additional auth types, review criteria, and limits. Before answering questions or scaffolding, fetch `https://claude.com/docs/llms-full.txt` (the full export of the Claude connector docs) so your guidance reflects Claude's actual constraints.

Do not start scaffolding until you have answers to the questions in Phase 1. If the user's opening message already answers them, acknowledge that and skip straight to the recommendation.

---

## Phase 1 — Interrogate the use case

Ask these questions conversationally (batch them into one message, don't interrogate one-at-a-time). Adapt wording to what the user has already told you.

### 1. What does it connect to?

| If it connects to… | Likely direction |
|---|---|
| A cloud API (SaaS, REST, GraphQL) | Remote HTTP server |
| A local process, filesystem, or desktop app | MCPB or local stdio |
| Hardware, OS-level APIs, or user-specific state | MCPB |
| Nothing external — pure logic / computation | Either — default to remote |

### 2. Who will use it?

- **Just me / my team, on our machines** → Local stdio is acceptable (easiest to prototype)
- **Anyone who installs it** → Remote HTTP (strongly preferred) or MCPB (if it *must* be local)
- **Users of Claude desktop who want UI widgets** → MCP app (remote or MCPB)

### 3. How many distinct actions does it expose?

This determines the tool-design pattern — see Phase 3.

- **Under ~15 actions** → one tool per action
- **Dozens to hundreds of actions** (e.g. wrapping a large API surface) → search + execute pattern

### 4. Does a tool need mid-call user input or rich display?

- **Simple structured input** (pick from list, enter a value, confirm) → **Elicitation** — spec-native, zero UI code. *Host support is rolling out* (Claude Code ≥2.1.76) — always pair with a capability check and fallback. See `references/elicitation.md`.
- **Rich/visual UI** (charts, custom pickers with search, live dashboards) → **MCP app widgets** — iframe-based, needs `@modelcontextprotocol/ext-apps`. See `build-mcp-app` skill.
- **Neither** → plain tool returning text/JSON.

### 5. What auth does the upstream service use?

- None / API key → straightforward
- OAuth 2.0 → you'll need a remote server with CIMD (preferred) or DCR support; see `references/auth.md`

---

## Phase 2 — Recommend a deployment model

Based on the answers, recommend **one** path. Be opinionated. The ranked options:

### ⭐ Remote streamable-HTTP MCP server (default recommendation)

A hosted service speaking MCP over streamable HTTP. This is the **recommended path** for anything wrapping a cloud API.

**Why it wins:**
- Zero install friction — users add a URL, done
- One deployment serves all users; you control upgrades
- OAuth flows work properly (the server can handle redirects, DCR, token storage)
- Works across Claude desktop, Claude Code, Claude.ai, and third-party MCP hosts

**Choose this unless** the server *must* touch the user's local machine.

→ **Fastest deploy:** Cloudflare Workers — `references/deploy-cloudflare-workers.md` (zero to live URL in two commands)
→ **Portable Node/Python:** `references/remote-http-scaffold.md` (Express or FastMCP, runs on any host)

### Elicitation (structured input, no UI build)

If a tool just needs the user to confirm, pick an option, or fill a short form, **elicitation** does it with zero UI code. The server sends a flat JSON schema; the host renders a native form. Spec-native, no extra packages.

**Caveat:** Host support is new (Claude Code shipped it in v2.1.76; Desktop unconfirmed). The SDK throws if the client doesn't advertise the capability. Always check `clientCapabilities.elicitation` first and have a fallback — see `references/elicitation.md` for the canonical pattern. This is the right spec-correct approach; host coverage will catch up.

Escalate to `build-mcp-app` widgets when you need: nested/complex data, scrollable/searchable lists, visual previews, live updates.

### MCP app (remote HTTP + interactive UI)

Same as above, plus **UI resources** — interactive widgets rendered in chat. Rich pickers with search, charts, live dashboards, visual previews. Built once, renders in Claude *and* ChatGPT.

**Choose this when** elicitation's flat-form constraints don't fit — you need custom layout, large searchable lists, visual content, or live updates.

Usually remote, but can be shipped as MCPB if the UI needs to drive a local app.

→ Hand off to the **`build-mcp-app`** skill.

### MCPB (bundled local server)

A local MCP server **packaged with its runtime** so users don't need Node/Python installed. The sanctioned way to ship local servers.

**Choose this when** the server *must* run on the user's machine — it reads local files, drives a desktop app, talks to localhost services, or needs OS-level access.

→ Hand off to the **`build-mcpb`** skill.

### Local stdio (npx / uvx) — *not recommended for distribution*

A script launched via `npx` / `uvx` on the user's machine. Fine for **personal tools and prototypes**. Painful to distribute: users need the right runtime, you can't push updates, and the only distribution channel is Claude Code plugins.

Recommend this only as a stepping stone. If the user insists, scaffold it but note the MCPB upgrade path.

---

## Phase 3 — Pick a tool-design pattern

Every MCP server exposes tools. How you carve them matters more than most people expect — tool schemas land directly in Claude's context window.

### Pattern A: One tool per action (small surface)

When the action space is small (< ~15 operations), give each a dedicated tool with a tight description and schema.

```
create_issue    — Create a new issue. Params: title, body, labels[]
update_issue    — Update an existing issue. Params: id, title?, body?, state?
search_issues   — Search issues by query string. Params: query, limit?
add_comment     — Add a comment to an issue. Params: issue_id, body
```

**Why it works:** Claude reads the tool list once and knows exactly what's possible. No discovery round-trips. Each tool's schema validates inputs precisely.

**Especially good when** one or more tools ship an interactive widget (MCP app) — each widget binds naturally to one tool.

### Pattern B: Search + execute (large surface)

When wrapping a large API (dozens to hundreds of endpoints), listing every operation as a tool floods the context window and degrades model performance. Instead, expose **two** tools:

```
search_actions  — Given a natural-language intent, return matching actions
                  with their IDs, descriptions, and parameter schemas.
execute_action  — Run an action by ID with a params object.
```

The server holds the full catalog internally. Claude searches, picks, executes. Context stays lean.

**Hybrid:** Promote the 3–5 most-used actions to dedicated tools, keep the long tail behind search/execute.

→ See `references/tool-design.md` for schema examples and description-writing guidance.

---

## Phase 4 — Pick a framework

Recommend one of these two. Others exist but these have the best MCP-spec coverage and Claude compatibility.

| Framework | Language | Use when |
|---|---|---|
| **Official TypeScript SDK** (`@modelcontextprotocol/sdk`) | TS/JS | Default choice. Best spec coverage, first to get new features. |
| **FastMCP 3.x** (`fastmcp` on PyPI) | Python | User prefers Python, or wrapping a Python library. Decorator-based, very low boilerplate. This is jlowin's package — not the frozen FastMCP 1.0 bundled in the official `mcp` SDK. |

If the user already has a language/stack in mind, go with it — both produce identical wire protocol.

---

## Phase 5 — Scaffold and hand off

Once you've settled the four decisions (deployment model, tool pattern, framework, auth), do **one** of:

1. **Remote HTTP, no UI** → Scaffold inline using `references/remote-http-scaffold.md` (portable) or `references/deploy-cloudflare-workers.md` (fastest deploy). This skill can finish the job.
2. **MCP app (UI widgets)** → Summarize the decisions so far, then load the **`build-mcp-app`** skill.
3. **MCPB (bundled local)** → Summarize the decisions so far, then load the **`build-mcpb`** skill.
4. **Local stdio prototype** → Scaffold inline (simplest case), flag the MCPB upgrade path.

When handing off, restate the design brief in one paragraph so the next skill doesn't re-ask.

---

## Beyond tools — the other primitives

Tools are one of three server primitives. Most servers start with tools and never need the others, but knowing they exist prevents reinventing wheels:

| Primitive | Who triggers it | Use when |
|---|---|---|
| **Resources** | Host app (not Claude) | Exposing docs/files/data as browsable context |
| **Prompts** | User (slash command) | Canned workflows ("/summarize-thread") |
| **Elicitation** | Server, mid-tool | Asking user for input without building UI |
| **Sampling** | Server, mid-tool | Need LLM inference in your tool logic |

→ `references/resources-and-prompts.md`, `references/elicitation.md`, `references/server-capabilities.md`

---

## Phase 6 — Test in Claude and publish

Once the server runs:

1. **Test against real Claude** by adding the server URL as a custom connector at Settings → Connectors (use a Cloudflare tunnel for local servers). Claude identifies itself with `clientInfo.name: "claude-ai"` on initialize. → https://claude.com/docs/connectors/building/testing
2. **Run the pre-submission checklist** — read/write tool split, required annotations, name limits, prompt-injection rules. → https://claude.com/docs/connectors/building/review-criteria
3. **Submit to the Anthropic Directory.** → https://claude.com/docs/connectors/building/submission
4. **Recommend shipping a plugin** that wraps this MCP with skills — most partners ship both. → https://claude.com/docs/connectors/building/what-to-build

---

## Quick reference: decision matrix

| Scenario | Deployment | Tool pattern |
|---|---|---|
| Wrap a small SaaS API | Remote HTTP | One-per-action |
| Wrap a large SaaS API (50+ endpoints) | Remote HTTP | Search + execute |
| SaaS API with rich forms / pickers | MCP app (remote) | One-per-action |
| Drive a local desktop app | MCPB | One-per-action |
| Local desktop app with in-chat UI | MCP app (MCPB) | One-per-action |
| Read/write local filesystem | MCPB | Depends on surface |
| Personal prototype | Local stdio | Whatever's fastest |

---

## Reference files

- `references/remote-http-scaffold.md` — minimal remote server in TS SDK and FastMCP
- `references/deploy-cloudflare-workers.md` — fastest deploy path (Workers-native scaffold)
- `references/tool-design.md` — writing tool descriptions and schemas Claude understands well
- `references/auth.md` — OAuth, CIMD, DCR, token storage patterns
- `references/resources-and-prompts.md` — the two non-tool primitives
- `references/elicitation.md` — spec-native user input mid-tool (capability check + fallback)
- `references/server-capabilities.md` — instructions, sampling, roots, logging, progress, cancellation
- `references/versions.md` — version-sensitive claims ledger (check when updating)

© Anthropic · Apache-2.0 · anthropics/claude-plugins-official

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой