Metadata-Version: 2.4
Name: mcp-factory
Version: 1.0.0
Summary: A lightweight factory framework for creating and managing MCP (Model Context Protocol) servers with simplified configuration and project building capabilities.
Project-URL: Homepage, https://github.com/ACNet-AI/mcp-factory
Project-URL: Repository, https://github.com/ACNet-AI/mcp-factory
Project-URL: Bug Tracker, https://github.com/ACNet-AI/mcp-factory/issues
Author-email: ACNet-AI <agencollabnet@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai,factory,management,mcp,model-context-protocol,server
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: aiohttp>=3.12.0
Requires-Dist: click>=8.2.0
Requires-Dist: fastmcp>=2.9.2
Requires-Dist: jsonschema>=4.24.0
Requires-Dist: psutil>=7.0.0
Requires-Dist: pydantic>=2.11.0
Requires-Dist: python-dotenv>=1.1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: tabulate>=0.9.0
Requires-Dist: uvicorn>=0.34.0
Description-Content-Type: text/markdown

# MCP Factory

<div align="center">

![MCP Factory](https://img.shields.io/badge/MCP-Factory-blue?style=for-the-badge)
![Python](https://img.shields.io/badge/Python-3.10+-green?style=for-the-badge)
![License](https://img.shields.io/badge/License-Apache--2.0-red?style=for-the-badge)

**A factory framework focused on MCP server creation and management**

</div>

## 🎯 Overview

MCP Factory is a lightweight MCP (Model Context Protocol) server creation factory. It focuses on simplifying the building, configuration and management process of MCP servers, enabling developers to quickly create and deploy MCP servers.

### 🌟 Core Features

- **🏭 Server Factory** - Quickly create and configure MCP server instances
- **📁 Project Building** - Automatically generate complete MCP project structure
- **🔧 Configuration Management** - Flexible YAML configuration system
- **🔗 Server Mounting** - Support multi-server mounting and management
- **🛠️ CLI Tools** - Simple and easy-to-use command line interface

## 🚀 Quick Start

### Installation

```bash
pip install mcp-factory
```

Or using uv:

```bash
uv add mcp-factory
```

### Basic Usage

#### 1. Create project using factory

```python
from mcp_factory import MCPFactory

# Create factory instance
factory = MCPFactory(workspace_root="./workspace")

# Build new MCP project
project_path = factory.build_project(
    "my-server", 
    {"server": {"description": "My first MCP server"}}
)

# Create server instance
server_id = factory.create_server(
    name="my-server",
    source=project_path
)
```

#### 2. Directly create managed server

```python
from mcp_factory import ManagedServer

# Create managed server
server = ManagedServer(
    name="example-server",
    instructions="This is an example server"
)

# Add tools
@server.tool()
def hello(name: str) -> str:
    """Greet the specified user"""
    return f"Hello, {name}!"

# Run server
server.run()
```

#### 3. Using CLI tools

```bash
# Create new project
mcp-factory project create my-project

# Run server from configuration file
mcp-factory server run config.yaml

# Run with custom transport
mcp-factory server run config.yaml --transport http --host 0.0.0.0 --port 8080
```

## 📁 Project Structure

```
mcp-factory/
├── mcp_factory/           # Core modules
│   ├── factory.py         # Factory main class
│   ├── server.py          # Managed server
│   ├── config/            # Configuration management
│   ├── project/           # Project building
│   ├── mounting/          # Server mounting
│   └── cli.py             # Command line tools
├── examples/              # Usage examples
├── tests/                 # Test suite
└── docs/                  # Documentation
```

## 🛠️ Core Components

### MCPFactory

Factory main class, responsible for creating and managing MCP servers:

```python
factory = MCPFactory(workspace_root="./workspace")

# Build project
project_path = factory.build_project("server-name", config_dict)

# Create server
server_id = factory.create_server("server-name", source)

# Manage servers
servers = factory.list_servers()
```

### ManagedServer

Managed server class, providing complete MCP server functionality:

```python
server = ManagedServer(name="my-server")

# Add tools
@server.tool()
def my_tool(param: str) -> str:
    return f"Processing: {param}"

# Run server
server.run()
```

## 📚 Examples

Check the [examples/](examples/) directory for more usage examples:

- [Basic Server](examples/basic_server.py) - Create simple MCP server
- [Factory Complete Example](examples/factory_complete.py) - Complete workflow using factory
- [Server Mounting](examples/mounting_servers.py) - Multi-server mounting

## 🧪 Testing

```bash
# Run all tests
pytest

# Generate coverage report
pytest --cov=mcp_factory

# Type checking
mypy mcp_factory

# Code formatting
ruff format .
ruff check .
```

## 📖 Documentation

- [Configuration Guide](docs/configuration.md)
- [CLI Usage Guide](docs/cli-guide.md)
- [Architecture Documentation](docs/architecture/)

## 🤝 Contributing

Contributions are welcome! Please check our contribution guidelines.

## 📄 License

This project is licensed under the Apache-2.0 License - see the [LICENSE](LICENSE) file for details.

---

> **Note**: This is the stable version of MCP Factory (v1.0.0), focusing on core factory functionality with full type safety and modern Python practices. 