- Explore MCP Servers
- mcp-factory
Mcp Factory
What is Mcp Factory
mcp-factory is a manageable server factory built on top of FastMCP, designed to automatically register native methods as callable tools, support remote invocation, and provide permission-based management control.
Use cases
Use cases include creating demo servers for testing, managing multiple server instances in a microservices environment, and implementing secure APIs with permission controls.
How to use
To use mcp-factory, install it via pip or uv, create an authentication provider, instantiate the FastMCPFactory, create a managed server with auto-registration of FastMCP methods, define custom tools, and run the server.
Key features
Key features include auto tool registration, remote invocation capabilities, permission control for server management, factory pattern for batch creation of server instances, secure server composition, and configuration hot reload.
Where to use
mcp-factory can be used in various fields such as cloud computing, microservices architecture, and any application requiring remote method invocation and server management.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Factory
mcp-factory is a manageable server factory built on top of FastMCP, designed to automatically register native methods as callable tools, support remote invocation, and provide permission-based management control.
Use cases
Use cases include creating demo servers for testing, managing multiple server instances in a microservices environment, and implementing secure APIs with permission controls.
How to use
To use mcp-factory, install it via pip or uv, create an authentication provider, instantiate the FastMCPFactory, create a managed server with auto-registration of FastMCP methods, define custom tools, and run the server.
Key features
Key features include auto tool registration, remote invocation capabilities, permission control for server management, factory pattern for batch creation of server instances, secure server composition, and configuration hot reload.
Where to use
mcp-factory can be used in various fields such as cloud computing, microservices architecture, and any application requiring remote method invocation and server management.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
mcp-factory
A server factory based on fastmcp, supporting automatic registration of methods as tools, remote invocation, and permission-based management.
Features
- 🔧 Auto Tool Registration - Automatically register FastMCP native methods as callable tools
- 🚀 Remote Invocation - Provide MCP-based remote method invocation
- 🔐 Permission Control - Server management based on authentication mechanisms
- 🏭 Factory Pattern - Batch creation and management of server instances
- 🔄 Server Composition - Support secure server mounting and importing operations
- 🔁 Config Hot Reload - Update configuration without restarting
Installation
pip install mcp-factory # Using pip
# or
uv install mcp-factory # Using uv (recommended)
Quick Start
from mcp_factory import FastMCPFactory
# Create factory instance
factory = FastMCPFactory()
# Create authentication provider
factory.create_auth_provider(
provider_id="demo-auth0",
provider_type="auth0",
config={
"domain": "your-domain.auth0.com",
"client_id": "your-client-id",
"client_secret": "your-client-secret"
}
)
# Create server with configuration file
server = factory.create_managed_server(
config_path="config.yaml",
auth_provider_id="demo-auth0",
expose_management_tools=True
)
# Register custom tool
@server.tool(description="Calculate the sum of two numbers")
def add(a: int, b: int) -> int:
return a + b
# Start server
server.run()
Configuration
Minimal configuration example:
server:
name: "my-mcp-server"
instructions: "This is an example MCP server"
host: "0.0.0.0"
port: 8000
auth:
provider_id: "demo-auth0"
tools:
expose_management_tools: true
Advanced Features
Configuration Hot Reload
# Reload configuration from specified path
result = server.reload_config("new_config.yaml")
print(result) # Output: Server configuration reloaded (from new_config.yaml)
Server Composition
# Create two servers
server1 = factory.create_managed_server(config_path="main_config.yaml")
server2 = factory.create_managed_server(config_path="compute_config.yaml")
# Securely mount server
await server1.mount("compute", server2)
# Unmount server
server1.unmount("compute")
Auto-registered Management Tools
When setting expose_management_tools=True
, the server automatically registers management tools:
# Get all auto-registered management tools
tools = await server.get_tools()
for tool in tools:
if tool.name.startswith("manage_"):
print(f"Management Tool: {tool.name} - {tool.description}")
# Example management tools
await server.manage_reload_config() # Reload configuration
await server.manage_get_server_info() # Get server information
await server.manage_list_mounted_servers() # List mounted servers
Note: MCP-Factory fully supports the native features of FastMCP, including lifecycle management (lifespan), tool serializers (tool_serializer), etc. Please refer to the FastMCP documentation for details.
API Reference
# Authentication providers
factory.create_auth_provider(provider_id="id", provider_type="auth0", config={})
factory.list_auth_providers()
factory.remove_auth_provider("id")
# Server management
factory.list_servers()
factory.delete_server("name")
factory.get_server("name")
Command Line Tool
# Quick start - no configuration needed
mcpf quick --name my-server --port 8888
# Or use configuration files
mcpf template --type simple > server.yaml
mcpf run server.yaml
# Main commands: template, validate, run, quick, auth, list
mcpf --help
📖 CLI Guide for complete usage and examples
Documentation
📖 Complete Documentation | 💻 CLI Guide | 📝 Examples
Roadmap
The following features are planned for future versions:
- More Authentication Providers - Add support for various authentication mechanisms such as OAuth2, JWT, etc.
- Multi-environment Configuration - Support configuration management for development, testing, production, and other environments
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.