mcp-builder
Skill88 starsChanged 7 months agoMITView on GitHub
Build Model Context Protocol servers from specifications. Use when creating an MCP server for a tool, resource, or service that AI agents should access. Generates tool definitions, resource handlers, and test suites in TypeScript or Python (FastMCP).
- Reads credentials
193 other projects use a version of this.
Adopted by
Most recently taken up by
- magicpro97/vibeflowtheir own version, first seen Oct 4, 2026
- IGTA-Tech/claude-skills-researchtheir own version, first seen Oct 3, 2026
- delorenj/skillstheir own version, first seen Oct 2, 2026
- basher83/Zammad-MCPtheir own version, first seen Oct 1, 2026
- BrightGold70/skillstheir own version, first seen Sep 29, 2026
- databricks/devhubtheir own version, first seen Sep 28, 2026
Used with
Projects with it also use skill-share, meeting-insights-analyzer 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.
ArogyaReddySkillskill-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 20 projects that use this
ArogyaReddySkillmeeting-insights-analyzer
Analyzes meeting transcripts and recordings to uncover behavioral patterns, communication insights, and actionable feedback. Identifies when you avoid conflict, use filler words, dominate conversations, or miss opportunities to listen. Perfect for professionals seeking to improve their communication and leadership skills.
Also in 27 projects that use this
JetBrainsSkillslack-gif-creator
Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack.
Also in 100 projects that use this
mrgoonieSkillai-multimodal
Process and generate multimedia content using Google Gemini API. Capabilities include analyze audio files (transcription with timestamps, summarization, speech understanding, music/sound analysis up to 9.5 hours), understand images (captioning, object detection, OCR, visual Q&A, segmentation), process videos (scene detection, Q&A, temporal analysis, YouTube URLs, up to 6 hours), extract from documents (PDF tables, forms, charts, diagrams, multi-page), generate images (text-to-image, editing, composition, refinement). Use when working with audio/video files, analyzing images or screenshots, processing PDF documents, extracting structured data from media, creating images from text prompts, or implementing multimodal AI features. Supports multiple models (Gemini 2.5/2.0) with context windows up to 2M tokens.
Also in 5 projects that use this
GoogleSkillalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Also in 87 projects that use this
bkootazSkillartifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
Also in 36 projects that use this
- +4 more from ArogyaReddy
Other versions193 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 193
- anthropics/skills★ 199ksame name
- shareAI-lab/learn-claude-code★ 78ksame name
- ComposioHQ/awesome-claude-skills★ 77ksame name
- activepieces/activepieces★ 25ksame name
- composio-community/awesome-codex-skills★ 17ksame name
- mcp-use/mcp-use★ 11ksame name
- jnMetaCode/superpowers-zh★ 8.3ksame name
- SynkraAI/aiox-core★ 3.1ksame name
- microsoft/skills★ 3.1ksame name
- mrgoonie/claudekit-skills★ 2.2ksame name
183 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository67 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adversarySkill
- asset-creatorSkill
- auditSkill
- autopsySkill
- baSkill
- brainstormSkill
- browser-pilotSkill
- completion-gateSkill
- constraint-checkSkill
- context-engineSkill
- context-packSkill
- convergeSkill
- cookSkill
- councilSkill
- dbSkill
- debugSkill
- dependency-doctorSkill
- deploySkill
- designSkill
- diagramSkill
- doc-processorSkill
- docs-seekerSkill
- docsSkill
- fixSkill
- gitSkill
- graftSkill
- hallucination-guardSkill
- improve-architectureSkill
- incidentSkill
- integrity-checkSkill
- journalSkill
- launchSkill
- logic-guardianSkill
- marketingSkill
- neural-memorySkill
- onboardSkill
- perfSkill
- planSkill
- preflightSkill
- problem-solverSkill
- quarantineSkill
- rescueSkill
- researchSkill
- retroSkill
- review-intakeSkill
- reviewSkill
- safeguardSkill
- sastSkill
- scaffoldSkill
- scope-guardSkill
- scoutSkill
- sentinel-envSkill
- sentinelSkill
- sequential-thinkingSkill
- session-bridgeSkill
- skill-forgeSkill
- skill-routerSkill
- slidesSkill
- surgeonSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 14 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 180 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
If description is detailed enough (tools, resources, target API specified), proceed.
- Distinctive: line 45
If vague, ask targeted questions:
- Distinctive: line 53
If user provides a detailed spec or existing API docs → extract answers, confirm.
- Distinctive: line 149
Read handler that returns structured content
- Very specific: line 181
Before generating tests, classify every tool as query or mutation:
- Very specific: line 190
Add safety metadata to each tool definition:
- Very specific: line 223
Document the safety classification in the README tool catalog (add a 🔒 badge on mutation tools).
- Distinctive: line 284
Ensure all tools respond correctly
- Distinctive: line 285
Ensure configuration validation works
- Distinctive: line 328
When the MCP server needs to call multiple AI providers (e.g., both Anthropic and OpenAI), use the Provider Adapter pattern to normalize …
- Distinctive: line 380
MUST validate all tool inputs with Zod (TS) or Pydantic (Python) — never trust AI-provided inputs
- Distinctive: line 381
MUST handle API errors gracefully — return MCP error responses, don't crash the server
- Distinctive: line 382
MUST generate .env.example — never hardcode API keys or secrets
- Distinctive: line 383
MUST generate tests — no MCP server without test suite
- Distinctive: line 384
MUST generate installation docs for at least Claude Code — other IDEs are bonus
- Distinctive: line 385
MUST use official MCP SDK (@modelcontextprotocol/sdk for TS, fastmcp for Python)
- Distinctive: line 405
Test suite generated (happy path, validation, errors, edge cases)
“Common” is measured: kept by at least 6 in 10 of the 180 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.
Files
mcp-builder
Purpose
MCP server builder. Generates complete, tested MCP servers from a natural language description or specification. Handles tool definitions, resource handlers, input validation, error handling, configuration, tests, and documentation. Supports TypeScript (official SDK) and Python (FastMCP).
Triggers
- Called by
cookwhen MCP-related task detected (keywords: "MCP server", "MCP tool", "model context protocol") - Called by
scaffoldwhen MCP Server template selected /rune mcp-builder <description>— manual invocation- Auto-trigger: when project contains
mcp.json,@modelcontextprotocol/sdk, orfastmcpin dependencies
Calls (outbound)
ba(L2): if user description is vague — elicit requirements for what tools/resources the server should exposeresearch(L3): look up target API documentation, existing MCP servers for referencetest(L2): generate and run test suite for the serverdocs(L2): generate server documentation (tool catalog, installation, configuration)verification(L3): verify server builds and tests pass
Called By (inbound)
cook(L1): when MCP-related task detectedscaffold(L1): MCP Server template in Phase 5- User:
/rune mcp-builderdirect invocation
Executable Steps
Step 1 — Spec Elicitation
If description is detailed enough (tools, resources, target API specified), proceed. If vague, ask targeted questions:
- What tools should this MCP server expose? (actions the AI can perform)
- What resources does it manage? (data the AI can read)
- What external APIs does it connect to? (if any)
- TypeScript or Python? (default: TypeScript with @modelcontextprotocol/sdk)
- Authentication? (API keys, OAuth, none)
If user provides a detailed spec or existing API docs → extract answers, confirm.
Step 2 — Architecture Design
<MUST-READ path="references/auto-discovery-pattern.md" trigger="when the server has 5+ tools OR multiple API providers — use auto-discovery registry for graceful degradation"/>Determine server structure based on spec:
TypeScript (default):
mcp-server-<name>/
├── src/
│ ├── index.ts — server entry point, tool/resource registration
│ ├── tools/
│ │ ├── <tool-name>.ts — one file per tool
│ │ └── index.ts — tool registry
│ ├── resources/
│ │ ├── <resource>.ts — one file per resource type
│ │ └── index.ts — resource registry
│ ├── lib/
│ │ ├── client.ts — external API client (if applicable)
│ │ └── types.ts — shared types
│ └── config.ts — environment variable validation
├── tests/
│ ├── tools/
│ │ └── <tool-name>.test.ts
│ └── resources/
│ └── <resource>.test.ts
├── package.json
├── tsconfig.json
├── .env.example
└── README.mdPython (FastMCP):
mcp-server-<name>/
├── src/
│ ├── server.py — FastMCP server with tool/resource decorators
│ ├── tools/
│ │ └── <tool_name>.py
│ ├── resources/
│ │ └── <resource>.py
│ ├── lib/
│ │ ├── client.py — external API client
│ │ └── types.py — Pydantic models
│ └── config.py — settings via pydantic-settings
├── tests/
│ ├── test_<tool_name>.py
│ └── test_<resource>.py
├── pyproject.toml
├── .env.example
└── README.mdStep 3 — Generate Server Code
Tool Generation
For each tool:
TypeScript:
import { z } from 'zod';
export const toolName = {
name: 'tool_name',
description: 'What this tool does — used by AI to decide when to call it',
inputSchema: z.object({
param1: z.string().describe('Description for AI'),
param2: z.number().optional().describe('Optional parameter'),
}),
async handler(input: { param1: string; param2?: number }) {
// Implementation
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
},
};Python (FastMCP):
from fastmcp import FastMCP
mcp = FastMCP("server-name")
@mcp.tool()
async def tool_name(param1: str, param2: int | None = None) -> str:
"""What this tool does — used by AI to decide when to call it."""
# Implementation
return json.dumps(result)Resource Generation
For each resource:
- URI template with parameters
- Read handler that returns structured content
- List handler for collections
Configuration
Generate .env.example with all required environment variables:
# Required
API_KEY=your_api_key_here
API_BASE_URL=https://api.example.com
# Optional
LOG_LEVEL=info
CACHE_TTL=300Generate config validation:
// config.ts
import { z } from 'zod';
const envSchema = z.object({
API_KEY: z.string().min(1, 'API_KEY is required'),
API_BASE_URL: z.string().url().default('https://api.example.com'),
LOG_LEVEL: z.enum(['debug', 'info', 'warn', 'error']).default('info'),
});
export const config = envSchema.parse(process.env);Step 3.5 — Tool Safety Classification
Before generating tests, classify every tool as query or mutation:
| Category | Examples | Behavior |
query | read, list, search, get, fetch | Auto-approve — no confirmation needed |
mutation | create, update, delete, send, write, publish | Require user confirmation before execution |
Implementation rules:
- Add
safetymetadata to each tool definition:
export const deleteTool = {
name: 'delete_user',
description: '...',
safety: 'mutation' as const, // ← add this
inputSchema: z.object({ id: z.string() }),
async handler(input) { ... },
};- For every
mutationtool, generate a preview step that surfaces WHAT WILL HAPPEN before the action runs:
// In the handler, before executing:
if (tool.safety === 'mutation') {
return {
content: [{ type: 'text', text:
`⚠️ Will delete user "${user.name}" (ID: ${input.id}). This cannot be undone.\nConfirm? (yes/no)`
}],
requiresConfirmation: true,
};
}
// Proceed only after confirmation received- For Python (FastMCP), add a
@confirm_mutationdecorator or inline guard in the docstring:
@mcp.tool()
async def delete_user(id: str) -> str:
"""[MUTATION] Delete a user by ID. Will prompt for confirmation before executing."""
...- Document the safety classification in the README tool catalog (add a
🔒badge on mutation tools).
Step 4 — Generate Tests
For each tool:
- Happy path: valid input → expected output
- Validation: invalid input → proper error message
- Error handling: API failure → graceful error response
- Edge cases: empty input, max limits, special characters
For each resource:
- Read: valid URI → expected content
- Not found: invalid URI → proper error
- List: collection URI → paginated results
describe('tool_name', () => {
it('should return results for valid input', async () => {
const result = await toolName.handler({ param1: 'test' });
expect(result.content[0].type).toBe('text');
// Assert expected structure
});
it('should handle API errors gracefully', async () => {
// Mock API failure
const result = await toolName.handler({ param1: 'trigger-error' });
expect(result.isError).toBe(true);
});
});Step 5 — Generate Documentation
Produce README.md with:
- Server description and purpose
- Tool catalog (name, description, parameters, example usage)
- Resource catalog (URI templates, content types)
- Installation instructions (npm/pip, Claude Code config, Cursor config)
- Configuration reference (all env vars with descriptions)
- Example usage showing AI interactions
Claude Code installation snippet:
{
"mcpServers": {
"server-name": {
"command": "node",
"args": ["path/to/dist/index.js"],
"env": {
"API_KEY": "your_key"
}
}
}
}Step 6 — Verify
Invoke rune:verification:
- TypeScript:
tsc --noEmit+npm test - Python:
mypy src/+pytest - Ensure all tools respond correctly
- Ensure configuration validation works
Output Format
Generated Project Structure
TypeScript:
mcp-server-<name>/
├── src/
│ ├── index.ts — server entry, tool/resource registration
│ ├── tools/<name>.ts — one file per tool (Zod input schema + handler)
│ ├── resources/<name>.ts — one file per resource (URI template + reader)
│ ├── lib/client.ts — external API client
│ ├── lib/types.ts — shared TypeScript interfaces
│ └── config.ts — env var validation (Zod schema)
├── tests/tools/<name>.test.ts — per-tool tests (happy, validation, error, edge)
├── tests/resources/<name>.test.ts
├── package.json, tsconfig.json, .env.example, README.mdPython (FastMCP):
mcp-server-<name>/
├── src/
│ ├── server.py — FastMCP server with @mcp.tool() decorators
│ ├── tools/<name>.py — tool implementations
│ ├── resources/<name>.py
│ ├── lib/client.py — external API client
│ ├── lib/types.py — Pydantic models
│ └── config.py — pydantic-settings
├── tests/test_<name>.py
├── pyproject.toml, .env.example, README.mdREADME Structure
- Server description + tool catalog (name, description, params, example)
- Resource catalog (URI templates, content types)
- Installation: Claude Code, Cursor, Windsurf config snippets
- Configuration reference (env vars with descriptions)
Reference Pattern: Multi-Provider Adapter
When the MCP server needs to call multiple AI providers (e.g., both Anthropic and OpenAI), use the Provider Adapter pattern to normalize different APIs behind a unified interface.
Interface
interface ProviderAdapter {
formatRequest(params: RequestParams): { url: string; init: RequestInit };
parseResponse(data: unknown): { content: string; usage: TokenUsage | null };
formatStreamRequest(params: RequestParams): { url: string; init: RequestInit };
parseSSEEvent(eventType: string, data: string): StreamChunk | null;
}Discriminated Union for Stream Chunks
type StreamChunk =
| { type: "thinking"; content: string }
| { type: "text"; content: string }
| { type: "done" }
| { type: "done_with_usage"; usage: TokenUsage }
| { type: "usage_delta"; inputTokens?: number; outputTokens?: number }
| { type: "error"; message: string };When to Apply
- MCP server wraps multiple AI providers (e.g., a router server that dispatches to Claude, GPT, or local models)
- MCP server aggregates responses from multiple APIs with different response formats
- MCP server needs to support streaming from providers with different SSE event schemas
Key Implementation Notes
- Each provider adapter handles its own SSE event types (Anthropic:
content_block_delta,message_start; OpenAI:response.output_text.delta,[DONE]) - Buffer management for SSE: handle incomplete lines, track event types, manage abort signals
- Provider-specific prompt tuning: some models benefit from additional constraints (e.g., "Maximum 2-3 paragraphs" for verbose models)
- Per-provider token tracking: normalize different usage reporting formats into a single
TokenUsagetype
Cost-Aware Model Selection
When building MCP servers that call AI providers, support dual-model configuration — allow users to specify a primary model for critical operations and a cheaper model for background tasks (summarization, classification, metadata extraction). This avoids burning expensive API credits on tasks that don't need maximum quality.
// config.ts
const config = {
primaryModel: process.env.PRIMARY_MODEL || 'claude-sonnet-5',
backgroundModel: process.env.BACKGROUND_MODEL || 'claude-haiku-4-5',
};Constraints
- MUST validate all tool inputs with Zod (TS) or Pydantic (Python) — never trust AI-provided inputs
- MUST handle API errors gracefully — return MCP error responses, don't crash the server
- MUST generate .env.example — never hardcode API keys or secrets
- MUST generate tests — no MCP server without test suite
- MUST generate installation docs for at least Claude Code — other IDEs are bonus
- MUST use official MCP SDK (@modelcontextprotocol/sdk for TS, fastmcp for Python)
- Tool descriptions MUST be AI-friendly — clear, specific, include parameter semantics
Sharp Edges
| Failure Mode | Severity | Mitigation |
| Tool descriptions too vague for AI to use effectively | HIGH | Step 3: descriptions must explain WHEN to use the tool, not just WHAT it does |
| Missing input validation → server crashes on bad input | HIGH | Constraint 1: Zod/Pydantic validation on all inputs |
| Hardcoded API keys in generated code | CRITICAL | Constraint 3: always use env vars + .env.example |
| Tests mock everything → no real integration coverage | MEDIUM | Generate both unit tests (mocked) and integration test template (real API) |
| Generated server doesn't match MCP spec | HIGH | Use official SDK — don't hand-roll protocol handling |
| Installation docs only for Claude Code | LOW | Include Cursor/Windsurf config examples too |
| Mutation tool without confirmation gate | CRITICAL | Step 3.5: classify every tool — any write/delete/send without a preview+confirm step is a footgun |
Done When
- Server specification elicited (tools, resources, target API, language)
- Architecture designed (file structure, module boundaries)
- Server code generated (tools, resources, config, types)
- Test suite generated (happy path, validation, errors, edge cases)
- Documentation generated (README with tool catalog, installation, config)
- Verification passed (types + tests)
- Ready to install in Claude Code / Cursor / other IDEs
Returns
| Artifact | Format | Location |
| MCP server source code | TypeScript or Python | mcp-server-<name>/src/ |
| Tool definitions (one per tool) | TS/Python files | src/tools/<name>.ts or .py |
| Resource handlers | TS/Python files | src/resources/<name>.ts or .py |
| Test suite | TS/Python test files | tests/ |
| README with tool catalog | Markdown | mcp-server-<name>/README.md |
| Environment config template | .env.example | project root |
Cost Profile
~3000-6000 tokens input, ~2000-5000 tokens output. Sonnet — MCP server generation is a structured code task, not architectural reasoning.
Scope guardrail: mcp-builder generates the server and tests — it does not deploy, register with MCP registries, or configure the host IDE beyond providing the installation snippet.
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
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.

