zeromicro/mcp-zero

View on GitHub ↗

Model Context Protocol (MCP) server for go-zero framework - Generate APIs, RPC services, and models with AI assistance.

46 ★12 forksGoUpdated 7mo ago

What you need to know

Go + goctl powered MCP tool from the go-zero team that scaffolds go-zero projects through an AI assistant - creating API/RPC services, generating code/models/configs/templates, plus project analysis, docs lookup and input validation.

Install

mkdir go-zero-mcp && cd go-zero-mcp && go mod init go-zero-mcp && go get github.com/modelcontextprotocol/go-sdk && go get gopkg.in/yaml.v3 && go build -o go-zero-mcp main.go

Usage

  • Requires Go 1.19+, the go-zero CLI (goctl via go install github.com/zeromicro/go-zero/tools/goctl@latest) and an MCP-compatible client
  • Register with Claude Desktop pointing at the built binary and setting GOCTL_PATH
  • e.g. 'Please create a new go-zero API service called user-service on port 8080' or 'Generate go-zero models from my MySQL database...'
  • Enable debug logging with MCP_DEBUG=1

Key features

  • 10 tools: create_api_service, create_rpc_service, generate_api_from_spec, generate_model, create_api_spec, analyze_project, generate_config, generate_template, query_docs, validate_input
  • Model generation from MySQL, PostgreSQL, MongoDB and DDL
  • Templates for middleware, error handlers, Dockerfile, Docker Compose and Kubernetes manifests
  • go-zero concept and framework-migration documentation queries
  • Built on github.com/modelcontextprotocol/go-sdk with stdio transport

Best for

Scaffolding go-zero microservices (API/RPC) with natural language via Claude Desktop or other MCP clients

Caveats

  • No prebuilt binary - the README builds a new module from a main.go source file rather than consuming a package
  • Requires goctl installed and in PATH (go-zero version must match)
  • Requires Go 1.19 or later
Platforms: LocalClients: Claude Desktop

Reviewed 2026-08-18

Topics

Stars
46★
Forks
12
Language
Go
License
MIT
Created
2025-11-15
Last push
2026-01-31