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:
ServerFactoryandAppBuilderfor 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) # Returns native Elasticsearch client
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]oruv add smf-mcp[elasticsearch7]for Elasticsearch 7.xpip install smf-mcp[elasticsearch8]oruv add smf-mcp[elasticsearch8]for Elasticsearch 8.xpip install smf-mcp[elasticsearch9]oruv 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
Release history Release notifications | RSS feed
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 smf_mcp-0.1.23.tar.gz.
File metadata
- Download URL: smf_mcp-0.1.23.tar.gz
- Upload date:
- Size: 25.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15f7192430c3712153c60615fc1513db271e6c15c73b1abe15f8c805e3014b3f
|
|
| MD5 |
8b4c72ebb66c8d8cf59a96f3a04d5345
|
|
| BLAKE2b-256 |
d6cb4f29ff42dceba0bf6cafebe760e96542b562becc75b8639c5e0fcd8cbca3
|
File details
Details for the file smf_mcp-0.1.23-py3-none-any.whl.
File metadata
- Download URL: smf_mcp-0.1.23-py3-none-any.whl
- Upload date:
- Size: 40.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2c0dd04ef14e13eb18e625d81bff661e7162da995a71b0228575bc1fd7938c2
|
|
| MD5 |
c34da7e795c99021b3ecf3f6fc337a2f
|
|
| BLAKE2b-256 |
af9f512e91ed6edbcbadf4f4259da18d2895e8e84e1b868da9756e6260b595db
|