AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured framework for developing MCP servers. It guides developers through a discovery process to determine the appropriate deployment model, tool-design pattern, and framework. It covers the lifecycle from initial architectural decisions—such as choosing between remote HTTP, MCPB, or local stdio—to implementation, testing, and submission to the Anthropic Directory.
What it does
- Interrogates use cases to recommend deployment models like remote HTTP, MCPB, or local stdio.
- Advises on tool-design patterns based on API surface size.
- Provides guidance on selecting between TypeScript and Python SDKs.
- Outlines authentication strategies including OAuth 2.0 via CIMD or DCR.
- Facilitates scaffolding for deployment on platforms like Cloudflare Workers.
- Directs users to specialized skills for UI widgets or bundled local server packaging.
When to use it
- When you need to build an MCP server or integrate an API with Claude.
- When you are unsure about the best deployment architecture for your MCP project.
- When you need to expose tools, resources, or prompts to Claude.
- When you need to implement authentication for an MCP server.
Advantages
- Helps avoid architectural pitfalls by selecting the right deployment model early.
- Provides clear decision matrices for tool design and framework selection.
- Offers standardized paths for common tasks like OAuth implementation.
- Streamlines the development process by providing specific scaffolding references.
Usage examples
- “I want to build an MCP server for my internal SaaS API.”
- The agent will initiate the discovery phase to determine your API surface size, auth requirements, and preferred deployment model.
- “How do I expose my local filesystem to Claude?”
- The agent will recommend the MCPB deployment model and guide you toward the appropriate packaging steps.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/anthropics/build-mcp-server/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip build-mcp-server.zip -d .agents/skills
Documentation by Anthropic
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. Seebuild-mcp-appskill.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, bodyWhy 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:
Remote HTTP, no UI → Scaffold inline using
references/remote-http-scaffold.md(portable) orreferences/deploy-cloudflare-workers.md(fastest deploy). This skill can finish the job.MCP app (UI widgets) → Summarize the decisions so far, then load the
build-mcp-appskill.MCPB (bundled local) → Summarize the decisions so far, then load the
build-mcpbskill.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:
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/testingRun the pre-submission checklist — read/write tool split, required annotations, name limits, prompt-injection rules. → https://claude.com/docs/connectors/building/review-criteria
Submit to the Anthropic Directory. → https://claude.com/docs/connectors/building/submission
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 FastMCPreferences/deploy-cloudflare-workers.md— fastest deploy path (Workers-native scaffold)references/tool-design.md— writing tool descriptions and schemas Claude understands wellreferences/auth.md— OAuth, CIMD, DCR, token storage patternsreferences/resources-and-prompts.md— the two non-tool primitivesreferences/elicitation.md— spec-native user input mid-tool (capability check + fallback)references/server-capabilities.md— instructions, sampling, roots, logging, progress, cancellationreferences/versions.md— version-sensitive claims ledger (check when updating)
Files
- ATTRIBUTION.mdAdded by AutoGineer986 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md11.8 KiB
- references/auth.md5.6 KiB
- references/deploy-cloudflare-workers.md3.6 KiB
- references/elicitation.md4.6 KiB
- references/remote-http-scaffold.md6.9 KiB
- references/resources-and-prompts.md4.0 KiB
- references/server-capabilities.md4.6 KiB
- references/tool-design.md6.9 KiB
- references/versions.md1.1 KiB
references/tool-design.md
Tool Design — Writing Tools Claude Uses Correctly
Tool schemas and descriptions are prompt engineering. They land directly in Claude's context and determine whether Claude picks the right tool with the right arguments. Most MCP integration bugs trace back to vague descriptions or loose schemas.
Anthropic Directory hard requirements
If this server will be submitted to the Anthropic Directory, the following are pass/fail review criteria (full list: https://claude.com/docs/connectors/building/review-criteria):
Every tool must include
readOnlyHint,destructiveHint, andtitleannotations — these determine auto-permissions in Claude.Tool names must be ≤64 characters.
Read and write operations must be in separate tools. A single tool accepting both GET and POST/PUT/PATCH/DELETE is rejected — documenting safe vs unsafe within one tool's description does not satisfy this.
Tool descriptions must not instruct Claude how to behave (e.g. "always do X", "you must call Y first", overriding system instructions, promoting products) — treated as prompt injection at review.
Tools that accept freeform API endpoints/params must reference the target API's documentation in their description.
Descriptions
The description is the contract. It's the only thing Claude reads before deciding whether to call the tool. Write it like a one-line manpage entry plus disambiguating hints.
Good
search_issues — Search issues by keyword across title and body. Returns up
to `limit` results ranked by recency. Does NOT search comments or PRs —
use search_comments / search_prs for those.Says what it does
Says what it returns
Says what it doesn't do (prevents wrong-tool calls)
Bad
search_issues — Searches for issues.Claude will call this for anything vaguely search-shaped, including things it can't do.
Disambiguate siblings
When two tools are similar, each description should say when to use the other one:
get_user — Fetch a user by ID. If you only have an email, use find_user_by_email.
find_user_by_email — Look up a user by email address. Returns null if not found.Parameter schemas
Tight schemas prevent bad calls. Every constraint you express in the schema is one fewer thing that can go wrong at runtime.
| Instead of | Use |
|---|---|
z.string() for an ID | z.string().regex(/^usr_[a-z0-9]{12}$/) |
z.number() for a limit | z.number().int().min(1).max(100).default(20) |
z.string() for a choice | z.enum(["open", "closed", "all"]) |
| optional with no hint | .optional().describe("Defaults to the caller's workspace") |
Describe every parameter. The .describe() text shows up in the schema Claude sees. Omitting it is leaving money on the table.
{
query: z.string().describe("Keywords to search for. Supports quoted phrases."),
status: z.enum(["open", "closed", "all"]).default("open")
.describe("Filter by status. Use 'all' to include closed items."),
limit: z.number().int().min(1).max(50).default(10)
.describe("Max results. Hard cap at 50."),
}Return shapes
Claude reads whatever you put in content[].text. Make it parseable.
Do:
Return JSON for structured data (
JSON.stringify(result, null, 2))Return short confirmations for mutations (
"Created issue #123")Include IDs Claude will need for follow-up calls
Truncate huge payloads and say so (
"Showing 10 of 847 results. Refine the query to narrow down.")
Don't:
Return raw HTML
Return megabytes of unfiltered API response
Return bare success with no identifier (
"ok"after a create — Claude can't reference what it made)
How many tools?
| Tool count | Guidance |
|---|---|
| 1–15 | One tool per action. Sweet spot. |
| 15–30 | Still workable. Audit for near-duplicates that could merge. |
| 30+ | Switch to search + execute. Optionally promote the top 3–5 to dedicated tools. |
The ceiling isn't a hard protocol limit — it's context-window economics. Every tool schema is tokens Claude spends every turn. Thirty tools with rich schemas can eat 3–5k tokens before the conversation even starts.
Errors
Return MCP tool errors, not exceptions that crash the transport. Include enough detail for Claude to recover or retry differently.
if (!item) {
return {
isError: true,
content: [{
type: "text",
text: `Item ${id} not found. Use search_items to find valid IDs.`,
}],
};
}The hint ("use search_items…") turns a dead end into a next step.
Tool annotations
Hints the host uses for UX — red confirm button for destructive, auto-approve for readonly. All default to unset (host assumes worst case).
| Annotation | Meaning | Host behavior |
|---|---|---|
readOnlyHint: true | No side effects | May auto-approve |
destructiveHint: true | Deletes/overwrites | Confirmation dialog |
idempotentHint: true | Safe to retry | May retry on transient error |
openWorldHint: true | Talks to external world (web, APIs) | May show network indicator |
server.registerTool("delete_file", {
description: "Delete a file",
inputSchema: { path: z.string() },
annotations: { destructiveHint: true, idempotentHint: false },
}, handler);@mcp.tool(annotations={"destructiveHint": True, "idempotentHint": False})
def delete_file(path: str) -> str:
...Pair with the read/write split advice in build-mcpb/references/local-security.md — mark every read tool readOnlyHint: true.
Structured output
JSON.stringify(result) in a text block works, but the spec has first-class typed output: outputSchema + structuredContent. Clients can validate.
server.registerTool("get_weather", {
description: "Get current weather",
inputSchema: { city: z.string() },
outputSchema: { temp: z.number(), conditions: z.string() },
}, async ({ city }) => {
const data = await fetchWeather(city);
return {
content: [{ type: "text", text: JSON.stringify(data) }], // backward compat
structuredContent: data, // typed output
};
});Always include the text fallback — not all hosts read structuredContent yet.
Content types beyond text
Tools can return more than strings:
| Type | Shape | Use for |
|---|---|---|
text | { type: "text", text: string } | Default |
image | { type: "image", data: base64, mimeType } | Screenshots, charts, diagrams |
audio | { type: "audio", data: base64, mimeType } | TTS output, recordings |
resource_link | { type: "resource_link", uri, name?, description? } | Pointer — client fetches later |
resource (embedded) | { type: "resource", resource: { uri, text|blob, mimeType } } | Inline the full content |
resource_link vs embedded: link for large payloads or when the client might not need it (let them decide). Embed when it's small and always needed.
Requirements and compatibility
Written for: Claude Code, Claude apps
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs network access, Needs an API key, Needs Node.js
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Anthropic
- Publisher
- Anthropic (Official)
- Source
- anthropics/claude-plugins-official · plugins/mcp-server-dev/skills/build-mcp-server · commit 0412be7
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from plugins/mcp-server-dev/LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Anthropic.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download build-mcp-server.zip