mcp-zero
Model Context Protocol (MCP) server for go-zero framework - Generate APIs, RPC services, and models with AI assistance.
claude mcp add --transport stdio zeromicro-mcp-zero /path/to/your/mcp-zero \ --env GOCTL_PATH="/Users/yourname/go/bin/goctl"
How to use
The mcp-zero tool is a Go-based MCP server designed to help you scaffold and generate Go-Zero projects quickly. It exposes a suite of capabilities to create API and RPC services, generate API code from specifications, build out database models, and generate configuration and template artifacts for your services. The server is intended to be used with Claude Desktop or any MCP-compatible client that can interact with the MCP API. The available tools cover end-to-end project scaffolding, from creating services to validating inputs and generating deployment templates.
Using mcp-zero, you can: create new API services, create RPC services from protobuf definitions, generate API code from .api specifications, generate models from various database sources, and generate sample API specification files. It also provides utilities to analyze existing projects, generate configuration files, and produce common code templates such as middleware, error handlers, and deployment templates. You can query documentation and migration guidance for go-zero concepts, and validate API specs, protobuf definitions, and configuration files to ensure consistency.
How to install
Prerequisites:
- Go 1.19 or later
- Claude Desktop (or another MCP-compatible client)
- A working environment where you can run the Go toolchain and build Go binaries
Step-by-step installation:
-
Create a workspace for the MCP tool and navigate into it: mkdir go-zero-mcp && cd go-zero-mcp
-
Initialize a Go module for the project (if you are building from source): go mod init go-zero-mcp
-
Install required dependencies used by the tool: go get github.com/modelcontextprotocol/go-sdk go get gopkg.in/yaml.v3
-
Save the main tool code as main.go in your project directory (or clone the repository if provided).
-
Build the tool into an executable named go-zero-mcp: go build -o go-zero-mcp main.go
-
Run or integrate with Claude Desktop by configuring the MCP server entry (see the Claude Desktop configuration section in the README for host-specific examples).
Additional notes
Tips and considerations:
- The mcp-zero server relies on the GOCTL_PATH environment variable to locate the goctl tool. Ensure GOCTL_PATH points to your goctl executable (e.g., /usr/local/bin/goctl).
- When configuring Claude Desktop, use the proper path to your built mcp-zero binary in the command field for each OS (macOS, Linux, Windows) and populate any necessary environment variables.
- The available tools cover API and RPC service creation, API spec to code generation, model generation from MySQL/PostgreSQL/MongoDB/DDL, and template generation for deployment artifacts. Use the analyze_project tool to inspect an existing go-zero project to understand its structure and dependencies.
- If you encounter permission or path issues, verify that the binary has execute permissions and that the path contains no spaces or special characters that could be misinterpreted by your shell.
- Regularly update dependencies and Go versions to keep compatibility with go-zero and MCP tooling.
Related MCP Servers
go
deprecated: use the official MCP sdk! (https://github.com/modelcontextprotocol/go-sdk) / ⚡ A type-safe, intuitive Go SDK for building MCP servers with ease and confidence
go-utcp
Official Go implementation of the UTCP
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
mcp-gopls
Model Context Protocol (MCP) server for Go using gopls – LSP-powered analysis, tests, coverage, and tooling.
taskboard
Local project management with Kanban UI, CLI, and MCP server for AI assistants. SQLite-backed, single binary, installable via Homebrew.
ruvscan
🧠 The AI that finds the code you didn't know you needed - Sublinear-intelligence MCP server for discovering GitHub leverage