/howtoai-builder:mcp-builderfrom How to AI — Builder
Builds MCP servers agents can actually use: tool design, context-budget-friendly results, actionable errors, transport, and auth. Use when building an MCP server or adding MCP tools.
Ships in How to AI — Builder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
An MCP server has exactly one reader: a model that sees your tool names, descriptions, and schemas — and never your code, your API docs, or your intent.
Almost every bad MCP server is protocol-correct. It fails because the model can't tell which tool to call, or because one call buries the conversation in JSON. So this is interface design, and the only thing that closes the loop is watching a real agent attempt a real task against your server.
Start from jobs, not endpoints. Write down the five to ten things a person would actually ask an agent to do with this service. Those are your tools.
| Signal | Move |
|---|---|
Two tools are always called in sequence (list_users → get_user) | Merge into the one the task needs |
| Answering a common question takes 3+ calls | One get_<thing>_context tool that assembles it |
A tool needs a mode flag to pick between unrelated behaviors | Split into two tools |
| An endpoint exists but no user task needs it | Don't ship it |
Fewer, better tools beat exhaustive coverage. Forty thin endpoint wrappers force the model to plan a sequence you could have done in code — and every one of them sits in the prompt on every request, used or not.
Escape hatch: when the server is a general surface over a large API and the tasks genuinely aren't predictable, ship broad coverage — but then add a discovery or search tool and hold naming rigidly consistent, because tool selection is now the hard problem.
Write it for the model that has to choose, not for the developer reading your repo.
linear_get_issue instead."user_id, not user.
Encode formats, enums, and special query syntax in the parameter description;
the model will not guess your search grammar.Naming: verb-first snake_case with a service prefix. Names are case-sensitive,
must be unique within the server, and are limited to ASCII letters, digits,
underscore, hyphen, and dot (keep them well under 128 chars). Clients aggregate
many servers at once, so a bare search is a collision waiting to happen and
linear_search_issues is not.
Full template with named slots, naming rules, and a worked before/after:
references/tool-design.md — read it before writing any tool.
Every token you return is a token the agent no longer has for reasoning. Returning the raw API payload is the second most common failure after tool sprawl.
file_type over
mime_type, one image URL instead of six sizes. Semantic identifiers measurably
improve retrieval accuracy; opaque IDs are guessed and mistyped.has_more, next cursor/offset, total).response_format: concise | detailed. Concise typically runs about a
third of the tokens; let the agent buy detail when it needs it.outputSchema and return structuredContent for anything
machine-shaped, mirrored as text for compatibility.Two channels, and picking the wrong one costs you a recovery:
isError: true. Clients feed this back to the model so it can self-correct.An error message has three parts: what failed, why, and the next call to make.
Error: 422 Unprocessable Entity is a dead end. Invalid date '03/2024' — use YYYY-MM-DD. This account's earliest record is 2021-01-04. is a retry.
Default: stdio, credentials from environment variables, logs to stderr (stdout is the wire). This covers local and single-user servers, which is most of them.
Escape hatch: streamable HTTP for remote or multi-user servers. Then the server is an OAuth resource server: publish protected-resource metadata, validate that each token was issued for you (audience), answer 401/403 with the scopes the operation actually needs, and never accept or forward a token minted for another service.
State: the protocol core is stateless and request-scoped — there is no session to hang state on, and requests may land on any replica. If a workflow needs continuity, return an explicit opaque handle from a creation tool and accept it as an argument afterward; authorize it on every call, give it a bounded lifetime, and state that lifetime in the creation tool's description.
Long-running work: don't block a call for minutes. Return a job handle the agent can poll, or adopt the Tasks extension where the client supports it.
Transport, auth, and extension details move faster than anything else here. Check
https://modelcontextprotocol.io/specification/latest and your SDK's quickstart
before implementing — including the deprecation list, which currently covers the
legacy HTTP+SSE transport and several older client features.
Runnable skeletons for both SDKs (registration, pagination, truncation, shared
error handler, transports, handles): references/server-skeleton.md.
The Inspector proves the server responds. Only an agent conversation proves it's usable — and unusable servers pass protocol tests.
Write ~10 realistic multi-hop tasks with single verifiable answers, run them through an agent whose only tools are your server, then read the transcripts for where it reached for the wrong tool first, re-called with shuffled arguments, drowned in output, or gave up. Each of those is a description or response-shape bug, not a model problem.
Question-writing rules, the run loop, and what to measure: references/agent-eval.md.
Before that, audit the definitions offline: python3 scripts/lint_tools.py tools.json scores a tools/list dump for thin descriptions, unbounded list
tools, ambiguous pairs, secrets in arguments, and the standing context cost of the
tool list itself. It runs without a server or a network.
print/console.log corrupts stdio. It lands in the JSON-RPC stream
and the failure surfaces as an unexplained client-side parse error.readOnlyHint: true doesn't make a tool
read-only and won't suppress a confirmation prompt. Enforce it in code.has_more or total, it
can't tell whether one more page is worth it — so it stops early or pages
forever. Both look like model failure and neither is.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub rubenhassid1/howtoai-skills --plugin howtoai-builder7 skills in this plugin
/code-reviewReviews someone's code, and handles feedback on yours — intent first, issues ranked by consequence, blocking vs non-blocking labeled. Use for "review this code", "review my PR", "look at this diff", or "how should I respond to this review comment"./debug-systematicallyFinds the root cause of a bug instead of patching symptoms — reproduce, hypothesize, bisect, explain the mechanism. Use for "debug this", "why is this failing", "this test is flaky", "works locally but not in prod", or "I can't figure out why"./git-worktreesRuns work in an isolated git worktree and closes the branch out cleanly. Use for "git worktree", "work on this in isolation", "finish this branch", "clean up my branch", "how do I merge this back", or removing a worktree without losing work./parallel-agentsSplits work across subagents running at once — what genuinely parallelizes, briefing each one cold, verifying what comes back. Use for "run these in parallel", "use subagents", "fan this out", "split this work up", or "delegate these tasks"./test-driven-developmentDrives implementation with the test written before the code — red, green, refactor — and knows when test-first is wrong. Use for "TDD", "write tests first", "test-driven", "add tests for this", "red green refactor", or adding a regression test./webapp-testingDrives a running web app in a browser to prove it works — real user flows, console and network evidence, failure paths, saved proof. Use for "test my app in the browser", "does this actually work", "check the page loads", or "verify the signup flow".Other plugins' skills for the same job