mcp-zero
by zeromicro·★ 42·综合分 44
用于 go-zero 框架的 MCP 服务器,可生成 API、RPC 服务和模型。
概述
mcp-zero 是一个专门为 Go 的 go-zero 框架设计的全面 Model Context Protocol 服务器。它使开发人员能够通过 AI 辅助快速搭建和生成完整的 go-zero 项目。该服务器提供 10 种专用工具,用于创建 API 服务、RPC 服务、模型、API 规范、配置、模板等。它与 Claude Desktop 集成,并利用 go-zero 的 goctl CLI 工具生成生产就绪的代码。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当您使用 go-zero 框架并希望通过 AI 辅助代码生成加速开发时选择此工具。
什么时候不要选它
如果您不使用 go-zero 框架或偏好没有 AI 辅助的手动编码,请不要选择此工具。
此 server 暴露的工具
从 README 抽取出 10 个工具create_api_serviceCreates a new go-zero API service.
create_rpc_serviceCreates a new go-zero RPC service from protobuf definition.
generate_api_from_specGenerates go-zero API code from an API specification file.
generate_modelGenerates database model code from database schema.
create_api_specCreates a sample API specification file.
analyze_projectAnalyzes an existing go-zero project structure and dependencies.
generate_configGenerates configuration files for go-zero services.
generate_templateGenerates common code templates for go-zero services.
query_docsQueries go-zero documentation and migration guides.
validate_inputValidates API specs, protobuf definitions, or configuration files.
可对比工具
安装
安装
- 为您的 MCP 工具创建新目录:
``bash mkdir go-zero-mcp && cd go-zero-mcp ``
- 初始化 Go 模块:
``bash go mod init go-zero-mcp ``
- 安装依赖项:
``bash go get github.com/modelcontextprotocol/go-sdk go get gopkg.in/yaml.v3 ``
- 将主工具代码保存为
main.go
- 构建工具:
``bash go build -o mcp-zero main.go ``
- 配置 Claude Desktop:
将此配置添加到您的 Claude Desktop MCP 设置中: ``json { "mcpServers": { "mcp-zero": { "command": "/path/to/your/mcp-zero", "env": { "GOCTL_PATH": "/path/to/goctl" } } } } ``
FAQ
- 使用 mcp-zero 需要什么先决条件?
- 您需要 Go(1.19 或更高版本)、go-zero CLI(goctl)和 Claude Desktop(或其他兼容的 MCP 客户端)。
- mcp-zero 能否从不同的数据库生成模型?
- 是的,它支持从 MySQL、PostgreSQL、MongoDB 和 DDL 文件生成模型。
mcp-zero 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。