Skip to main content

Enterprise-grade MCP framework built on FastMCP

Project description

SMF - Enterprise MCP Framework

SMF is a production-ready Python framework built on top of FastMCP that makes it significantly simpler to create, structure, and deploy MCP (Model Context Protocol) servers.

Features

  • ๐Ÿ—๏ธ High-level abstractions: ServerFactory and AppBuilder for minimal boilerplate
  • ๐Ÿ”ง Tool registration: Simple decorator-based tool registration
  • ๐Ÿ”Œ Plugin system: Extensible architecture with stable interfaces
  • ๐Ÿš€ CLI & Templates: Project scaffolding and code generation
  • ๐Ÿ“ฆ Simple & Focused: Tools-only approach, no unnecessary complexity

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   CLI & Templates           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Extensions & Plugins       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    Core SMF Layer          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    FastMCP (Upstream)        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

SMF wraps FastMCP without modifying it, ensuring compatibility with FastMCP updates while adding enterprise features.

Quick Start

Installation

uv add smf-mcp
# or
pip install smf-mcp

Simple Server

from smf import create_server

# Create server
mcp = create_server("My Server")

# Register a tool
@mcp.tool
def greet(name: str) -> str:
    """Greet someone by name."""
    return f"Hello, {name}!"

if __name__ == "__main__":
    from smf.transport import run_server
    run_server(mcp)

Advanced Server with AppBuilder

from smf import AppBuilder

# Use AppBuilder for fluent registration
with AppBuilder() as builder:
    @builder.tool(tags=["math"])
    def add(a: float, b: float) -> float:
        """Add two numbers."""
        return a + b

    mcp = builder.build()

if __name__ == "__main__":
    from smf.transport import run_server
    run_server(mcp, transport="http", port=8000)

CLI

# Initialize new project
smf init my-server

# Initialize project with Elasticsearch plugin
smf init my-server --elasticsearch --es-index "products"

# Run server
smf run server.py --transport http --port 8000

# Inspect server (Official Web Inspector)
smf inspector server.py

Core Components

ServerFactory

Creates configured FastMCP servers:

from smf import ServerFactory

factory = ServerFactory()
mcp = factory.create(name="My Server")

AppBuilder

Fluent interface for registering tools:

from smf import AppBuilder

builder = AppBuilder()
builder.tool(my_function)
mcp = builder.build()

Transport

Run servers with different transport mechanisms:

from smf.transport import run_server

# Stdio (default)
run_server(mcp)

# HTTP
run_server(mcp, transport="http", host="0.0.0.0", port=8000)

# SSE
run_server(mcp, transport="sse", host="0.0.0.0", port=8000)

Plugins

Elasticsearch Plugin

Create Elasticsearch-powered MCP servers:

# Create server with CLI
smf init my-server --elasticsearch --es-index "products"

# Or use in code
from smf.plugins.elasticsearch import (
    ElasticsearchConfiguration,
    build_elasticsearch_connection,
    create_elasticsearch_tools,
)

es_config = ElasticsearchConfiguration.from_env()
es_client = build_elasticsearch_connection(es_config)
mcp = create_server("My Server")
tools = create_elasticsearch_tools(es_client, index="products")
for tool in tools:
    mcp.tool(tool)

Install: Choose the version matching your Elasticsearch cluster:

  • pip install smf-mcp[elasticsearch7] or uv add smf-mcp[elasticsearch7] for Elasticsearch 7.x
  • pip install smf-mcp[elasticsearch8] or uv add smf-mcp[elasticsearch8] for Elasticsearch 8.x
  • pip install smf-mcp[elasticsearch9] or uv add smf-mcp[elasticsearch9] for Elasticsearch 9.x

Project Structure

When you initialize a new project with smf init, you get:

my-server/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ tools/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ tools.py          # Your tools
โ”œโ”€โ”€ server.py                  # Main server file
โ””โ”€โ”€ README.md                  # Project documentation

Requirements

  • Python 3.11+
  • FastMCP >= 2.11

License

MIT

Credits

Built on FastMCP by Prefect.

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

smf_mcp-0.1.22.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

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

smf_mcp-0.1.22-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file smf_mcp-0.1.22.tar.gz.

File metadata

  • Download URL: smf_mcp-0.1.22.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for smf_mcp-0.1.22.tar.gz
Algorithm Hash digest
SHA256 8a581650356dabb36aff2f0d1bc77c4547dfc12e3a108109e6aa98cdba9ea81d
MD5 47a8205fda249439c848a1e398aea4a4
BLAKE2b-256 fec81bae08116f27552c882f7c1488799591df32f9299009cb496157c130be69

See more details on using hashes here.

File details

Details for the file smf_mcp-0.1.22-py3-none-any.whl.

File metadata

  • Download URL: smf_mcp-0.1.22-py3-none-any.whl
  • Upload date:
  • Size: 41.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for smf_mcp-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 f2d9aef7da881bee193fc3388fbcf623565de1a76e141325fc2cb4ef28fef05f
MD5 e3b9f0a203c72ac5eba43406c4355847
BLAKE2b-256 ac3d568b7d65dc60e497581c2baefba1f693f4a90b713cf3ca88d2df4ad4846d

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