Skip to content
📄 main.go Ln 12, Col 12
11
12
13
func main() {
  r := gin.Default() -> what's the definition?
  r.Run()
⚡ MCP PROTOCOL TRACE
>> OUT (Request)
call_tool: go_definition
args: { "line": 12, "column": 12 }
<< IN (Response)
result: {
  "summary": "func Default() *Engine",
  "location": { "file": ".../gin.go", "line": 142 }
}

Stop LLMs guessing Go types.

gopls-mcp replaces expensive text search with compiler-backed precision, saving tokens, cutting latency, and preserving your agent’s critical attention span.

Claude Code

/plugin marketplace add https://github.com/xieyuschen/gopls-mcp.git
/plugin install gopls-mcp

Codex CLI

Terminal window
codex plugin marketplace add https://github.com/xieyuschen/gopls-mcp.git
codex plugin add gopls-mcp

The plugin installs the binary, registers the MCP server, and injects the tool-routing rules.

gopls-mcp offers fast and semantic accurate codebase analysis, perserves LLM attention and save your tokens.

go_symbol_references
user.go
Ln 18
18 func (u *User) Save() error
MCP PROTOCOL TRACE
>> OUT (Request)
call_tool: go_symbol_references
locator: { symbol_name: "Save", context_file: "user.go" }
<< IN (Response)
references: [
"login.go:42", "handler.go:15", "service.go:78"
]
go_definition
main.go
Ln 12
12 sum := Add(1, 2)
MCP PROTOCOL TRACE
>> OUT (Request)
call_tool: go_definition
locator: { symbol_name: "Add", context_file: "main.go" }
<< IN (Response)
{ signature: "func Add(a, b int) int", file: "math.go:15" }