About this skill
Build an MCP Server
An MCP server lets Claude Code, Codex, Cursor and other agents call your API, database or internal tool directly. Getting one to run takes an afternoon. Getting a model to use it well is harder: vague tool names, a schema that accepts anything, errors the model cannot act on, a result that dumps 40 KB into context. This skill takes your agent through the whole job in seven stages, with the tool design reviewed before any code is written.
How it works. Type /build-an-mcp-server with what the server should wrap and who will use it. The agent asks only what it cannot find in your repo, collects three to five real requests people will make, and proposes 3 to 7 task-shaped tools in a design table: inputs with constraints, what each returns, read-only or destructive, which errors the model can fix. You approve or change the table. Then it scaffolds from a TypeScript or Python starter on the current v2 SDKs, implements one tool at a time, tests with MCP Inspector and a scripted smoke test, checks that a model actually picks the right tool for each real request, writes the client config, and helps you choose stdio or Streamable HTTP for shipping.
What you get. SKILL.md (the seven-stage workflow), references/tool-design-checklist.md (naming, descriptions written for a model, input constraints, error shapes, pagination and truncation, idempotency, destructive-action hints and guards, secrets), references/transports-and-auth.md (stdio vs Streamable HTTP, auth options from a static token to OAuth 2.1, deploy notes for Fly.io and Cloudflare Workers), references/eval-loop.md (Inspector checklist, Inspector CLI and SDK smoke tests, a model tool-choice table), and four templates: typescript-server.md and python-server.md (one tool, one resource, stdio entry point and a test each), and client-config.md (Claude Code, Codex and Cursor entries for stdio and HTTP).
What to change
- Starters: swap the sample task-list domain in the templates for your own system; keep the file layout.
- Limits in the checklist: the 25,000-character result ceiling, 50-record cap for bulk actions and default page size are starting points. Adjust them to your clients.
- Deploy notes: add a section for your own platform (Railway, Render, Kubernetes) next to Fly.io and Cloudflare Workers.
- SDK version: the templates target the v2 SDKs. If your project is pinned to v1, tell the agent; the skill tells it to follow the v1 docs instead.
Checked against
The files follow the Agent Skills SKILL.md format: spec-only frontmatter, name matching the folder, description under 1024 characters. Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and Antigravity read that format from a skills folder. We checked the files against the spec on 2026-11-07, checked by script that every file SKILL.md names exists and every documentation link in the references resolves, and checked the SDK calls in the templates against the official TypeScript SDK (v2.4.0) and Python SDK (v2.3.0) documentation, the MCP specification revision 2026-07-28 and the Claude Code, Codex and Cursor MCP pages. We have not run the starters end to end in production or recorded a test session in each agent. The example output on this page comes from a real run of the skill in Claude Code (Claude Opus) on 2026-11-07 with the request shown under "You say", in a throwaway project; the example shows how far the smoke test got.
How to install
Copy the files/ folder of the download to .agents/skills/build-an-mcp-server/ (Codex, Cursor, Copilot, Gemini CLI, Antigravity) and/or .claude/skills/build-an-mcp-server/ (Claude Code), or download the zip from this page and unpack it there. Start a new agent session and type /build-an-mcp-server followed by what the server should do.
Not affiliated with Anthropic, OpenAI, Cursor (Anysphere), Fly.io or Cloudflare, or the Model Context Protocol project.
