Mcp builder

From softspark/ai-toolkit · View interactive version

Mcp builder is an AI agent skill from the GitHub repository softspark/ai-toolkit. Builds production MCP servers via 4-phase methodology: research, implement, test, evaluate. Triggers: build MCP, new MCP, MCP integration, MCP server scaffold.

How to use this skill

Skill file

MCP Builder

$ARGUMENTS

Build a production-grade MCP server following Anthropic's 4-phase methodology.

When to Use

For MCP protocol theory, see mcp-patterns knowledge skill (auto-loaded).

4-Phase Workflow

Phase 1 — Research & Planning

  1. Read the target API's documentation (OpenAPI spec, README, changelog).
  2. Identify the 5-15 most useful operations. Prefer workflow-oriented tools over 1:1 API mirror.
  3. Decide transport: stdio for local dev tools, streamable-http for remote/shared.
  4. Decide language: TypeScript recommended (best SDK), Python acceptable (mcp package).
  5. List required secrets (API keys, tokens) and their env var names.

Output: PLAN.md with tool list, transport choice, auth model.

Phase 2 — Implementation

Scaffold:

my-mcp/
├── package.json         # or pyproject.toml
├── src/
│   ├── server.ts        # entry point
│   ├── client.ts        # API client (axios/httpx)
│   ├── tools/           # one file per tool
│   ├── schemas.ts       # Zod/Pydantic schemas
│   └── errors.ts        # typed errors
├── .env.example
└── README.md

Per tool:

Phase 3 — Review & Testing

```bash

npx @modelcontextprotocol/inspector node dist/server.js

```

Phase 4 — Evaluation

Write 10 realistic end-user questions that an LLM should be able to answer using your server. Run them through Claude with the server attached. Grade: did the model call the right tool? Did the response give enough to answer? Fix the description, schema, or response format of any tool that failed.

Example eval questions for a github-mcp:

  1. "What issues are open on repo X with label bug?"
  2. "Create an issue titled Y in repo Z"
  3. "Who has the most commits this month in repo X?"

When a tool fails an eval, the cause is almost always the description, not the schema. Score each tool against the description rubric in mcp-patterns (one-line purpose, WHEN TO USE, WHEN NOT TO USE, CRITICAL, self-test). A tool with an empty WHEN NOT TO USE is under-specified — it will misfire the moment a second tool in the same server overlaps with it, so add the boundary before re-running the eval. See mcp-patterns → "How to Write a Tool Description" for the full rubric and worked example.

Tool Design Checklist

Transport Cheat Sheet

| Scenario | Transport |

|----------|-----------|

| Local dev tool, 1 user | stdio |

| Remote server, multiple users | streamable-http with SSE |

| Internal company tool, auth required | streamable-http + OAuth proxy |

| Embedded in IDE/editor | stdio spawned by editor |

Registration Cheat Sheet

Local Claude Code (.mcp.json):

{
  "mcpServers": {
    "my-mcp": {
      "command": "node",
      "args": ["dist/server.js"],
      "env": { "API_KEY": "$MY_API_KEY" }
    }
  }
}

Global Claude Code (user-scope):

claude mcp add my-mcp --scope user -- node /path/to/server.js

Claude Desktop: same JSON, placed in ~/Library/Application Support/Claude/claude_desktop_config.json (macOS).

Common Pitfalls

| Mistake | Fix |

|---------|-----|

| 1:1 API mirror with 80 tools | Pick 10 workflow-oriented tools |

| description: "wrapper for /users endpoint" | description: "Find users by email, role, or team. Use when the user mentions employees, staff, or access" |

| Dumping raw JSON responses | Filter to 3-5 fields the agent actually needs |

| Logging API keys on error | Redact all env vars in error formatters |

| exit 1 on transient errors | Retry with exponential backoff, surface final error |

| Stdout pollution (MCP stdio) | All logs go to stderr, stdout is JSON-RPC only |

Rules

Gotchas

When NOT to Use

Related

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.