agentleFS
Bruno-Cunha-SouzaBruno-Cunha-Souza/ValarMindSkills/skills/mcp-builder/SKILL.md

mcp-builder

Skill5 starsChanged 6 months agoMITView on GitHub

Build MCP servers — research, implement, test, evaluate. Rust (rmcp, default), TypeScript, or Python. Tool design, strict schemas, pagination, actionable errors, spec 2026-07-28 transports, plus a 10-question evaluation that scores the result. Triggers: 'criar servidor MCP', 'expor essa API como MCP', 'build an MCP server', 'wrap this API as MCP tools', '/mcp-builder'. Not for configuring existing MCP servers.

  • Reads credentials

186 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • Leodorareluctant259Skill

    chinese-commit-conventions

    中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化

    Also in 8 projects that use this

  • ComposioHQSkill

    codebase-migrate

    Run large codebase migrations and multi-file refactors. Uses the Composio CLI to coordinate issue tracking, batched PRs, and CI verification while the agent executes the transforms locally across hundreds of files.

    Also in 5 projects that use this

  • truongtv22Skill

    Problem-Solving Techniques

    Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.

    Also in 5 projects that use this

  • ArogyaReddySkill

    skill-share

    A skill that creates new Claude skills and automatically shares them on Slack using Rube for seamless team collaboration and skill discovery.

    Also in 26 projects that use this

  • AnthropicSkill

    academy-guide

    Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

    Also in 8 projects that use this

  • +2 more from Leodorareluctant259

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 170 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    The SDK — fetch live docs, do not work from memory: Use Context7:

    line 52
  2. Distinctive:

    The target API: Read its documentation: endpoints, authentication, data models, rate limits.

    line 63
  3. Distinctive:

    Follow the language guide for project layout and SDK specifics.

    line 69
  4. Very specific:

    Every list tool respects limit (default 20–50), paginates by offset or cursor, and returns:

    line 104
  5. Distinctive:

    Never load the full result set into memory.

    line 110
  6. Distinctive:

    Never: put secrets in code or committed config — environment variables only.

    line 181
  7. Distinctive:

    Never: treat annotations as a security boundary.

    line 183
  8. Distinctive:

    Never: read the server's source code while generating evaluations — it contaminates the measurement.

    line 184
  9. Distinctive:

    Never: use a write or destructive operation to answer an evaluation question.

    line 185

“Common” is measured: kept by at least 6 in 10 of the 170 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MCP Builder

When to Use

  • Building a new MCP server that exposes an external API or service as tools.
  • Adding tools to an existing MCP server, or reworking a tool surface agents keep misusing.
  • Choosing between comprehensive API coverage and workflow tools for a server design.
  • Evaluating whether an MCP server actually enables the tasks it was built for.

Do not use when

  • Installing, configuring, or connecting to an existing MCP server — that is client setup.
  • Auditing a server for vulnerabilities — use @code-security-review, which covers confused-deputy and token-passthrough patterns.
  • Writing a plain API client with no MCP surface.

Prerequisites

InputRequiredHow to obtain
Target APIYesUser names the service; fetch its docs in Phase 1
Authentication methodYesAPI key, OAuth 2.1, or none — determines Phase 2 client design
LanguageNoDefaults to Rust; see the Phase 0 table
TransportNoDefaults to stdio for local servers, streamable HTTP for remote
Credentials for evaluationNoNeeded only to run Phase 4 against a live service

Quality here is measured by one thing: whether an LLM can accomplish real tasks with the server. Every rule below serves that.

Phase 0 — Scope and language

Inventory the API. List the endpoints worth exposing, most common operations first. Note auth, rate limits, and pagination style.

Coverage beats cleverness. Balance comprehensive endpoint coverage against specialized workflow tools. Workflow tools are convenient for the tasks you predicted; broad coverage lets the agent compose the ones you did not. Performance varies by client — some do better composing basic tools through code execution, others with higher-level workflows. When uncertain, prioritize comprehensive API coverage.

Pick the language:

LanguagePick it whenGuide
Rust (rmcp)Default. Single static binary, no runtime on the host, strict types, spec 2026-07-28 nativereferences/RUST.md
TypeScript (@modelcontextprotocol/sdk)MCPB packaging or npx distribution is required; largest client ecosystemreferences/TYPESCRIPT.md
Python (FastMCP)The target API already ships a Python SDK worth wrapping, or the surrounding codebase is Pythonreferences/PYTHON.md

Phase 1 — Research

The protocol. Current revision is 2026-07-28. Start from the sitemap at https://modelcontextprotocol.io/sitemap.xml and fetch pages with a .md suffix for markdown. Read the transport and tool-definition pages before designing anything.

The SDK — fetch live docs, do not work from memory. Use Context7:

SDKContext7 ID
Rust rmcp (official)/websites/rs_rmcp_rmcp
TypeScript/modelcontextprotocol/typescript-sdk
Python/websites/py_sdk_modelcontextprotocol_io_v2
Protocol spec/modelcontextprotocol/modelcontextprotocol

rust-mcp-sdk and other rmcp-adjacent names in search results are third-party projects, not the official SDK. The official one is modelcontextprotocol/rust-sdk.

The target API. Read its documentation: endpoints, authentication, data models, rate limits. Web search and fetch as needed.

Choose the transport. stdio for local servers, streamable HTTP for remote. The 2026-07-28 revision removed protocol-level sessions and resumable SSE streams — stateless JSON is the shape. Full rules in references/BEST_PRACTICES.md.

Phase 2 — Implement

Follow the language guide for project layout and SDK specifics. The decisions below are the same in all three.

Naming

WhatConvention
Server, Rust and TypeScript{service}-mcp-server
Server, Python{service}_mcp
Tools, all languagessnake_case, service-prefixed, action verb first — github_create_issue, slack_send_message

Prefixes are not decoration: several servers load into one client, and send_message collides.

Tool descriptions

The description is the agent's only view of the tool. Each one states what the tool does and does not do, every parameter, the return schema, two or three use/don't-use examples, and the error strings the agent should expect. Descriptions must precisely match actual functionality — one that overpromises is worse than a missing tool, because the agent picks it and fails.

Annotations

Set all four on every tool.

AnnotationDefaultMeaning
readOnlyHintfalseDoes not modify its environment
destructiveHinttruePerforms destructive updates
idempotentHintfalseRepeated calls add no further effect
openWorldHinttrueInteracts with external entities

Omitting them declares a destructive, non-idempotent, open-world tool. They are hints, not security guarantees — enforce read-only-ness in the implementation, never in the metadata.

Schemas

Validate every input with the language's schema library — schemars (Rust), Zod (TypeScript), Pydantic (Python) — in strict mode, so a misspelled parameter fails loudly instead of being silently dropped. Declare an output schema wherever the tool returns structured data, and return both surfaces: text for the agent to read, structured content for the client to process.

Pagination

Every list tool respects limit (default 20–50), paginates by offset or cursor, and returns:

{ "total": 150, "count": 20, "offset": 0, "items": [], "has_more": true, "next_offset": 20 }

Never load the full result set into memory. Truncate oversized responses against a character limit with a message telling the agent how to narrow the query — silently flooding its context is the failure this prevents.

Errors

Tool failures go inside the result (isError / an error result), never as a protocol error. A protocol error kills the call; a result error lets the agent read it and adapt. Every message names a next step and leaks nothing internal.

Bad:   "Error: request failed"
Bad:   "Error: HTTPError 429 at /internal/svc/rates.py:88"
Good:  "Error: rate limit exceeded. Retry after 30s, or narrow the query with filter='active_only'."

Security

  • Secrets from environment variables only, validated at startup.
  • Sanitize file paths against traversal; validate URLs and external identifiers; never interpolate arguments into a shell command.
  • OAuth 2.1: validate tokens before processing, and accept only tokens minted for your server. A token issued for another audience that your server honours is the confused-deputy hole.
  • Streamable HTTP served locally: validate the Origin header, bind to 127.0.0.1 not 0.0.0.0, enable DNS rebinding protection.
  • stdio writes nothing to stdout but protocol frames. Logging goes to stderr. One stray println!/console.log/print desynchronizes the stream and the client dies on a parse error that names nothing.

Phase 3 — Review and test

Review for duplicated request/format code, inconsistent error handling, incomplete type coverage, and vague tool descriptions. Then build and inspect:

# Rust
cargo build --release && cargo clippy --all-targets --all-features -- -D warnings
npx @modelcontextprotocol/inspector cargo run

# TypeScript
npm run build && node dist/index.js --help
npx @modelcontextprotocol/inspector node dist/index.js

# Python
python -m py_compile src/<service>_mcp/server.py
npx @modelcontextprotocol/inspector uv run python -m <service>_mcp

# Any language, server already running over HTTP
mcp-inspector --server-url http://127.0.0.1:8000/mcp --transport http \
  --header "Authorization: Bearer $TOKEN"

Confirm in the Inspector that every tool appears with the annotations you set. Work the language guide's quality checklist before moving on.

Phase 4 — Evaluate

The only phase that measures whether the server does its job. Full rules, examples, and the good/poor question catalog: references/EVALUATION.md.

  1. Inspect the tools — schemas and descriptions only, calling nothing, reading no source code.
  2. Explore the data with read-only, non-destructive calls until you find content concrete enough to build questions around.
  3. Write 10 questions: independent, read-only, multi-hop, realistic, stable over time, each with a single answer verifiable by string comparison. No keywords copied from the target content.
  4. Solve each one yourself to establish the answer key; drop any that turned out to need a write.
  5. Write evaluation.xml:
<evaluation>
  <qa_pair>
    <question>...</question>
    <answer>3</answer>
  </qa_pair>
</evaluation>
  1. Run it — answer all 10 using only the server's tools, without consulting the answer key, then compare.

Acceptance is 8 of 10. Report the score and the cause of every miss: which tool was not found, which description misled, which response was truncated. A score without diagnosis is a number; a score with causes is the Phase 2 fix list.

Constraints

  • Never log to stdout on the stdio transport.
  • Never return a tool failure as a protocol error when it can go in the result object.
  • Never put secrets in code or committed config — environment variables only.
  • Never adopt the deprecated HTTP+SSE transport (2024-11-05) in a new server.
  • Never treat annotations as a security boundary.
  • Never read the server's source code while generating evaluations — it contaminates the measurement.
  • Never use a write or destructive operation to answer an evaluation question.
  • Must set all four annotations on every tool.
  • Must validate every input with a strict schema at the trust boundary.
  • Must implement pagination on every list-returning tool.
  • Must name tools snake_case with a service prefix.
  • Must make every error message actionable and free of internal detail.

Output format

Deliver, in this order:

  1. Tool inventory — one line per tool: name, what it does, annotations.
  2. The server — source, following the language guide's layout.
  3. Build proof — the actual command output showing a clean build and lint.
  4. evaluation.xml — the 10 verified question/answer pairs.
  5. Evaluation result — score out of 10, and for each miss the specific cause.
  6. Gaps — endpoints deliberately not exposed, and why.

Example request

  • "Criar um servidor MCP para a API do Linear"
  • "Build an MCP server that exposes our internal orders API"
  • "Expor essa API como tools MCP, em Rust"
  • "Add a search tool to my existing MCP server and re-run the evaluation"
  • "/mcp-builder"

Related Skills

  • @code-security-review — audits an MCP server for vulnerabilities; this skill builds one.
  • @prompt-engineering — a tool description is a prompt; use it to harden vague ones.
  • @clean-code / @code-review — code quality after Phase 2.
  • @ci-cd-generator — pipeline for the new server.
  • @github-commit — commit conventions.

References

  • BEST_PRACTICES — language-agnostic rules: naming, annotations, pagination, transports, security, errors
  • RUST — rmcp implementation guide (default language) + quality checklist
  • TYPESCRIPT — @modelcontextprotocol/sdk implementation guide + quality checklist
  • PYTHON — FastMCP implementation guide + quality checklist
  • EVALUATION — Phase 4 in full: question rules, process, examples, scoring

Attribution

Based on anthropics/skills/skills/mcp-builder (Apache 2.0 license). This skill ports the four-phase lifecycle, the MCP best-practices catalog, the language implementation guides, and the evaluation methodology to the ValarMindSkills format.

Three deliberate departures from upstream. Rust is added and made the default — upstream covers only Python and TypeScript and recommends TypeScript; rmcp reaches the same tool surface with a single static binary, and references/RUST.md has no upstream equivalent. The Python evaluation harness (scripts/evaluation.py, connections.py) was not ported — scripts/ inside a skill is an anti-pattern in this repository, and the harness would add a Python dependency plus an ANTHROPIC_API_KEY to run a loop the invoking agent already performs; Phase 4 runs through the agent instead. Transport guidance was rewritten for protocol revision 2026-07-28, which removed protocol-level sessions and resumable SSE streams; upstream's guides still describe stateful sessions and the deprecated HTTP+SSE transport.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.