Agent skill

MCP Builder

by jezweb in jezweb/claude-skills

Build MCP servers in Python with FastMCP. An agent skill from jezweb/claude-skills.

MITAuto-check: notesAgent Workflows

Install MCP Builder

skills CLI
$ npx skills add jezweb/claude-skills --skill mcp-builder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jezweb/claude-skills mcp-builder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jezweb/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/integrations/skills/mcp-builder .claude/skills/mcp-builder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mcp-builder
GitHub stars
1.1k
Token cost
~3.1k tokens
SKILL.md length
659 words
Files
15 (incl. references, assets)
Skills in repo
52
Repo updated
First seen
Licence
MIT

At a glance

Build MCP servers in Python with FastMCP. An agent skill from jezweb/claude-skills.

  • Works in 6 steps: Define What to Expose → Scaffold the Server → Add Companion CLI Scripts (Optional) → …
  • The user mentions building an MCP server
  • SKILL.md covers Workflow, Critical Patterns, Common Errors and Fixes and Production Patterns, plus 4 more sections
  • Runs Python and TypeScript scripts from its folder; calls git, pip and python; needs API_KEY

What it does

MCP Builder is an agent skill from jezweb/claude-skills. Build MCP servers in Python with FastMCP. Define tools / resources / prompts, build the server, test locally, deploy to FastMCP Cloud or Docker. Use whenever the user mentions building an MCP server, exposing tools to LLMs, FastMCP, building a Claude integration, or troubleshooting FastMCP module-level server, storage, lifespan, middleware, OAuth, or deployment errors.

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 16 other files, including reference files and assets (for example `assets/SCRIPTS-TEMPLATE.md`, `assets/api-client-pattern.py` and `assets/basic-server.py`). Compatibility notes: claude-code-only

It sits in Agent Workflows, covering MCP servers and Deployment. It works with Model Context Protocol, Python and Docker. The repository describes itself as: Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • The user mentions building an MCP server
  • Exposing tools to LLMs
  • Building a Claude integration
  • Troubleshooting FastMCP module-level server

Example prompts

  • “/mcp-builder”

Requirements

  • Python 3
  • Node.js
  • Docker
  • A credential in API_KEY
  • Compatibility (from SKILL.md): claude-code-only

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Define What to Expose
  2. Scaffold the Server
  3. Add Companion CLI Scripts (Optional)
  4. Test Locally
  5. Pre-Deploy Checklist
  6. Deploy

What it can do on your machine

Read from SKILL.md and the folder at commit 64965d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python and TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • git
    • pip
    • python
    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    claude-code-only

    From compatibility in the SKILL.md frontmatter.

Context cost

MCP Builder loads about 3.1k tokens when it runs, and up to ~5.9k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 659 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:139
    7. `.gitignore` includes `.env`

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jezweb/claude-skills at commit 64965d9, republished under its MIT licence (© jezweb). 659 words, ~3,088 tokens.

Download SKILL.mdSave it as .claude/skills/mcp-builder/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
mcp-builder
description
Build MCP servers in Python with FastMCP. Define tools / resources / prompts, build the server, test locally, deploy to FastMCP Cloud or Docker. Use whenever the user mentions building an MCP server, exposing tools to LLMs, FastMCP, building a Claude integration, or troubleshooting FastMCP module-level server, storage, lifespan, middleware, OAuth, or deployment errors.
compatibility
claude-code-only

MCP Builder

Build a working MCP server from a description of the tools you need. Produces a deployable Python server using FastMCP.

Workflow

Step 1: Define What to Expose

Ask what the server needs to provide:

  • Tools -- Functions Claude can call (API wrappers, calculations, file operations)
  • Resources -- Data Claude can read (database records, config, documents)
  • Prompts -- Reusable prompt templates with parameters

A brief like "MCP server for querying our customer database" is enough.

Step 2: Scaffold the Server
bash
pip install fastmcp

Create the server file. The server instance MUST be at module level:

python
from fastmcp import FastMCP

# MUST be at module level for FastMCP Cloud
mcp = FastMCP("My Server")

@mcp.tool()
async def search_customers(query: str) -> str:
    """Search customers by name or email."""
    # Implementation here
    return f"Found customers matching: {query}"

@mcp.resource("customers://{customer_id}")
async def get_customer(customer_id: str) -> str:
    """Get customer details by ID."""
    return f"Customer {customer_id} details"

if __name__ == "__main__":
    mcp.run()
Step 3: Add Companion CLI Scripts (Optional)

For Claude Code terminal use, add scripts alongside the MCP server:

my-mcp-server/
├── src/index.ts          # MCP server (for Claude.ai)
├── scripts/
│   ├── search.ts         # CLI version of search tool
│   └── _shared.ts        # Shared auth/config
├── SCRIPTS.md            # Documents available scripts
└── package.json

CLI scripts provide file I/O, batch processing, and richer output that MCP can't. See assets/SCRIPTS-TEMPLATE.md and assets/script-template.ts for TypeScript templates.

Step 4: Test Locally

Quick test -- run directly:

bash
python server.py

Dev mode with inspector UI (recommended):

bash
fastmcp dev server.py
# Opens inspector at http://localhost:5173
# Hot reload, detailed logging, tool/resource inspection

HTTP mode for remote clients:

bash
python server.py --transport http --port 8000

Automated test script using FastMCP Client:

python
import asyncio
from fastmcp import Client

async def test_server(server_path):
    async with Client(server_path) as client:
        # List everything
        tools = await client.list_tools()
        resources = await client.list_resources()
        prompts = await client.list_prompts()

        print(f"Tools: {[t.name for t in tools]}")
        print(f"Resources: {[r.uri for r in resources]}")
        print(f"Prompts: {[p.name for p in prompts]}")

        # Call first tool
        if tools:
            result = await client.call_tool(tools[0].name, {})
            print(f"Tool result: {result}")

        # Read first resource
        if resources:
            data = await client.read_resource(resources[0].uri)
            print(f"Resource data: {data}")

asyncio.run(test_server("server.py"))
Step 5: Pre-Deploy Checklist

Run these checks before deploying. All required checks must pass.

Required (will cause deploy failure):

  1. Server file exists
  2. Python syntax valid: python3 -m py_compile server.py
  3. Module-level server object (not inside a function):
    bash
    grep -q "^mcp = FastMCP\|^server = FastMCP\|^app = FastMCP" server.py
  4. requirements.txt exists with PyPI packages only (no git+, -e, .whl, .tar.gz)
  5. No hardcoded secrets (check for api_key = "..." patterns excluding os.getenv/os.environ)

Advisory (warnings):

  1. fastmcp listed in requirements.txt
  2. .gitignore includes .env
  3. No circular imports
  4. Git repository initialised with remote
  5. Server can load: timeout 5 fastmcp inspect server.py
Step 6: Deploy

FastMCP Cloud (simplest):

bash
git add . && git commit -m "Ready for deployment"
git push -u origin main
# Visit https://fastmcp.cloud, connect repo, add env vars, deploy
# URL: https://your-project.fastmcp.app/mcp

Cloud requirements:

  • Module-level server object named mcp, server, or app
  • PyPI dependencies only in requirements.txt
  • Public GitHub repository
  • Environment variables for secrets (no hardcoded values)
  • Auto-deploys on push to main, PR preview deployments

Docker (self-hosted):

dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "server.py", "--transport", "http", "--port", "8000"]

Cloudflare Workers (edge): Build it in TypeScript with Cloudflare's agents SDK (McpAgent); Cloudflare's remote MCP server docs carry the current template.


Critical Patterns

Module-Level Server Instance

FastMCP Cloud requires the server instance at module level:

python
# CORRECT
mcp = FastMCP("My Server")

@mcp.tool()
def my_tool(): ...

# WRONG -- Cloud can't find the server
def create_server():
    mcp = FastMCP("My Server")
    return mcp

# FIX for factory pattern -- export at module level
def create_server() -> FastMCP:
    mcp = FastMCP("server")
    return mcp
mcp = create_server()
Type Annotations Required

FastMCP uses type annotations to generate tool schemas:

python
@mcp.tool()
async def search(
    query: str,           # Required parameter
    limit: int = 10,      # Optional with default
    tags: list[str] = []  # Complex types supported
) -> str:
    """Docstring becomes the tool description."""
    ...
Error Handling

Return errors as strings, don't raise exceptions:

python
@mcp.tool()
async def get_data(id: str) -> str:
    try:
        result = await fetch_data(id)
        return json.dumps(result)
    except NotFoundError:
        return f"Error: No data found for ID {id}"
Cloud-Ready Server Pattern
python
import os
from fastmcp import FastMCP

mcp = FastMCP("production-server")
API_KEY = os.getenv("API_KEY")

@mcp.tool()
async def production_tool(data: str) -> dict:
    if not API_KEY:
        return {"error": "API_KEY not configured"}
    return {"status": "success", "data": data}

if __name__ == "__main__":
    mcp.run()

Show full SKILL.md (316 more words)Show less

Common Errors and Fixes

These are the errors you will hit. Fix them before deploying.

ErrorCauseFix
RuntimeError: No server object found at module levelServer inside a functionExport mcp = FastMCP(...) at module level
RuntimeError: no running event loopMissing async/awaitUse async def for async operations
TypeError: missing required argument 'context'Context not type-hintedAdd context: Context with type hint
ValueError: Invalid resource URIMissing URI schemeUse data://, file://, info://, api://
Resource template parameter mismatchName mismatchuser://{user_id} needs def get_user(user_id: str)
Pydantic validation errorWrong type hintsEnsure hints match actual data types
Transport mismatchClient/server protocol differMatch both to stdio or both to http
Import errors with editable packagePackage not installedpip install -e . or add to PYTHONPATH
DeprecationWarning: mcp.settingsOld APIUse os.getenv() instead
Port already in useStale processlsof -ti:8000 | xargs kill -9
Schema generation failureNon-JSON typesUse JSON-compatible types (no NumPy arrays)
JSON serialization errordatetime/bytes in responseConvert to .isoformat() or string
Circular importFactory in __init__.pyUse direct imports, avoid factory pattern
Python 3.12+ datetime warningdatetime.utcnow() deprecatedUse datetime.now(timezone.utc)
Import-time executionAsync resource at module levelUse lazy init pattern

Production Patterns

Self-Contained Server

Keep all utilities in one file to avoid circular imports:

python
from fastmcp import FastMCP
import os

mcp = FastMCP("my-server")

# Config
class Config:
    API_KEY = os.getenv("API_KEY", "")
    BASE_URL = os.getenv("BASE_URL", "https://api.example.com")

# Helpers
def format_success(data): return {"status": "success", "data": data}
def format_error(msg): return {"status": "error", "message": msg}

@mcp.tool()
async def my_tool(query: str) -> dict:
    if not Config.API_KEY:
        return format_error("API_KEY not configured")
    return format_success({"query": query})
Lazy Initialisation

Don't create async resources at module level. Initialise on first use:

python
_db = None

async def get_db():
    global _db
    if _db is None:
        _db = await create_connection(Config.DB_URL)
    return _db
Health Check Resource
python
@mcp.resource("health://status")
async def health_check() -> dict:
    return {
        "status": "healthy",
        "version": "1.0.0",
        "checks": {
            "api": "connected",
            "database": "connected"
        }
    }
Connection Pooling
python
import httpx

_client = None

def get_client() -> httpx.AsyncClient:
    global _client
    if _client is None:
        _client = httpx.AsyncClient(
            base_url=Config.BASE_URL,
            headers={"Authorization": f"Bearer {Config.API_KEY}"},
            limits=httpx.Limits(max_connections=20, max_keepalive_connections=5),
            timeout=30.0
        )
    return _client
Retry with Backoff
python
async def retry_with_backoff(func, max_retries=3, initial_delay=1.0):
    for attempt in range(max_retries):
        try:
            return await func()
        except Exception as e:
            if attempt == max_retries - 1:
                raise
            delay = initial_delay * (2 ** attempt)
            await asyncio.sleep(delay)

Context Features (Advanced)

Context Injection
python
from fastmcp import Context

@mcp.tool()
async def tool_with_context(param: str, context: Context) -> dict:
    # Context parameter MUST have type hint
    pass
Progress Tracking
python
@mcp.tool()
async def long_task(items: list[str], context: Context) -> str:
    for i, item in enumerate(items):
        await context.report_progress(i + 1, len(items), f"Processing {item}")
        await process(item)
    return "Done"
Sampling (LLM from within tools)
python
@mcp.tool()
async def summarise(text: str, context: Context) -> str:
    result = await context.request_sampling(
        messages=[{"role": "user", "content": f"Summarise: {text}"}],
        max_tokens=200
    )
    return result

CLI Quick Reference

bash
fastmcp dev server.py              # Dev mode with inspector UI
fastmcp run server.py              # Run (stdio)
fastmcp run server.py --transport http --port 8000  # Run (HTTP)
fastmcp inspect server.py          # Inspect without running
fastmcp install server.py          # Install to Claude Desktop
fastmcp deploy server.py --name my-server  # Deploy to Cloud

Environment variables: FASTMCP_LOG_LEVEL (DEBUG/INFO/WARNING/ERROR), FASTMCP_ENV (development/staging/production).


Integration Patterns (Optional)

For specific integration approaches, see references/integration-patterns.md:

  • Manual API -- httpx.AsyncClient with reusable client
  • OpenAPI auto-generation -- FastMCP.from_openapi(spec, client, route_maps=[...])
  • FastAPI conversion -- FastMCP.from_fastapi(app)

Asset Files

  • assets/basic-server.py -- Minimal FastMCP server template
  • assets/self-contained-server.py -- Server with storage and middleware
  • assets/tools-examples.py -- Tool patterns and type annotations
  • assets/resources-examples.py -- Resource URI patterns
  • assets/prompts-examples.py -- Prompt template patterns
  • assets/client-example.py -- MCP client usage
  • assets/SCRIPTS-TEMPLATE.md -- CLI companion docs template
  • assets/script-template.ts -- TypeScript CLI script template

© jezweb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files (references, assets) in plugins/integrations/skills/mcp-builder of jezweb/claude-skills.

  • SKILL.md
  • assets/SCRIPTS-TEMPLATE.md
  • assets/api-client-pattern.py
  • assets/basic-server.py
  • assets/client-example.py
  • assets/error-handling.py
  • assets/openapi-integration.py
  • assets/prompts-examples.py
  • assets/pyproject.toml
  • assets/requirements.txt
  • assets/resources-examples.py
  • assets/script-template.ts
  • assets/self-contained-server.py
  • assets/tools-examples.py
  • references/integration-patterns.md

Open the folder on GitHubat commit 64965d9

Compare with similar skills

MCP Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

MCP Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
MCP Builder this skilljezweb/claude-skills1.1k—~3.1kAutomated safety check: NotesMIT
FastmcpTommy-yw/RunbookHermes5464 repos~2.1kAutomated safety check: PassMIT
Building MCP Serversaiskillstore/marketplace430—~1.4kAutomated safety check: PassNone
Unraiddinglebear-ai/unraid135—~5.4kAutomated safety check: NotesMIT
Task Orchestrator Server Setupjpicklyk/task-orchestrator207—~3.1kAutomated safety check: PassMIT
AWS Cdk Developmentzxkane/aws-skills3672 repos~2.5kAutomated safety check: PassMIT

Similar skills

  • Fastmcp

    Tommy-yw/RunbookHermes

    Build, test, inspect, install, and deploy MCP servers with FastMCP in Python.

    546 GitHub starsUsed in 4 repos~2.1k tokens
    Agent WorkflowsAuto-check passed
  • Building MCP Servers

    aiskillstore/marketplace

    Guides creation of high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools.

    430 GitHub stars~1.4k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Unraid

    dinglebear-ai/unraid

    This skill should be used when the user mentions Unraid, asks to check server health, monitor array or disk status, list or restart Docker containers, start or stop VMs, read system logs, check…

    135 GitHub stars~5.4k tokensUpdated 4 days ago
    DevOps & CloudAuto-check: notes
  • Task Orchestrator Server Setup

    jpicklyk/task-orchestrator

    Walks through how to launch and reach the MCP Task Orchestrator server container: transport, REST API, port publishing, config mounts and config-sync.

    207 GitHub stars~3.1k tokensUpdated today
    DevOps & CloudAuto-check passed
  • AWS Cdk Development

    zxkane/aws-skills

    AWS Cloud Development Kit (CDK) expert for building cloud infrastructure with TypeScript/Python.

    367 GitHub starsUsed in 2 repos~2.5k tokens
    DevOps & CloudAuto-check passed
  • Deploy Observability

    aliyun/alibabacloud-observability-mcp-server

    Deploy, start, and update the Alibaba Cloud Observability MCP Server (阿里云可观测 MCP Server).

    166 GitHub stars~2.6k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check: notes

More from jezweb/claude-skills

All 52 skills in this repo
  • Elevenlabs Agents

    jezweb/claude-skills

    Build conversational AI voice agents on the ElevenLabs platform.

    1.1k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Favicon Gen

    jezweb/claude-skills

    Generate custom favicons from logos, text, or brand colours.

    1.1k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Tailwind Theme Builder

    jezweb/claude-skills

    Set up Tailwind v4 + shadcn/ui themed UI with dark mode. An agent skill from jezweb/claude-skills.

    1.1k GitHub starsUsed in 1 repo~3.2k tokens
    Auto-check passed
  • Project Health

    jezweb/claude-skills

    All-in-one project configuration and health management. An agent skill from jezweb/claude-skills.

    1.1k GitHub starsUsed in 1 repo~3k tokens
    Auto-check passed
  • Responsiveness Check

    jezweb/claude-skills

    Test website responsiveness across viewport widths using browser automation.

    1.1k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • UX Compare

    jezweb/claude-skills

    Compare UX patterns across multiple reference apps using pattern libraries produced by ux-extract.

    1.1k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Categories

Questions about MCP Builder

What does MCP Builder do?

Build MCP servers in Python with FastMCP. An agent skill from jezweb/claude-skills. MCP Builder is an agent skill from jezweb/claude-skills. Build MCP servers in Python with FastMCP.

When should I use MCP Builder?

MCP Builder fits situations like: the user mentions building an MCP server; exposing tools to LLMs; building a Claude integration; troubleshooting FastMCP module-level server.

How do I install MCP Builder in Claude Code?

Run `npx skills add jezweb/claude-skills --skill mcp-builder -a claude-code`. Or copy the skill folder (plugins/integrations/skills/mcp-builder in jezweb/claude-skills) into .claude/skills/mcp-builder in your project. Claude Code loads it when a task matches its description.

How do I install MCP Builder in Codex?

Run `npx skills add jezweb/claude-skills --skill mcp-builder -a codex`. Or copy the skill folder (plugins/integrations/skills/mcp-builder in jezweb/claude-skills) into .agents/skills/mcp-builder in your project. Codex loads it when a task matches its description.

Can I use MCP Builder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jezweb/claude-skills --skill mcp-builder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcp-builder, .gemini/skills/mcp-builder, .github/skills/mcp-builder and .opencode/skills/mcp-builder in your project.

What does MCP Builder need to run?

Going by SKILL.md and its folder, MCP Builder needs Python and TypeScript for the scripts in its folder, the command-line tools its instructions call (git, pip, python and python3) and credentials named API_KEY. Our summary lists: Python 3; Node.js; Docker; A credential in API_KEY. Compatibility (from SKILL.md): claude-code-only.

Does MCP Builder access the network?

SKILL.md contains no URLs. Its commands use git and pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is MCP Builder safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does MCP Builder use?

MCP Builder is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does MCP Builder use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.8k tokens, read only when the agent opens those files.

What are the alternatives to MCP Builder?

Skills that share tags, products or a category with MCP Builder: Fastmcp (Tommy-yw/RunbookHermes, 546 stars), Building MCP Servers (aiskillstore/marketplace, 430 stars), Unraid (dinglebear-ai/unraid, 135 stars) and Task Orchestrator Server Setup (jpicklyk/task-orchestrator, 207 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains MCP Builder?

jezweb (a GitHub user) maintains it in jezweb/claude-skills, which has 1,051 GitHub stars. The repository holds 52 skills in this directory. The repository was last updated on October 5, 2026.

Source: jezweb/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.