jezweb/claude-skills/mcp-builder
Claude Code and agent skill by jezweb/claude-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install jezweb/claude-skills/mcp-builderSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as jezweb/claude-skills/mcp-builder.
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
Create the server file. The server instance MUST be at module level:
Step 3: Add Companion CLI Scripts (Optional)
For Claude Code terminal use, add scripts alongside the MCP server:
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:
Dev mode with inspector UI (recommended):
HTTP mode for remote clients:
Automated test script using FastMCP Client:
Step 5: Pre-Deploy Checklist
Run these checks before deploying. All required checks must pass.
Required (will cause deploy failure):
- Server file exists
- Python syntax valid:
python3 -m py_compile server.py - Module-level server object (not inside a function):
``bash grep -q "^mcp = FastMCP\|^server = FastMCP\|^app = FastMCP" server.py ``
requirements.txtexists with PyPI packages only (nogit+,-e,.whl,.tar.gz)- No hardcoded secrets (check for
api_key = "..."patterns excludingos.getenv/os.environ)
Advisory (warnings):
fastmcplisted in requirements.txt.gitignoreincludes.env- No circular imports
- Git repository initialised with remote
- Server can load:
timeout 5 fastmcp inspect server.py
Step 6: Deploy
FastMCP Cloud (simplest):
Cloud requirements:
- Module-level server object named
mcp,server, orapp - 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):
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:
Type Annotations Required
FastMCP uses type annotations to generate tool schemas:
Error Handling
Return errors as strings, don't raise exceptions:
Cloud-Ready Server Pattern
Common Errors and Fixes
These are the errors you will hit. Fix them before deploying.
| Error | Cause | Fix | ||
|---|---|---|---|---|
RuntimeError: No server object found at module level | Server inside a function | Export mcp = FastMCP(...) at module level | ||
RuntimeError: no running event loop | Missing async/await | Use async def for async operations | ||
TypeError: missing required argument 'context' | Context not type-hinted | Add context: Context with type hint | ||
ValueError: Invalid resource URI | Missing URI scheme | Use data://, file://, info://, api:// | ||
| Resource template parameter mismatch | Name mismatch | user://{user_id} needs def get_user(user_id: str) | ||
| Pydantic validation error | Wrong type hints | Ensure hints match actual data types | ||
| Transport mismatch | Client/server protocol differ | Match both to stdio or both to http | ||
| Import errors with editable package | Package not installed | pip install -e . or add to PYTHONPATH | ||
DeprecationWarning: mcp.settings | Old API | Use os.getenv() instead | ||
| Port already in use | Stale process | `lsof -ti:8000 \ | xargs kill -9` | |
| Schema generation failure | Non-JSON types | Use JSON-compatible types (no NumPy arrays) | ||
| JSON serialization error | datetime/bytes in response | Convert to .isoformat() or string | ||
| Circular import | Factory in __init__.py | Use direct imports, avoid factory pattern | ||
| Python 3.12+ datetime warning | datetime.utcnow() deprecated | Use datetime.now(timezone.utc) | ||
| Import-time execution | Async resource at module level | Use lazy init pattern |
Production Patterns
Self-Contained Server
Keep all utilities in one file to avoid circular imports:
Lazy Initialisation
Don't create async resources at module level. Initialise on first use:
Health Check Resource
Connection Pooling
Retry with Backoff
Context Features (Advanced)
Context Injection
Progress Tracking
Sampling (LLM from within tools)
CLI Quick Reference
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.AsyncClientwith 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 templateassets/self-contained-server.py-- Server with storage and middlewareassets/tools-examples.py-- Tool patterns and type annotationsassets/resources-examples.py-- Resource URI patternsassets/prompts-examples.py-- Prompt template patternsassets/client-example.py-- MCP client usageassets/SCRIPTS-TEMPLATE.md-- CLI companion docs templateassets/script-template.ts-- TypeScript CLI script template
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/integrations/skills/mcp-builder/SKILL.md
Popularity
- Repository stars
- 1,034
- Repository forks
- 105
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 31 Aug 2026, 2 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jezweb/claude-skills/mcp-builder)