mcp-builder

mcp-builder is a skill for Claude Code from Leodorareluctant259/superpowers-zh. It costs 32 tokens per session (2,185 once invoked), scanned A, a copy of mcp-builder, MIT.

A guide to building MCP servers, which let AI assistants call tools or read connected data. It covers server structure, tool design, validation, testing and deployment in TypeScript and Python.

In plain words
What is it for?
Use it when designing or implementing an MCP server, including its folders, tool names, parameters, dependencies and tests.
Why use it?
It provides practical decisions for turning an outside capability into clearly defined assistant tools, resources or prompts.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is npx @modelcontextprotocol/inspector node dist/index.js.

Part of the superpowers-zh plugin — 20 skills, 3 commands, 1 agent, 1 hook shipped together

Good fit Use it when designing or implementing an MCP server, including its folders, tool names, parameters, dependencies and tests.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Leodorareluctant259/superpowers-zh
agentmods
npx agentmods add skills/leodorareluctant259/superpowers-zh/mcp-builder

Made for: Claude Code.

Or install superpowers-zh, the plugin that ships this one along with the rest of its 20 skills, 3 commands, 1 agent, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/leodorareluctant259/superpowers-zh/mcp-builder/github.svg)](https://agentmods.dev/skills/leodorareluctant259/superpowers-zh/mcp-builder)
Your own site
<a href="https://agentmods.dev/skills/leodorareluctant259/superpowers-zh/mcp-builder"><img src="https://agentmods.dev/badge/skills/leodorareluctant259/superpowers-zh/mcp-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/leodorareluctant259/superpowers-zh/mcp-builder"><img src="https://agentmods.dev/badge/skills/leodorareluctant259/superpowers-zh/mcp-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,185 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.02185
Opus 5 $0.00016 $0.01092
Sonnet 5 $0.00006 $0.00437
Haiku 4.5 $0.00003 $0.00218

Measured 10d ago against content hash 7306ea27d858, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

mcp-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to mcp-builder — 7 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/mcp-builder/SKILL.md · 256 lines

How it starts

The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MCP 服务器构建

系统化设计、实现、测试和部署 Model Context Protocol 服务器的方法论。

1. 协议核心概念

MCP 定义三种原语:

  • Tools(工具):AI 助手主动调用的函数,有副作用。如搜索、创建、删除操作。
  • Resources(资源):AI 助手只读访问的数据源,用 URI 标识。如 users://{id}/profile
  • Prompts(提示词模板):预定义交互模板,引导用户触发工作流。

选择原则: 执行操作 → Tool | 读取数据 → Resource | 引导交互 → Prompt

2. 项目结构规范

TypeScript

my-mcp-server/
├── src/
│   ├── index.ts          # 入口,注册 tools/resources
│   ├── tools/             # 按功能拆分
│   ├── resources/
│   └── lib/               # 客户端封装、校验逻辑
├── tests/
├── package.json
└── tsconfig.json

关键依赖:@modelcontextprotocol/sdk + zod

Python

my-mcp-server/
├── src/my_mcp_server/
│   ├── server.py
│   ├── tools/
│   └── lib/
├── tests/
└── pyproject.toml

关键依赖:mcp + pydantic

3. Tool 设计原则

命名

  • snake_case 格式,动词开头:search_userscreate_issuedelete_file
  • 名称自解释,AI 助手靠名称选工具,模糊命名导致误调用

参数

  • 每个参数有类型约束和 .describe() 描述
  • 可选参数给默认值,减少 AI 决策负担
  • 用枚举代替布尔开关
server.tool("search_issues", {
  query: z.string().describe("搜索关键词"),
  status: z.enum(["open", "closed", "all"]).default("open").describe("状态筛选"),
  limit: z.number().min(1).max(100).default(20).describe("返回上限"),
}, async ({ query, status, limit }) => { /* ... */ });

描述

说明用途 + 返回内容 + 限制,这是 AI 选择工具的关键依据:

server.tool("search_users",
  "根据姓名或邮箱搜索用户。返回 ID、姓名、邮箱列表。模糊匹配,最多 50 条。",
  schema, handler);

输出

  • 结构化数据 → JSON,人类可读内容 → Markdown
  • 始终用 content: [{ type: "text", text: "..." }] 格式返回

4. 输入验证和错误处理

用 Zod/Pydantic 做 Schema 级校验,业务级校验放 handler 开头:

server.tool("get_user", { id: z.string() }, async ({ id }) => {
  try {
    const user = await db.getUser(id);
    if (!user) {
      return {
        content: [{ type: "text", text: `用户 ${id} 不存在,请检查 ID。` }],
        isError: true,
      };
    }
    return { content: [{ type: "text", text: JSON.stringify(user, null, 2) }] };
  } catch (err) {
    return {
      content: [{ type: "text", text: `查询失败:${err.message}` }],
      isError: true,
    };
  }
});

Read the full file on GitHub · 256 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 256 lines · 32 tokens per session scan A 7306ea27d858

Subscribe to this mod's changes

mcp-builder is a skill published in the GitHub repository Leodorareluctant259/superpowers-zh (5 stars, last pushed 2d ago), licensed MIT. It adds 32 tokens to every session and 2,185 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to mcp-builder, differing in 7 lines, and is treated as a copy.

Related

Other skills, from other repositories

agents-sdk

Build, debug, or review Cloudflare Agents SDK applications using the agents package.

fcakyon/claude-codex-settings · 19 tokens

supabase-cli

This skill should be used when user asks to "use supabase CLI", "supabase init", "supabase start", "run migrations", "deploy edge functions", "manage Supabase project", or works with the supabase command-line tool for local development and project management.

fcakyon/claude-codex-settings · 60 tokens

supabase-js

This skill should be used when user asks to "use supabase-js", "query Supabase database", "supabase auth", "supabase storage", "supabase realtime", "supabase edge functions", or works with the @supabase/supabase-js JavaScript/TypeScript SDK.

fcakyon/claude-codex-settings · 64 tokens

durable-objects

Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

fcakyon/claude-codex-settings · 22 tokens

openobserve-api

This skill should be used when user asks to "query OpenObserve", "create OpenObserve dashboard", "edit OpenObserve panel", "fetch OpenObserve logs", "run OpenObserve search", "list OpenObserve streams", "ingest into OpenObserve", or works with OpenObserve Cloud / self-hosted via REST API. Covers auth, search/SQL…

fcakyon/claude-codex-settings · 108 tokens

lov-optimize-tauri-backend

Optimize Tauri backend architecture and development ergonomics for Tauri 2 apps, especially Rust restart pain, oversized src-tauri/src/lib.rs files, excessive #[tauri::command] surfaces, stringly invoke APIs, long IPC streams, and dev-state recovery. Use when the user asks about Tauri hot reload, Rust-side restarts…

lovstudio/skills · 125 tokens