mcp-server-spec

GitHub

用于设计面向AI Agent的MCP服务器规范。将API转化为以任务为中心的少量工具,优化描述、错误处理与安全边界,确保Agent高效准确调用。

exports/openclaw/mcp-server-spec/SKILL.md mohitagw15856/pm-claude-skills

Trigger Scenarios

设计MCP服务器 为产品暴露Agent接口 审查MCP服务器性能问题

Install

npx skills add mohitagw15856/pm-claude-skills --skill mcp-server-spec -g -y
More Options

Non-standard path

npx skills add https://github.com/mohitagw15856/pm-claude-skills/tree/main/exports/openclaw/mcp-server-spec -g -y

Use without installing

npx skills use mohitagw15856/pm-claude-skills@mcp-server-spec

指定 Agent (Claude Code)

npx skills add mohitagw15856/pm-claude-skills --skill mcp-server-spec -a claude-code -g -y

安装 repo 全部 skill

npx skills add mohitagw15856/pm-claude-skills --all -g -y

预览 repo 内 skill

npx skills add mohitagw15856/pm-claude-skills --list

SKILL.md

Frontmatter
{
    "name": "mcp-server-spec",
    "homepage": "https:\/\/mohitagw15856.github.io\/pm-claude-skills\/skill\/mcp-server-spec.html",
    "metadata": {
        "openclaw": {
            "emoji": "🦾"
        }
    },
    "description": "Design an MCP server for a product — the tool surface, auth model, and safety boundaries that make it genuinely usable by AI agents. Use when asked to spec an MCP server, expose a product to agents, design tools for Claude or other MCP clients, or review why an existing MCP server performs badly. Produces a complete server spec: a small task-shaped toolset with agent-tested descriptions, auth and scoping decisions, error design, and an explicit not-exposed list."
}

MCP Server Spec Skill

Every SaaS is shipping an MCP server; most dump their REST API as forty tools and wonder why agents flail. This skill designs the server as what it actually is: a user interface for a non-human user — few tools, task-shaped, with descriptions written for a model deciding under uncertainty.

What This Skill Produces

  • A toolset design: 3-10 tools mapped to agent tasks, not API endpoints
  • Per-tool specs: name, description (the routing surface), parameters, returns, error behaviour
  • Auth & scoping decisions: how credentials flow, what a token can never do
  • An explicit not-exposed list with reasons — the most load-bearing section
  • A test plan: the agent-eval loop that proves the toolset works

Required Inputs

Ask for (if not already provided):

  • The product and what users hire it for (the top 5 jobs, not the feature list)
  • The existing API surface (endpoints or capability list) if one exists
  • Who the agent acts for — the end user's own account? a service account? multi-tenant?
  • The riskiest actions the product supports (deletes, sends, payments, permission changes)

Design Method

  1. Start from agent tasks, not endpoints. List the 5-8 things an agent will actually be asked to do with this product ("file an expense", "find last quarter's report", "summarise ticket history"). Each becomes one tool — even if it spans four API calls internally. An endpoint-mirrored toolset makes the agent do your orchestration; a task-shaped one does it for them.
  2. Keep the toolset small. Every tool dilutes selection accuracy on every call. Target ≤10; past ~15, split into separately-loadable servers by workflow. Merge list/get/search variants behind one tool with parameters where natural.
  3. Write descriptions as routing surfaces. The description is all the model sees when choosing. Formula per tool: what it does (one clause) · when to use it and when to use the sibling tool instead · what it returns. Test: could a model pick correctly between your two closest tools from descriptions alone?
  4. Design returns for context windows. Return the 6 fields an agent needs, not the 60 the API has; include stable IDs for chaining; paginate with explicit has_more; keep any response under ~2k tokens by default with an opt-in for detail.
  5. Make errors instructive. An agent retries what it understands: "date must be YYYY-MM-DD" beats 400 Bad Request. Every error names the parameter at fault and the fix.
  6. Draw the safety boundary. Classify every capability: expose (read/create, low blast radius) · expose gated (destructive/outward-facing — require an explicit confirmation parameter and document that clients should surface approval) · never expose (auth changes, deletes without recovery, bulk exports of other users' data). The never-list ships in the spec with reasons.
  7. Specify auth honestly. OAuth per end user (agent acts as the user, inherits their permissions) vs API key (service account — then per-tool scoping matters more). State token lifetime, revocation, and what happens mid-session on expiry.

Output Format

MCP Server Spec: [product]

Agent jobs served: [the 5-8 tasks] · Tool count: [n] · Auth: [model + scoping]

Tools

Tool Description (as shipped) Key params Returns Risk class

Gated actions: [which tools require confirmation params, and the expected client behaviour]

Never exposed: [capability → reason] (one line each; this list is reviewed like an API contract)

Error design: [the error shape + 3 example messages]

Test plan: [10-15 realistic agent prompts spanning the jobs; run against a real client; a tool whose description gets misselected twice gets rewritten, not documented around]

Quality Checks

  • Every tool maps to an agent task; no tool exists because "the endpoint was there"
  • Any two sibling tools are distinguishable from their descriptions alone
  • Default responses fit comfortably in a context window (≤~2k tokens)
  • Every destructive or outward-facing action is gated or on the never-list
  • Errors name the offending parameter and the fix
  • The spec includes the agent-eval test plan, not just the schema

Anti-Patterns

  • Do not mirror the REST API — 40 endpoint-tools is the #1 way MCP servers fail
  • Do not write descriptions for developers ("wraps the /v2/items endpoint") — write them for a model choosing a tool
  • Do not return full API payloads — context windows are the scarce resource
  • Do not expose destructive actions ungated because "the client will be careful"
  • Do not skip the never-exposed list — an MCP server without one hasn't been threat-modelled
  • Do not ship without running the agent test plan — schema-valid and agent-usable are different properties

Version History

  • 54fad50 Current 2026-07-19 12:25

Same Skill Collection

exports/openclaw/360-feedback-template/SKILL.md
exports/openclaw/401k-plan-decoder/SKILL.md
exports/openclaw/ab-test-planner/SKILL.md
exports/openclaw/ab-test-readout/SKILL.md
exports/openclaw/accessibility-audit/SKILL.md
exports/openclaw/account-plan/SKILL.md
exports/openclaw/acquirer-red-team/SKILL.md
exports/openclaw/ad-copy/SKILL.md
exports/openclaw/aeo-optimizer/SKILL.md
exports/openclaw/agenda-or-cancel/SKILL.md
exports/openclaw/agent-design-review/SKILL.md
exports/openclaw/agent-observability-spec/SKILL.md
exports/openclaw/agent-spec/SKILL.md
exports/openclaw/ai-ethics-review/SKILL.md
exports/openclaw/ai-eval-plan/SKILL.md
exports/openclaw/ai-feature-prd/SKILL.md
exports/openclaw/ai-product-canvas/SKILL.md
exports/openclaw/air-quality/SKILL.md
exports/openclaw/altitude-shifter/SKILL.md
exports/openclaw/ambiguity-resolver/SKILL.md
exports/openclaw/analyst-relations-brief/SKILL.md
exports/openclaw/announcement-card/SKILL.md
exports/openclaw/api-docs-writer/SKILL.md
exports/openclaw/api-test-plan/SKILL.md
exports/openclaw/api-versioning-strategy/SKILL.md
exports/openclaw/apology-letter/SKILL.md
exports/openclaw/architecture-decision-record/SKILL.md
exports/openclaw/architecture-diagram/SKILL.md
exports/openclaw/archive-strategy/SKILL.md
exports/openclaw/assumption-bounty/SKILL.md
exports/openclaw/assumption-mapper/SKILL.md
exports/openclaw/async-update-format/SKILL.md
exports/openclaw/auto-repair-estimate-decoder/SKILL.md
exports/openclaw/autopilot-charter/SKILL.md
exports/openclaw/benefits-decoder/SKILL.md
exports/openclaw/bid-tender-review/SKILL.md
exports/openclaw/board-deck-narrative/SKILL.md
exports/openclaw/board-minutes/SKILL.md
exports/openclaw/board-pre-read/SKILL.md
exports/openclaw/bom-cost-review/SKILL.md
exports/openclaw/bookkeeping-categorization/SKILL.md
exports/openclaw/boolean-search-builder/SKILL.md
exports/openclaw/brag-doc/SKILL.md
exports/openclaw/brainstorming/SKILL.md
exports/openclaw/brief-builder/SKILL.md
exports/openclaw/briefing-note/SKILL.md
exports/openclaw/budget-builder/SKILL.md
exports/openclaw/budget-variance-analysis/SKILL.md
exports/openclaw/bug-diagnosis/SKILL.md
exports/openclaw/bug-report/SKILL.md

Metadata

Files
0
Version
471c606
Hash
ac879a48
Indexed
2026-07-19 12:25

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-29 14:48
浙ICP备14020137号-1 $방문자$