mlzoo/mcp_forge 是一个从 https://github.com/mlzoo/mcp_forge. 导入的 MCP 服务器候选程序。
概览
mlzoo/mcp_forge 是一个从 https://github.com/mlzoo/mcp_forge. 导入的 MCP 服务器候选程序。
概述(AI 翻译)
中文文档
概述
这是一个为企业级模型上下文协议(MCP)工具开发设计的专业框架,规范了MCP服务器开发流程,帮助开发者快速构建高质量的AI工具。通过将FastAPI与FastAPI-MCP集成,该框架实现了从传统API无缝转型为AI可调用工具。
主要特色
- MCP 工具标准化:自动将传统 FastAPI 端点转换为 AI 模型调用的 MCP 工具
- 接口-实现分离:支持接口定义与实现之间的明确分离,便于测试和环境切换
- 依赖注入设计:利用FastAPI的依赖注入机制实现灵活的组件组合和解耦
- 完整的开发流程:从开发到测试和部署提供全面的工具链支持
- 以示例为驱动的文档:通过实际案例展示最佳实践,加快入职进程
该框架特别适合:
- 人工智能工具开发团队
- 希望将现有API转化为AI工具的开发者
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP Server Development Framework
Overview
A professional framework designed for enterprise-level Model Context Protocol (MCP) tool development, standardizing the MCP server development process to help developers rapidly build high-quality AI tools. By integrating FastAPI with FastAPI-MCP, this framework enables seamless transformation from traditional APIs to AI-callable tools.
Key Features
- MCP Tool Standardization: Automatically convert traditional FastAPI endpoints into AI model-callable MCP tools
- Interface-Implementation Separation: Support clear separation between interface definitions and implementations, facilitating testing and environment switching
- Dependency Injection Design: Leverage FastAPI’s dependency injection mechanism for flexible component composition and decoupling
- Complete Development Pipeline: Provide comprehensive toolchain support from development to testing and deployment
- Example-Driven Documentation: Demonstrate best practices through practical examples to accelerate onboarding
This framework is particularly suitable for:
- AI tool development teams
- Developers looking to transform existing APIs into AI tools
- Organizations implementing standardized microservice architectures
Architecture
Core Architecture
┌─────────────┐ ┌───────────────┐ ┌─────────────────┐
│ API Layer │ ──→ │ Service Layer │ ──→ │ Implementation │
└─────────────┘ └───────────────┘ └─────────────────┘
↓
┌─────────────┐
│ MCP Endpoint│ ←── FastAPI-MCP Auto-Conversion
└─────────────┘
Key Components
- FastAPI Application: Provides the HTTP API service foundation
- FastAPI-MCP: Converts API endpoints to MCP tools
- Service Interface Layer: Defines service contracts through abstract base classes
- Dependency Injection Providers: Manages service instance creation and injection
- Implementation Classes: Includes Mock and Real implementations with environment-based switching
Technology Stack
- Python 3.10+: Utilizing latest language features and type annotations
- FastAPI: High-performance asynchronous web framework
- FastAPI-MCP: Automatically exposes FastAPI endpoints as MCP tools
- Development Toolchain: Includes code quality checking and testing tools
Quick Start
Environment Setup
This framework uses uv as its package manager, providing faster dependency resolution and virtual environment management. For installation instructions, see the uv official documentation.
# Install dependencies and set up the development environment
make install
Launch Example Service
# Start the development server
make dev
Once the service is running, you can:
- Access the API documentation at
http://localhost:5000/docs
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →