Skip to main content

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.

PyPI version License: MIT

๐Ÿš€ 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 the cli/ module
  • cli/__main__.py: Main CLI logic with argument parsing and command dispatch
  • cli/ 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:

  1. Report Issues: Found a bug? Open an issue
  2. Suggest Components: Have an idea for a new component? Let us know
  3. 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

fastestmcp-1.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastestmcp-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file fastestmcp-1.0.0.tar.gz.

File metadata

  • Download URL: fastestmcp-1.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for fastestmcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 713473a3bff0805a71c2e4e6ad03fe990e9a541cc778d9565195da74deee1a0c
MD5 27550d343093c6f3d225761cd42cc8c4
BLAKE2b-256 f2ababbc5e0eaf10af27be68f2f76601ca5716f47050d543c2bcdc016b1579a8

See more details on using hashes here.

File details

Details for the file fastestmcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastestmcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09c8a3ca6ee17a5fe00deccd55d10ae2d814b1b920660fd1f934aa03a656ed75
MD5 845cc591cc9612481bb53284729cad0b
BLAKE2b-256 46bfa065cc65bc6be132245dc639642e7a0d6e96854e665f4f98468fc7d9ed4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page