agentleFS
timothywarner-orgtimothywarner-org/claude-code/.claude/skills/mcp-scaffold/SKILL.md

mcp-scaffold

Skill224 starsChanged 4 months agoMITView on GitHub

Scaffold production-ready Python MCP servers using FastMCP. Use when creating new MCP servers, initializing MCP projects, generating server boilerplate, or setting up MCP development environments. Supports all MCP primitives (tools, resources, prompts) with Pydantic validation, async patterns, and proper project structure.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Customize: - Add your tools, resources, prompts

    line 149
  2. Distinctive:

    Validate: - Check for common issues

    line 150
  3. Very specific:

    Test: - Run locally with python server.py

    line 151
  4. Very specific:

    Deploy: - Add to Claude Code with claude mcp add

    line 152

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MCP Server Scaffolding

Scaffold production-ready Python MCP servers with FastMCP.

Quick Start

Generate a new MCP server:

python scripts/scaffold.py my-server --output ./my-server

This creates a complete project structure with:

  • server.py - Main server with example tool, resource, and prompt
  • requirements.txt - Dependencies (fastmcp, pydantic)
  • README.md - Usage instructions

Scaffolding Options

Minimal Server (Tools Only)

python scripts/scaffold.py my-server --template basic

Full Server (All Primitives)

python scripts/scaffold.py my-server --template full

With Specific Features

python scripts/scaffold.py my-server \
  --tools \
  --resources \
  --prompts \
  --lifespan \
  --output ./servers/my-server

Validation

Validate an existing MCP server:

python scripts/validate.py path/to/server.py

Checks:

  • FastMCP import and initialization
  • Tool definitions with proper type hints
  • Resource URI patterns
  • Pydantic Field usage
  • Async function patterns

Project Structure

Generated projects follow this structure:

my-server/
├── server.py           # Main MCP server
├── requirements.txt    # Python dependencies
├── README.md          # Usage documentation
└── data/              # Default data directory (gitignored)

Templates

Basic Template

Minimal server with one tool:

from fastmcp import FastMCP

mcp = FastMCP("my-server")

@mcp.tool
def hello(name: str) -> str:
    """Greet someone by name."""
    return f"Hello, {name}!"

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

Full Template

Complete server with tools, resources, prompts, and lifespan. See assets/templates/full-server.py.

Reference Documentation

  • FastMCP API: See references/FASTMCP-GUIDE.md for decorator syntax, type hints, and patterns
  • Common Patterns: See references/PATTERNS.md for database connections, API clients, error handling
  • Deployment: See references/DEPLOYMENT.md for stdio, HTTP, and Docker deployment

MCP Primitives Cheatsheet

Tools (Actions)

from pydantic import Field

@mcp.tool
def my_tool(
    param: str = Field(description="Parameter description"),
    optional: int = Field(default=10, description="Optional with default")
) -> dict:
    """Tool description shown to LLM."""
    return {"result": param}

Resources (Data)

@mcp.resource("myscheme://path/to/resource")
def static_resource() -> str:
    """Resource description."""
    return json.dumps({"data": "value"})

@mcp.resource("myscheme://items/{item_id}")
def dynamic_resource(item_id: str) -> str:
    """Dynamic resource with URI template."""
    return json.dumps({"id": item_id})

Prompts (Templates)

@mcp.prompt(name="my_prompt", tags={"category"})
def my_prompt(
    topic: str = Field(description="What to analyze")
) -> str:
    """Prompt description."""
    return f"Please analyze {topic} and provide insights."

Workflow

  1. Scaffold - Generate project structure
  2. Customize - Add your tools, resources, prompts
  3. Validate - Check for common issues
  4. Test - Run locally with python server.py
  5. Deploy - Add to Claude Code with claude mcp add

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.