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.
In this repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- data/CLAUDE.mdCLAUDE.md
- mcp-teaching-kit-main/CLAUDE.mdCLAUDE.md
- segment_1_quickstart/CLAUDE.mdCLAUDE.md
- segment_2_context/CLAUDE.mdCLAUDE.md
- segment_3_agents/CLAUDE.mdCLAUDE.md
- segment_4_hero/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- azure-ai-deploySkill
- azure-bicep-skillSkill
- claude-md-auditSkill
- genai-prompt-evalSkill
- kubernetes-patternsSkill
- review-changesSkill
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
- Distinctive: line 149
Customize: - Add your tools, resources, prompts
- Distinctive: line 150
Validate: - Check for common issues
- Very specific: line 151
Test: - Run locally with python server.py
- Very specific: line 152
Deploy: - Add to Claude Code with claude mcp add
≈ “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.
Files
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-serverThis creates a complete project structure with:
server.py- Main server with example tool, resource, and promptrequirements.txt- Dependencies (fastmcp, pydantic)README.md- Usage instructions
Scaffolding Options
Minimal Server (Tools Only)
python scripts/scaffold.py my-server --template basicFull Server (All Primitives)
python scripts/scaffold.py my-server --template fullWith Specific Features
python scripts/scaffold.py my-server \
--tools \
--resources \
--prompts \
--lifespan \
--output ./servers/my-serverValidation
Validate an existing MCP server:
python scripts/validate.py path/to/server.pyChecks:
- 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
- Scaffold - Generate project structure
- Customize - Add your tools, resources, prompts
- Validate - Check for common issues
- Test - Run locally with
python server.py - Deploy - Add to Claude Code with
claude mcp add
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.

