Go language server for intelligent code completion, diagnostics, and refactoring in Go projects.
## Go Language Server MCP: Intelligent Go Development with gopls The **Go Language Server MCP** integrates gopls, the official Go language server, directly into Google Antigravity. Get intelligent code completion, real-time diagnostics, and powerful navigation for Go projects with full module support. ### Why Go LSP MCP? Go's simplicity is its strength, but modern tooling makes it even better. The gopls MCP provides: - **Fast Completions**: Lightning-fast suggestions with type information - **Module Support**: Full Go modules and workspace handling - **Error Detection**: Catch issues before running go build - **Code Navigation**: Jump to definitions across packages - **Refactoring**: Safe rename and extract operations ### Key Features #### 1. Intelligent Completions Context-aware Go suggestions: ``` "Complete this struct field" "Show available methods on this type" "Suggest error handling patterns" "Auto-import missing packages" ``` #### 2. Diagnostics Real-time error checking: - Type errors and mismatches - Unused imports and variables - Missing return statements - Interface implementation checks #### 3. Code Navigation Explore your codebase: - Go to definition (including stdlib) - Find all references - Show implementations of interfaces - Navigate to tests #### 4. Formatting and Organization Keep code clean: - gofmt integration - goimports for import management - Organize imports automatically ### Configuration ```json { "mcpServers": { "gopls": { "command": "gopls", "args": ["serve", "--mcp"], "env": { "GOPATH": "~/go", "GO111MODULE": "on" } } } } ``` ### Best Practices 1. **Use Go Modules**: gopls works best with modules enabled 2. **Workspace Mode**: Configure for multi-module repositories 3. **Build Tags**: Set up build constraints properly 4. **Staticcheck**: Enable additional analyzers for more lints The Go LSP MCP brings IDE-quality Go development to Google Antigravity with the speed Go developers expect.
{
"mcpServers": {
"gopls": {}
}
}