🚀 元MCP框架
一个用于动态生成和部署模型上下文协议(MCP)服务器的健壮元框架
🎯 这是什么?
元MCP框架 是一个革命性的代码生成系统,使您能够 只需填写表单即可创建MCP服务器。这是一个自动生成其他MCP服务器的元服务器。
主要特点
✨ 动态服务器生成 -根据规格生成完整的MCP服务器 🎨 基于模板的体系结构 -适用于不同服务器类型的可扩展模板系统 📝 表单驱动配置 -基于JSON模式的表单,便于服务器规范 🔧 多种服务器类型 -支持API包装器、数据库连接器、文件系统等 ⚡ 生产就绪 -生成的服务器遵循最佳实践,并包含完整的TypeScript类型 🔒 类型安全 -对所有配置和模式进行完整的Zod验证 🚀 自动部署 -自动构建和部署生成的服务器
🏗️ 建筑
该框架由3个主要层组成:
┌─────────────────────────────────────────────────────────┐
│ Layer 1: MCP Server (Meta-Server) │
│ ├─ Tools for server generation │
│ ├─ Configuration management │
│ └─ Validation and orchestration │
├─────────────────────────────────────────────────────────┤
│ Layer 2: Generator Engine │
│ ├─ Template rendering (Handlebars) │
│ ├─ Code generation pipeline │
│ ├─ Schema to Zod conversion │
│ └─ File system operations │
├─────────────────────────────────────────────────────────┤
│ Layer 3: Templates & Schemas │
│ ├─ Server templates (various types) │
│ ├─ Tool/Resource/Prompt templates │
│ ├─ JSON Schemas for forms │
│ └─ Validation schemas │
└─────────────────────────────────────────────────────────┘🚀 快速开始
安装
npm install
npm run build运行元服务器
# Start the meta-MCP server
npm run dev
# Or use the CLI
meta-mcp-server与Claude Desktop一起使用
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"meta-mcp": {
"command": "node",
"args": ["/path/to/meta-mcp-framework/dist/server.js"]
}
}
}📖 用法
一旦元服务器在Claude Desktop中运行,您就可以使用它来生成新的MCP服务器:
- 列出可用模板
"Show me what types of MCP servers I can generate"- 生成服务器
"Create an MCP server for interacting with a REST API"- 部署生成的服务器
"Deploy the server I just generated"🎨 支持的服务器类型
当前模板
- 🌐 API包装 -根据OpenAPI规范生成MCP服务器
- 💾 数据库连接器 -连接到PostgreSQL、MySQL、MongoDB等。
- 📁 文件系统 -通过可配置的访问实现安全的文件操作
- 🔧 自定义工具 -使用自定义工具和资源创建服务器
- 📊 数据转换器 -ETL和数据处理服务器
- 🤖 AI集成 -连接到AI服务的服务器
即将推出
- Git仓库管理
- 云服务集成(AWS、GCP、Azure)
- 消息队列连接器(RabbitMQ、Kafka)
- 身份验证服务器
- 还有更多。..
🛠️ 项目结构
meta-mcp-framework/
├── src/
│ ├── server.ts # Main MCP server
│ ├── index.ts # CLI entry point
│ ├── core/
│ │ ├── generator.ts # Code generation engine
│ │ ├── template-engine.ts # Handlebars template rendering
│ │ ├── validator.ts # Schema validation
│ │ └── deployer.ts # Deployment management
│ ├── templates/
│ │ ├── base/ # Base server templates
│ │ ├── api-wrapper/ # API wrapper templates
│ │ ├── database/ # Database templates
│ │ └── custom/ # Custom server templates
│ ├── schemas/
│ │ ├── server-config.ts # Server configuration schemas
│ │ ├── tool-schema.ts # Tool definition schemas
│ │ └── forms/ # JSON Schema forms
│ ├── tools/
│ │ ├── generate-server.ts # Server generation tool
│ │ ├── list-templates.ts # Template listing
│ │ └── deploy-server.ts # Deployment tool
│ └── utils/
│ ├── file-ops.ts # File operations
│ ├── logger.ts # Logging utilities
│ └── helpers.ts # Helper functions
├── templates/ # Handlebars templates
├── generated-servers/ # Output directory
├── docs/ # Documentation
└── examples/ # Example configurations
🔧 发展
构建
npm run build观看模式
npm run watch测试
npm test与MCP检查员一起检查
npx @modelcontextprotocol/inspector node dist/server.js📚 文档
🤝 贡献
欢迎投稿!请看 贡献.md 了解详情。
📝 许可证
MIT许可证-请参阅 许可证 了解详情。
🙏 致谢
内置:
- 模型上下文协议 通过Anthropic
- TypeScript SDK
- 黄道 用于验证
- 把手 用于模板制作
🔗 链接
______________________________________________________________________
由以下材料制成❤️ 对于MCP社区
