artubss/SKILLS-CLAUDE-CODE / claude-skills-main/claude-skills-main/plugins/integrations/skills/mcp-builder
mcp-builder
VerifiedBuild 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.0 KB |
| assets/SCRIPTS-TEMPLATE.md | markdown | 1.3 KB |
| assets/api-client-pattern.py | script | 11.4 KB |
| assets/basic-server.py | script | 2.9 KB |
| assets/client-example.py | script | 10.0 KB |
| assets/error-handling.py | script | 11.0 KB |
| assets/openapi-integration.py | script | 7.5 KB |
| assets/prompts-examples.py | script | 8.1 KB |
| assets/pyproject.toml | manifest | 2.0 KB |
| assets/requirements.txt | manifest | 838 B |
| assets/resources-examples.py | script | 6.2 KB |
| assets/script-template.ts | script | 3.7 KB |
| assets/self-contained-server.py | script | 11.6 KB |
| assets/tools-examples.py | script | 6.1 KB |
| references/integration-patterns.md | markdown | 10.9 KB |
assets/basic-server.py
View on GitHub"""
Basic FastMCP Server Template
==============================
A minimal working FastMCP server with essential patterns.
"""
from fastmcp import FastMCP
import os
# Load environment variables (optional)
from dotenv import load_dotenv
load_dotenv()
# ============================================================================
# CRITICAL: Server must be at module level for FastMCP Cloud
# ============================================================================
mcp = FastMCP(
name="My Basic Server",
instructions="""
This is a basic MCP server demonstrating core patterns.
Available tools:
- greet: Say hello to someone
- calculate: Perform basic math operations
Available resources:
- info://status: Server status information
"""
)
# ============================================================================
# Tools
# ============================================================================
@mcp.tool()
def greet(name: str, greeting: str = "Hello") -> str:
"""
Greet someone by name.
Args:
name: The name of the person to greet
greeting: The greeting to use (default: "Hello")
Returns:
A greeting message
"""
return f"{greeting}, {name}!"
@mcp.tool()
async def calculate(operation: str, a: float, b: float) -> dict:
"""
Perform a mathematical operation.
Args:
operation: The operation to perform (add, subtract, multiply, divide)
a: First number
b: Second number
Returns:
Dictionary with the result or error message
"""
operations = {
"add": lambda x, y: x + y,
"subtract": lambda x, y: x - y,
"multiply": lambda x, y: x * y,
"divide": lambda x, y: x / y if y != 0 else None
}
if operation not in operations:
return {
"error": f"Unknown operation: {operation}",
"valid_operations": list(operations.keys())
}
result = operations[operation](a, b)
if result is None:
return {"error": "Division by zero"}
return {
"operation": operation,
"a": a,
"b": b,
"result": result
}
# ============================================================================
# Resources
# ============================================================================
@mcp.resource("info://status")
def server_status() -> dict:
"""Get current server status."""
from datetime import datetime
return {
"server": "My Basic Server",
"status": "operational",
"timestamp": datetime.now().isoformat(),
"version": "1.0.0"
}
# ============================================================================
# Main Execution
# ============================================================================
if __name__ == "__main__":
# Run with stdio transport (default)
mcp.run()
# Alternative: HTTP transport for testing
# mcp.run(transport="http", port=8000)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |