.agents/skills/fastmcp-server/SKILL.md
Complete guide for building MCP servers with FastMCP 3.0 - tools, resources, authentication, providers, middleware, and deployment. Use when creating Python MCP servers or integrating AI models with external tools and data.
npx skillsauth add datamonsterr/mycoai_projects fastmcp-serverInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete reference for building production-ready MCP (Model Context Protocol) servers with FastMCP 3.0 - the fast, Pythonic framework for connecting LLMs to tools and data.
Use FastMCP Server when:
Key areas covered:
Create a server with tools:
from fastmcp import FastMCP
mcp = FastMCP("MyServer")
@mcp.tool
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
Create a resource:
@mcp.resource("data://config")
def get_config() -> dict:
"""Return server configuration"""
return {"version": "1.0", "debug": False}
Create a resource template:
@mcp.resource("users://{user_id}/profile")
def get_user_profile(user_id: str) -> dict:
"""Get a user's profile by ID"""
return fetch_user(user_id)
Create a prompt:
@mcp.prompt
def review_code(code: str, language: str = "python") -> str:
"""Review code for best practices"""
return f"Review this {language} code:\n\n{code}"
Run the server:
if __name__ == "__main__":
mcp.run()
# Or with transport options:
# mcp.run(transport="sse", host="0.0.0.0", port=8000)
from fastmcp import FastMCP, Context
mcp = FastMCP("MyServer")
@mcp.tool
def process_data(uri: str, ctx: Context) -> str:
"""Process data with logging and progress"""
ctx.info(f"Processing {uri}")
ctx.report_progress(0, 100)
data = ctx.read_resource(uri)
ctx.report_progress(100, 100)
return f"Processed: {data}"
from fastmcp import FastMCP
from fastmcp.server.auth import BearerAuthProvider
auth = BearerAuthProvider(
jwks_uri="https://your-provider/.well-known/jwks.json",
audience="your-api",
issuer="https://your-provider/"
)
mcp = FastMCP("SecureServer", auth=auth)
Functions exposed as executable capabilities for LLMs. Decorated with @mcp.tool. Support Pydantic validation, async, custom return types, and annotations (readOnlyHint, destructiveHint).
Static or dynamic data sources identified by URIs. Resources use fixed URIs (data://config), templates use parameterized URIs (users://{id}/profile). Support MIME types, annotations, and wildcard parameters.
The Context object provides access to MCP features within tools/resources: logging, progress reporting, resource access, LLM sampling, user elicitation, and session state.
Inject values into tool/resource functions using Depends(). Supports HTTP requests, access tokens, custom dependencies, and generator-based cleanup patterns.
Control where components come from. LocalProvider (default, decorator-based), FileSystemProvider (load from Python files on disk), SkillsProvider (packaged bundles), or custom providers.
Multiple auth patterns: token verification (JWT, JWKS), OAuth proxy, OIDC proxy, remote OAuth, and full OAuth server. Authorization via scopes on components and middleware.
Intercept and modify requests/responses. Built-in middleware for rate limiting, error handling, logging, and response size limits. Custom middleware via @mcp.middleware.
Detailed documentation is organized in the references/ folder:
v1.0.0 (February 2026)
data-ai
Foundation model for image segmentation with zero-shot transfer. Use when you need to segment any object in images using points, boxes, or masks as prompts, or automatically generate all object masks in an image.
development
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
tools
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
development
Process images for web development — resize, crop, trim whitespace, convert formats (PNG/WebP/JPG), optimise file size, generate thumbnails, create OG card images. Uses Pillow (Python) — no ImageMagick needed. Trigger with 'resize image', 'convert to webp', 'trim logo', 'optimise images', 'make thumbnail', 'create OG image', 'crop whitespace', 'process image', or 'image too large'.