fastmcp▌
jezweb/claude-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
$22
FastMCP - Build MCP Servers in Python
FastMCP is a Python framework for building Model Context Protocol (MCP) servers that expose tools, resources, and prompts to Large Language Models like Claude. This skill provides production-tested patterns, error prevention, and deployment strategies for building robust MCP servers.
Quick Start
Installation
pip install fastmcp
# or
uv pip install fastmcp
Minimal Server
from fastmcp import FastMCP
# MUST be at module level for FastMCP Cloud
mcp = FastMCP("My Server")
@mcp.tool()
async def hello(name: str) -> str:
"""Say hello to someone."""
return f"Hello, {name}!"
if __name__ == "__main__":
mcp.run()
Run it:
# Local development
python server.py
# With FastMCP CLI
fastmcp dev server.py
# HTTP mode
python server.py --transport http --port 8000
What's New in v2.14.x (December 2025)
v2.14.2 (December 31, 2024)
- MCP SDK pinned to <2.x for compatibility
- Supabase provider gains
auth_routeparameter - Bug fixes: outputSchema
$refresolution, OAuth Proxy validation, OpenAPI 3.1 support
v2.14.1: Sampling with Tools (SEP-1577)
ctx.sample()now accepts tools for agentic workflowsAnthropicSamplingHandlerpromoted from experimentalctx.sample_step()for single LLM call returningSampleStep- Python 3.13 support added
v2.14.0: Background Tasks (SEP-1686)
- Protocol-native background tasks for long-running operations
- Add
task=Trueto async decorators; progress tracking without blocking - MCP 2025-11-25 specification support
- SEP-1699: SSE polling and event resumability
- SEP-1330: Multi-select enum elicitation schemas
- SEP-1034: Default values for elicitation schemas
⚠️ Breaking Changes (v2.14.0):
BearerAuthProvidermodule removed (useJWTVerifierorOAuthProxy)Context.get_http_request()method removedfastmcp.Imagetop-level import removed (usefrom fastmcp.utilities import Image)enable_docket,enable_taskssettings removed (always enabled)run_streamable_http_async(),sse_app(),streamable_http_app(),run_sse_async()methods removeddependenciesparameter removed from decoratorsoutput_schema=Falsesupport eliminatedFASTMCP_SERVER_environment variable prefix deprecated
Known Compatibility:
- MCP SDK pinned to <2.x (v2.14.2+)
What's New in v3.0.0 (Beta - January 2026)
⚠️ MAJOR BREAKING CHANGES - FastMCP 3.0 is a complete architectural refactor.
Provider Architecture
All components now sourced via Providers:
FileSystemProvider- Discover decorated functions from directories with hot-reloadSkillsProvider- Expose agent skill files as MCP resourcesOpenAPIProvider- Auto-generate from OpenAPI specsProxyProvider- Proxy to remote MCP servers
from fastmcp import FastMCP
from fastmcp.providers import FileSystemProvider
mcp = FastMCP("server")
mcp.add_provider(FileSystemProvider(path="./tools", reload=True))
Transforms (Component Middleware)
Modify components without changing source code:
- Namespace, rename, filter by version
ResourcesAsTools- Expose resources as toolsPromptsAsTools- Expose prompts as tools
from fastmcp.transforms import Namespace, VersionFilter
mcp.add_transform(Namespace(prefix="api"))
mcp.add_transform(VersionFilter(min_version="2.0"))
Component Versioning
@mcp.tool(version="2.0")
async def fetch_data(query: str) -> dict:
# Clients see highest version by default
# Can request specific version
return {"data": [...]}
Session-Scoped State
@mcp.tool()
async def set_preference(key: str, value: str, ctx: Context) -> dict:
await ctx.set_state(key, value) # Persists across session
return {"saved": True}
@mcp.tool()
async def get_preference(key: str, ctx: Context) -> dict:
value = await ctx.get_state(key, default=None)
return {"value": value}
Other Features
--reloadflag for auto-restart during development- Automatic threadpool dispatch for sync functions
- Tool timeouts
- OpenTelemetry tracing
- Component authorization:
@tool(auth=require_scopes("admin"))
Migration Guide
Pin to v2 if not ready:
# requirements.txt
fastmcp<3
For most servers, updating the import is all you need:
# v2.x and v3.0 compatible
from fastmcp import FastMCP
mcp = FastMCP("server")
# ... rest of code works the same
Core Concepts
Tools
Functions LLMs can call. Best practices: Clear names, comprehensive docstrings (LLMs read these!), strong type hints (Pydantic validates), structured returns, error handling.
@mcp.tool()
async def async_tool(url: str) -> dict: # Use async for I/O
async with httpx.AsyncClient() as client:
return (await client.get(url)).json()
Resources
Expose data to LLMs. URI schemes: data://, file://, resource://, info://, api://, or custom.
@mcp.resource("user://{user_id}/profile") # Template with parameters
async def get_user(user_id: str) -> dict: # CRITICAL: param names must match
return await fetch_user_from_db(user_id)
Prompts
Pre-configured prompts with parameters.
@mcp.prompt("analyze")
def analyze_prompt(topic: str) -> str:
return f"Analyze {topic} considering: state, challenges, opportunities, recommendations."
Context Features
Inject Context parameter (with type hint!) for advanced features:
Elicitation (User Input):
from fastmcp import Context
@mcp.tool()
async def confirm_action(action: str, context: Context) -> dict:
confirmed = await context.request_elicitation(prompt=f"Confirm {action}?", response_type=str)
return {"status": "completed" if confirmed.lower() == "yes" else "cancelled"}
Progress Tracking:
@mcp.tool()
async def batch_import(file_path: str, context: Context) -> dict:
data = await read_file(file_path)
for i, item in enumerate(data):
await context.report_progress(i + 1, len(data), f"Importing {i + 1How to use fastmcp on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add fastmcp
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches fastmcp from GitHub repository jezweb/claude-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate fastmcp. Access the skill through slash commands (e.g., /fastmcp) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.8★★★★★70 reviews- ★★★★★Luis Farah· Dec 24, 2024
fastmcp has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Aisha Malhotra· Dec 24, 2024
Solid pick for teams standardizing on skills: fastmcp is focused, and the summary matches what you get after install.
- ★★★★★Olivia Rao· Dec 24, 2024
I recommend fastmcp for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Kabir Ndlovu· Dec 24, 2024
fastmcp fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Zara Choi· Dec 16, 2024
I recommend fastmcp for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Emma Kim· Dec 8, 2024
We added fastmcp from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Noor Smith· Dec 8, 2024
Useful defaults in fastmcp — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Noor Johnson· Dec 4, 2024
We added fastmcp from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Amelia Taylor· Nov 27, 2024
fastmcp reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Noor Malhotra· Nov 23, 2024
fastmcp reduced setup friction for our internal harness; good balance of opinion and flexibility.
showing 1-10 of 70