Labsco
MCP SERVER

AST2LLM for Go

by vprud

Give a model the Go type declarations it is missing — struct fields, interfaces, function types — resolved from the project's AST instead of grepped out of files.

Code Intelligence & Repository Indexing
Summary
Type facts instead of search results — and honest about its state.

One tool, one job: resolve the declarations the model would otherwise have to infer. The README lists what is not finished — occasional parsing errors, limited type support in the current version, and performance bottlenecks on large codebases — which is the right thing to know before you wire it into a daily workflow.

What it is

A local MCP server that parses a Go project with the Go AST and hands the model the declarations behind the identifiers in the file it is looking at. When the model needs to know what fields a struct has, it gets the actual declaration rather than a guess assembled from search results.

What you get
  • Project structure analyzed and external type declarations identified for a target file — `parse-go`
  • Context packaged for the prompt, so an imported struct comes back with its fields listed under its qualified name
  • Support for struct types, interface types, function types and global variables, with cross-file dependency resolution
Requirements

No account and no key — it runs entirely on your machine. A supported MCP client, and Go 1.22 or higher if you build from source. The install script detects OS and architecture: `curl -LsSf https://raw.githubusercontent.com/ast2llm/ast2llm-go/main/install.sh | sh`, with `-s -- --install-dir /usr/local/bin` to choose a location. Re-run the same command to update, and there is an uninstall script. Then add `ast2llm-go` as the command in your client's config and restart the IDE. Apache licensed.

Setup effort

One command — curl -LsSf https://raw.githubusercontent.com/ast2llm/ast2llm-go/main/install.sh | sh