go
Model Context Protocol (MCP) implementation for llm to better understand go language written projects.
claude mcp add --transport stdio xieyuschen-go-mcp-server mcpgo
How to use
This MCP server provides a set of Go-focused static analysis and project-scoped tools to help an editor or IDE understand and navigate a Go codebase through the Model Context Protocol. When running in standard I/O mode, the server communicates over stdio with the client (for example, a VS Code extension). It also supports an optional HTTP server mode by providing an address, enabling you to interact with the MCP server over HTTP/JSON. Core capabilities include inspecting the current module, listing package details and exported symbols, enumerating standard library packages and their symbols, and auditing module requirements and project-defined packages. Tools available include: get_go_env (exposes GOROOT, GOBIN, and Go version), list_package_details (details and exported symbols for a given package in the current module), list_stdlib_packages_symbols (symbols for all standard library packages), list_stdlib_packages (documentation for standard library packages), fetch_project_build_required_modules (modules and versions used by the build, respecting go.mod directives), list_project_defined_packages (packages defined by the current project), check_package_exists, and check_package_symbol_exists. Use these tools to analyze your codebase, verify symbol availability, and understand dependencies and package structure, enabling the LLM or tooling to reason about your Go project with up-to-date information.
How to install
Prerequisites:
- Go 1.25 or higher (as required by this server).
- Internet access to fetch modules and install the MCP server.
Installation steps:
- Ensure Go is installed and in your PATH:
- On macOS/Linux: go version
- On Windows: go version
- Install the MCP server binary:
- go install github.com/xieyuschen/go-mcp-server/mcpgo@latest This places the mcpgo binary in your GOPATH/bin or GOBIN directory, which should be in your PATH.
- Verify installation:
- mcpgo --version
- Run the MCP server (stdio by default). Optionally, run an HTTP server by providing an address flag (see usage notes):
- mcpgo
- Or with an HTTP address (if supported by your build): mcpgo -addr :8080
Notes:
- The server is intended to work as an MCP backend for editors like VS Code extensions or other tooling that supports MCP over stdio or HTTP.
- If you opt to run the HTTP server, ensure the chosen port is available and not blocked by a firewall.
Additional notes
Tips and common considerations:
- The server requires Go 1.25+; using older Go versions may lead to build or runtime issues.
- When using the HTTP server mode, provide a valid address/port so clients can connect. The exact flag for enabling HTTP mode may vary; consult the binary's help output (e.g., mcpgo --help) for the exact syntax.
- Use fetch_project_build_required_modules to see all modules used by the project, including any replace directives in go.mod.
- If the editor or tooling reports missing symbols, try list_package_details and list_stdlib_packages_symbols to understand what is available in the current module and the standard library.
- Since this project is archived in favor of gopls-mcp, consider migrating workflows to the newer MCP server if you need more capabilities or updated analyses.
Related MCP Servers
mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
kodit
š©āš» MCP server to index external repositories
github-brain
An experimental GitHub MCP server with local database.
bgg
BGG MCP provides access to BoardGameGeek and a variety of board game related data through the Model Context Protocol. Enabling retrieval and filtering of board game data, user collections, and profiles.
mcp
Teamwork.com MCP server
chromedp
MCP server for browser automation using chromedp