终极MCP代码生成器
](https://github.com/MythEclipse/Ultimate-MCP)
一个令牌高效的MCP(模型上下文协议)服务器,从紧凑的JSON模式生成TypeScript代码。通过以下方式减少AI令牌的使用 60-70% 与传统的代码生成相比。
特性
- 🚀 代币高效:压缩JSON输入,而不是完整的TypeScript代码
- 📦 4工具:
generate_typescript,generate_file,generate_project,generate_statements - 🔧 完全支持TypeScript:接口、函数、类、枚举、类型、常量
- � 控制流程:if/else、for、while、try/catch、用嵌套块切换
- �💾 文件系统集成:可选择直接写入文件
- ✅ 验证:Zod驱动的输入验证
安装
选项1:直接使用npx运行(推荐)
npx ultimate-mcp-codegen选项2:全局安装
npm install -g ultimate-mcp-codegen
ultimate-mcp-codegen选项3:在本地克隆和构建
git clone https://github.com/MythEclipse/Ultimate-MCP.git
cd Ultimate-MCP
npm install
npm run build用法
启动MCP服务器
npm start使用Claude Desktop进行配置
添加到您的Claude桌面配置(claude_desktop_config.json):
推荐:使用npx(无需安装)
{
"mcpServers": {
"codegen": {
"command": "npx",
"args": ["ultimate-mcp-codegen"]
}
}
}或者,如果全局安装:
{
"mcpServers": {
"codegen": {
"command": "ultimate-mcp-codegen"
}
}
}工具
generate_typescript
从紧凑的JSON生成TypeScript代码片段。
{
"code": [
{
"type": "interface",
"name": "User",
"props": ["id:string", "name:string"]
}
]
}generatefile
使用导入生成完整的文件。
{
"path": "src/types.ts",
"imports": ["zod:z"],
"code": [...]
}发电项目
批量生成多个文件。
{
"files": [
{"path": "src/types.ts", "imports": [], "code": [...]},
{"path": "src/utils.ts", "imports": [], "code": [...]}
]
}紧凑格式
| 元素 | 格式 | 示例 |
|---|---|---|
| 房地产 | name:type 或 name?:type | "id:string", "email?:string" |
| 参数 | name:type 或 name:type=default | "limit:number=10" |
| 进口 | module:items 或 module | "zod:z,ZodSchema", "express" |
许可证
麻省理工学院
