Generate production-ready MCP servers and clients in seconds
Project description
FastestMCP - Super Simple MCP Server Development
The fastest way to build MCP servers. Zero-config, one-command creation, component marketplace.
๐ Quick Start
Level 1: Zero-Config (80% of use cases)
from fastestmcp import Server
app = Server("my-app")
@app.tool
def hello(name: str):
return f"Hello {name}!"
app.run() # Everything else is automatic
That's it! No configuration, no boilerplate, no complexity.
One-Command Creation
# Natural language server creation
fastestmcp server "weather app that shows current temperature"
fastestmcp server "file organizer that sorts downloads"
fastestmcp server "github repo monitor"
๐ฏ Three Levels of Simplicity
Level 1: Zero-Config (80% of use cases)
Perfect for simple tools and resources. Everything is automatic.
from fastestmcp import Server
app = Server("calculator")
@app.tool
def add(a: int, b: int):
return a + b
@app.tool
def multiply(a: int, b: int):
return a * b
app.run()
Level 2: Minimal Config (15% of use cases)
For when you need a bit more control.
from fastestmcp import Server
app = Server("my-app", config={
"tools": ["math", "web"],
"resources": ["files", "data"]
})
Level 3: Full Control (5% of use cases)
Access to the full FastMCP power when you need it.
from mcp.server.fastmcp import FastMCP
# Full MCP implementation
๐๏ธ Component Marketplace
Add powerful functionality with one line:
from fastestmcp import Server, WebScraper, Database, FileSystem
app = Server("content-aggregator")
# Add components
app.add_component(WebScraper(urls=["news.com", "tech.com"]))
app.add_component(Database("sqlite:///content.db"))
app.add_component(FileSystem("/downloads"))
app.run()
Available Components
- WebScraper: Automatically scrape web content
- Database: Database operations and queries
- FileSystem: File system operations
- GitHub: GitHub API integration
- Slack: Slack notifications
- Email: Email sending
- And more coming soon!
๐ฆ Installation
pip install fastestmcp
# Or with extras
pip install fastestmcp[web,database]
๐ ๏ธ CLI Tool
The FastestMCP CLI is organized as a modular system for maintainability:
src/fastestmcp/
โโโ cli.py # Main entry point (25 lines - delegates to cli/ module)
โโโ cli/ # Modular CLI implementation
โ โโโ __init__.py
โ โโโ __main__.py # Main CLI logic with subcommands
โ โโโ templates.py # Template definitions
โ โโโ server_generator.py # Server generation logic
โ โโโ client_generator.py # Client generation logic
โ โโโ ...
โโโ ...
Create servers from natural language:
# Weather monitoring
fastestmcp server "weather app that shows current temperature"
# File organization
fastestmcp server "file organizer that sorts downloads by type"
# GitHub monitoring
fastestmcp server "github repo monitor that notifies of new issues"
# Custom servers
fastestmcp server "todo list manager with due date reminders"
CLI Architecture
The CLI follows a clean separation of concerns:
cli.py: Lightweight wrapper that imports from thecli/modulecli/__main__.py: Main CLI logic with argument parsing and command dispatchcli/modules: Specialized modules for templates, generators, and utilities
This modular design ensures:
- โ Easy maintenance and testing
- โ Clear separation of concerns
- โ Extensible architecture
- โ No monolithic files
Generated servers include:
- โ Complete working code
- โ Smart defaults
- โ Error handling
- โ Logging
- โ Dependencies list
- โ Usage examples
๐จ Examples
Basic Tool Server
from fastestmcp import Server
app = Server("math-tools")
@app.tool
def fibonacci(n: int) -> list:
"""Generate first n Fibonacci numbers"""
if n <= 0:
return []
fib = [0, 1]
for i in range(2, n):
fib.append(fib[i-1] + fib[i-2])
return fib
@app.tool
def is_prime(num: int) -> bool:
"""Check if a number is prime"""
if num < 2:
return False
for i in range(2, int(num**0.5) + 1):
if num % i == 0:
return False
return True
app.run()
Resource Server
from fastestmcp import Server
app = Server("data-server")
# Static data resource
app.resource("data://constants/pi", 3.14159)
app.resource("data://constants/e", 2.71828)
# Dynamic resource
@app.resource("data://time/current")
def get_current_time():
from datetime import datetime
return {"timestamp": datetime.now().isoformat()}
app.run()
Component-Based Server
from fastestmcp import Server, WebScraper, FileSystem
app = Server("content-manager")
# Add web scraping capability
scraper = WebScraper(urls=["example.com", "news.com"])
app.add_component(scraper)
# Add file system operations
filesystem = FileSystem("/data")
app.add_component(filesystem)
@app.tool
def process_content(url: str) -> str:
"""Process content from a URL and save to file"""
# Scrape content
content = scraper.scrape_url(url)
# Save to file
filename = f"content_{hash(url)}.txt"
filesystem.save_file(filename, content)
return f"Processed and saved content from {url}"
app.run()
๐ง Smart Defaults
FastestMCP automatically handles:
- Transport Detection: stdio, HTTP, or SSE based on environment
- Logging: Structured JSON logging with appropriate levels
- Error Handling: Graceful error responses with helpful messages
- Dependencies: Only loads what's needed
- Configuration: Sensible defaults for everything
๐ Advanced Features
Custom Components
from fastestmcp import Server, Component
class CustomAPI(Component):
def __init__(self, api_key: str):
super().__init__("custom-api", "Custom API integration")
self.api_key = api_key
def register(self, server: Server):
@server.tool
def call_api(endpoint: str, data: dict) -> dict:
# Your API logic here
return {"result": "API called", "endpoint": endpoint}
app = Server("api-server")
app.add_component(CustomAPI("your-api-key"))
app.run()
Configuration Files
# server.yaml
name: "advanced-server"
version: "1.0.0"
components:
- type: "WebScraper"
urls: ["site1.com", "site2.com"]
- type: "Database"
connection: "sqlite:///data.db"
tools:
- name: "process_data"
description: "Process incoming data"
๐ Performance
- Startup Time: < 100ms for basic servers
- Memory Usage: Minimal overhead
- Zero Dependencies: Core functionality works without extras
- Auto-scaling: Components load on-demand
๐ค Contributing
We love contributions! Here's how to get involved:
- Report Issues: Found a bug? Open an issue
- Suggest Components: Have an idea for a new component? Let us know
- Contribute Code: See our contributing guide
Adding Components
# Create your component
class MyComponent(Component):
def register(self, server: Server):
@server.tool
def my_tool():
return "Hello from my component!"
# Submit a PR!
๐ License
MIT License - see LICENSE for details.
๐ Acknowledgments
- Built on top of the amazing FastMCP framework
- Inspired by the simplicity of modern web frameworks
- Community contributions and feedback
FastestMCP: Because building MCP servers should be as easy as writing a function. ๐
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastestmcp-0.1.0.tar.gz.
File metadata
- Download URL: fastestmcp-0.1.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6b86574212d52cf3f83f8544500f66a20fa9c899e7c0bc12b7c2f561e1e2bf1
|
|
| MD5 |
2ae76baed87d0831ee9c637150de4dea
|
|
| BLAKE2b-256 |
cc939f17d00e9ecbd04d92cd4d260709ce05fff54d69dc1ac6b6ad1479b3703f
|
File details
Details for the file fastestmcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fastestmcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bcffa4ed164e54a0fe20015cbf1e06f84038367995747a582646f63a82a9229
|
|
| MD5 |
1e369c3da031d41b8670de4caebc0875
|
|
| BLAKE2b-256 |
3c5b61a3340368b71766781ca2992a2ad528bb10a398f51fe972e9af056bde3e
|