Build, iterate, and evaluate Model Context Protocol (MCP) servers that expose external services as tools an LLM can call. Use when asked to "build an MCP server", "create an MCP tool", "wrap this API as MCP", "expose X to Claude", or when extending GSD with custom tool integrations. Covers research, schema/tool design, error handling, pagination, testing via MCP Inspector, and producing a 10-question eval set that proves the server actually enables real work.
68
81%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Invocation points:
/gsd mcp init scaffolds config but there's a tool integration to build<core_principle> THE QUALITY METRIC IS TASK COMPLETION, NOT SCHEMA VALIDITY. A server that lists 30 tools with cryptic names and empty descriptions passes the protocol but fails the point. The tool description is the only thing an LLM has to decide whether to call it — write it like documentation for a stranger under time pressure.
DESIGN FOR THE MODEL, NOT THE API. A raw REST endpoint is rarely the right tool. Group, filter, and pre-shape responses so the model gets what it needs to reason, not a 40KB JSON blob it has to summarize. Fewer, deeper tools beat many, shallow ones. </core_principle>
Skeleton:
server/
src/
index.ts # MCP entry point — stdio or sse transport
client.ts # API client with auth, retries, typed errors
tools/ # one file per tool, or grouped by domain
pagination.ts # shared cursor handling
errors.ts # MCP-friendly error formatting
package.json # @modelcontextprotocol/sdk as dep
tsconfig.json
README.md # how to run, env vars, rate-limit notes
evals.xml # 10 eval questions (Phase 4)Core infrastructure goes first: API client with typed errors, pagination helpers, consistent retry/timeout behavior. Do not inline these per tool.
For each tool:
search_issues, get_customer, create_deployment. Not do_thing or api_v2_post.cursor: abc123 to continue."Write 10 evaluation questions in evals.xml that exercise the server end-to-end. Each question should require 2+ tool calls and at least one decision the model has to make based on earlier output. Cover:
Format:
<evals>
<eval id="1">
<question>...user request...</question>
<expected>...concrete observable answer or tool-call sequence...</expected>
</eval>
</evals>Run the evals. If the model can't complete them, the server — not the model — needs work. Iterate on descriptions, error messages, and tool granularity.
Write the project's .mcp.json entry using /gsd mcp init as a starting point. Document env vars and startup in README.md. If the server is globally useful, suggest the user file it as a durable skill via spike-wrap-up or publish it.
<anti_patterns>
{"error": "500"} is useless. Translate.</anti_patterns>
<success_criteria>
evals.xml has 10 questions; the model completes ≥8 without handholding..mcp.json entry.</success_criteria>
33c00aa
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.