MCP-Forge 是基于官方 MCP SDK 的框架,可动态生成、管理和监控符合 MCP 协议的服务器。它采用模块化设计,支持自定义扩展,还具备全面的安全保护机制,能有效满足各类服务器管理需求。
git clone https://github.com/yourusername/mcp-forge.git
cd mcp-forge
pip install -r requirements.txt
python forge_mcp_server.py --config config.yaml
git clone https://github.com/yourusername/mcp-forge.git
cd mcp-forge
pip install -r requirements.txt
python forge_mcp_server.py --config config.yaml
server:
listen: "0.0.0.0"
port: 8080
workers: 4
logging:
level: DEBUG
file: logs/mcp-forge.log
rotate: true
security:
enable_audit: true
auth_required: false
要添加自定义模块,只需将新模块文件放入 template_system/handlers/ 目录,并在模板配置中引用即可。
mcp-forge/
├── forge_mcp_server.py # 核心forge服务器
├── server_manager.py # 服务器实例管理
├── config_manager.py # 配置管理
├── auto_scaler.py # 自动扩展系统
├── resource_monitor.py # 资源监控
├── process_monitor.py # 进程监控
├── logging_system.py # 中央日志系统
├── log_aggregator.py # 日志聚合服务
├── status_reporter.py # 状态报告系统
├── metrics_collector.py # 性能指标收集
├── alerting_system.py # 重要问题预警系统
├── audit_logger.py # 安全审计日志系统
├── authentication_system.py # 身份验证与授权
├── protection_mechanisms.py # 安全防护机制
├── request_validator.py # 请求验证与净化
├── quota_manager.py # 资源配额管理
├── template_system/ # 模板系统用于生成服务器
│ ├── template_manager.py # 模板加载与解析
│ ├── customization.py # 定制点
│ ├── handlers/ # 自定义处理程序模板
│ └── templates/ # 服务器模板
├── client.py # 与服务器交互的客户端工具
├── test_protection.py # 安全测试工具
├── servers/ # 生成服务器脚本目录
├── docs/ # 文档目录
│ ├── api_specification.md # API规范文档
│ ├── security_protection.md # 安全日志记录
│ └── development_workflow.md # 开发指南
└── progress_tracker.py # 开发进度跟踪工具
详细的 API 文档请参阅API 规范。
MCP-Forge 实施了多层安全防护措施:
更多详情,请参阅安全防护文档。
MCP-Forge 采用 MIT 许可证,具体条款如下:
MIT License
更多详细信息,请访问许可证文件。