
Mcp Server Builder
Scaffold and validate production-ready MCP servers from an existing OpenAPI spec so your coding agent can call your API safely.
Overview
MCP Server Builder is an agent skill for the Build phase that generates and validates MCP server scaffolds from OpenAPI contracts.
Install
npx skills add https://github.com/alirezarezvani/claude-skills --skill mcp-server-builderWhat is this skill?
- OpenAPI → tool_manifest.json plus Python or TypeScript starter server via openapi_to_mcp.py
- Strict structural validation with mcp_validator.py before you ship tools to agents
- operationId-first tool naming with sanitized method_path fallbacks
- Bundled extraction guide, language templates, and validation checklist references
- Copy-install paths documented for Claude Code, Codex, and OpenClaw skill directories
- Two included scripts: openapi_to_mcp.py and mcp_validator.py
- Four reference guides including validation-checklist.md
Adoption & trust: 540 installs on skills.sh; 17.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have a REST API described in OpenAPI but no consistent, validated MCP tool layer for your coding agent to invoke.
Who is it for?
Solo builders shipping an agent-accessible API who want OpenAPI-driven MCP scaffolding instead of one-off tool definitions.
Skip if: Teams without an OpenAPI source of truth or anyone who only needs a one-off curl wrapper with no MCP manifest.
When should I use this skill?
When you need to bootstrap an MCP server from OpenAPI and enforce schema quality before agents use the tools.
What do I get? / Deliverables
You get a generated tool manifest, starter server code, and a strict validation pass so you can ship MCP tools with predictable names and schemas.
- tool_manifest.json mapped from API operations
- Starter MCP server scaffold in Python or TypeScript
- Validation report from strict mcp_validator.py run
Recommended Skills
Journey fit
MCP server creation is core product engineering for agent-facing integrations, which sits in Build when you wire external APIs into Claude, Codex, or Cursor. Agent-tooling is the canonical shelf because the deliverable is MCP manifests and server scaffolds, not general backend CRUD or frontend UI.
How it compares
Use as a codegen plus validator workflow for MCP—not the same as installing a prebuilt MCP server from a marketplace listing.
Common Questions / FAQ
Who is mcp-server-builder for?
Indie and solo developers building MCP integrations from existing HTTP APIs, especially when using Claude Code, Codex, or Cursor with custom tools.
When should I use mcp-server-builder?
During Build when you are adding agent-tooling: export openapi.json, run openapi_to_mcp.py, then mcp_validator.py --strict before agents call your API.
Is mcp-server-builder safe to install?
Review the Security Audits panel on this Prism page and inspect the bundled Python scripts locally before running them against production secrets or live OpenAPI files.
SKILL.md
READMESKILL.md - Mcp Server Builder
# MCP Server Builder Generate and validate MCP servers from OpenAPI contracts with production-focused tooling. This skill helps teams bootstrap fast and enforce schema quality before shipping. ## Quick Start ```bash # Generate scaffold from OpenAPI python3 scripts/openapi_to_mcp.py \ --input openapi.json \ --server-name my-mcp \ --language python \ --output-dir ./generated \ --format text # Validate generated manifest python3 scripts/mcp_validator.py --input generated/tool_manifest.json --strict --format text ``` ## Included Tools - `scripts/openapi_to_mcp.py`: OpenAPI -> `tool_manifest.json` + starter server scaffold - `scripts/mcp_validator.py`: structural and quality validation for MCP tool definitions ## References - `references/openapi-extraction-guide.md` - `references/python-server-template.md` - `references/typescript-server-template.md` - `references/validation-checklist.md` ## Installation ### Claude Code ```bash cp -R engineering/mcp-server-builder ~/.claude/skills/mcp-server-builder ``` ### OpenAI Codex ```bash cp -R engineering/mcp-server-builder ~/.codex/skills/mcp-server-builder ``` ### OpenClaw ```bash cp -R engineering/mcp-server-builder ~/.openclaw/skills/mcp-server-builder ``` # OpenAPI Extraction Guide ## Goal Turn stable API operations into stable MCP tools with clear names and reliable schemas. ## Extraction Rules 1. Prefer `operationId` as tool name. 2. Fallback naming: `<method>_<path>` sanitized to snake_case. 3. Pull `summary` for tool description; fallback to `description`. 4. Merge path/query parameters into `inputSchema.properties`. 5. Merge `application/json` request-body object properties when available. 6. Preserve required fields from both parameters and request body. ## Naming Guidance Good names: - `list_customers` - `create_invoice` - `archive_project` Avoid: - `tool1` - `run` - `get__v1__customer___id` ## Schema Guidance - `inputSchema.type` must be `object`. - Every `required` key must exist in `properties`. - Include concise descriptions on high-risk fields (IDs, dates, money, destructive flags). # Python MCP Server Template ```python from fastmcp import FastMCP import httpx import os mcp = FastMCP(name="my-server") API_BASE = os.environ["API_BASE"] API_TOKEN = os.environ["API_TOKEN"] @mcp.tool() def list_items(input: dict) -> dict: with httpx.Client(base_url=API_BASE, headers={"Authorization": f"Bearer {API_TOKEN}"}) as client: resp = client.get("/items", params=input) if resp.status_code >= 400: return {"error": {"code": "upstream_error", "message": "List failed", "details": resp.text}} return resp.json() if __name__ == "__main__": mcp.run() ``` # TypeScript MCP Server Template ```ts import { FastMCP } from "fastmcp"; const server = new FastMCP({ name: "my-server" }); server.tool( "list_items", "List items from upstream service", async (input) => { return { content: [{ type: "text", text: JSON.stringify({ status: "todo", input }) }], }; } ); server.run(); ``` # MCP Validation Checklist ## Structural Integrity - [ ] Tool names are unique across the manifest - [ ] Tool names use lowercase snake_case (3-64 chars, `[a-z0-9_]`) - [ ] `inputSchema.type` is always `"object"` - [ ] Every `required` field exists in `properties` - [ ] No empty `properties` objects (warn if inputs truly optional) ## Descriptive Quality - [ ] All tools include actionable descriptions (≥10 chars) - [ ] Descriptions start with a verb ("Create…", "Retrieve…", "Delete…") - [ ] Parameter descriptions explain expected values, not just types ## Security & Safety - [ ] Auth tokens and secrets are NOT exposed in tool schemas - [ ] Destructive tools require explicit confirmation input parameters - [ ] No tool accepts arbitrary URLs or file paths without validation - [ ] Outbound host allowlists are explicit where applicable ## Versioning & Compatibility - [ ] Breaking tool changes use new tool IDs (never