mcp-golang is an unofficial Go implementation of the Model Context Protocol (MCP), with the goal of writing MCP servers and clients in a small amount of Go code. Official documentation is located at https://mcpgolang.com,项目由 Metoro(https://metoro.io)创建,代码仓库为 https://github.com/metoro-io/mcp-golang。
In terms of purpose, this project targets scenarios that require implementing an MCP server or client in Go, allowing tools, prompts, and resources to be defined and MCP capabilities to be exposed through built-in transports or custom transports.
Main capabilities include: type safety, where tool parameters can be defined as native Go structs, with the library handling automatic schema generation, deserialization, and error handling; low boilerplate code, where in addition to tools, prompts, and resources, MCP endpoints are generated by the library, and it supports programmatically generating tool list, prompt list, and resource list endpoints as well as change notifications; modularity, where the library is split into three components: transport, protocol, and server/client, which can be used as needed; bidirectional communication, with full support for server and client implementations through the stdio transport; transport extensibility, with built-in stdio and HTTP transports and also support for custom transports.
Usage: the installation command is go get github.com/metoro-io/mcp-golang. To create an HTTP server, the standard HTTP transport or the Gin framework can be used; however, HTTP transports are stateless and do not support bidirectional features such as notifications, so the stdio transport should be used when these features are needed. A complete client example can be found in the examples/client directory. To use it with Claude Desktop, a configuration file needs to be created at ~/Library/Application Support/Claude/claude_desktop_config.json; the material gives this path but does not show the specific configuration content. The project welcomes contributions, and contribution guidelines can be found in the repository; questions about the API or usage can be asked to the maintainers on the Discord server.
Applicable scenarios: suitable for developers who need to build an MCP server or client in Go, especially projects that want to define tool parameters with native structs, reduce endpoint boilerplate code, implement bidirectional communication through stdio, or provide simple request-response interfaces through stateless HTTP/Gin. Examples listed in the repository include Metoro: querying and operating Kubernetes environments monitored by Metoro.
Limitations: this project is an unofficial implementation; HTTP and Gin transports are both stateless and do not support notifications; HTTPS custom authentication support is still under development and has not yet become part of the specification, belonging to planned experimental support. The material does not provide pricing, platform requirements, performance data, or specific HTTP/Claude Desktop configuration code.