godoc-mcp-server is an MCP (Model Context Protocol) server for Go programmers, used to search Go packages and their documentation information from pkg.go.dev, and provide this information for use by large language models.
-
Purpose This tool is mainly used to help Golang programmers query Go package information. Through the MCP protocol, it provides package search results and documentation information from pkg.go.dev to the LLM, enabling AI to obtain accurate package information during programming assistance.
-
Main capabilities
-
searchPackage: Searches Go packages. The returned results include subpackage names, but do not include the package name itself.
-
Displays how many packages a package is imported by (imported by how many packages).
-
getPackageInfo: Gets package information. The project description marks two to-dos (fixme): subpackages need a new adapter; examples need to be obtained.
-
Local cache (localCache): Optionally use a local cache to avoid searching every time (suggested by a Reddit user).
-
Release: Uses GitHub Actions for multi-platform releases.
-
How to use This server provides services through stdio; users can simply use a client to send requests. There are two installation methods:
-
Download the compiled binary file from the releases page.
-
Install from source and compile it yourself.
-
Development experience notes The project documentation particularly emphasizes the importance of tool descriptions. When describing parameters, you should tell the client how to use the output of one tool and adjust its format to match the input of another tool.
For example, the output of searchPackage includes the names of subpackages, but does not include the package name. Therefore, if you want the LLM to use getPackageInfo to obtain subpackage information, you need to write a description for the packageName parameter explaining how to use it together with searchPackage. The example description given in the documentation explains: if searchPackages was used previously and the user wants to obtain subpackage information, the two prefixes should be concatenated. For example, when the user queries mcp, and the returned packageName is github.com/mark3labs/mcp-go/mcp and the subpackage client, if the user wants to obtain information about the client package, packageN should beame should be set to github.com/mark3labs/mcp-go/mcp/client, not client alone.
After using this detailed description, the LLM will tell the user the subpackage names after searching. The user only needs to say which package's information they want to obtain, or which package plus subpackage name, and the LLM will concatenate them and call getPackageInfo to obtain the information. The documentation also mentions that perhaps the description should be made user-configurable, making the tool more practical and efficient.
-
Limitations and notes The Go API exported by this module should currently be regarded as unstable, and breaking changes may occur. Stability may be provided in the future; if needed, an issue can be submitted.
-
License This project uses the MIT open source license.
-
Applicable scenarios Suitable for all Golang programmers, especially in scenarios where Go package documentation and information need to be queried in an AI-assisted programming environment.