Connections & Capabilities
Connects To
Capabilities
Quickstart
Install
npx -y @mark3labs/mcp-inspector \Config
{
"mcpServers": {
"mcp-gopls": {
"command": "mcp-gopls",
"args": ["--workspace", "/absolute/path/to/your/go/project"],
"env": {
"MCP_GOPLS_LOG_LEVEL": "info"
}
}
}
}Exposed MCP Tools (14)
go_to_definitionNavigates to the definition of a specified symbol.
Read-only operation, no side effects.
find_referencesLists all references to a specified symbol.
Read-only operation, no side effects.
check_diagnosticsFetches cached diagnostics for a specified file.
Read-only operation, no side effects.
get_hover_infoReturns hover information for a symbol at a given position.
Read-only operation, no side effects.
get_completionReturns code completion suggestions at a given position.
Read-only operation, no side effects.
format_documentFormats the specified Go document.
Modifies the document, but generally non-destructive.
rename_symbolRenames a symbol throughout the workspace.
Modifies code structure, potential for errors.
list_code_actionsLists available code actions for a given range.
Code actions can modify code, review before applying.
search_workspace_symbolsSearches for symbols within the workspace.
Read-only operation, no side effects.
analyze_coverageAnalyzes code coverage for specified packages.
Read-only analysis, no code modification.
run_go_testExecutes Go tests for specified packages.
Can modify files (e.g., generate test coverage files).
run_go_mod_tidyRuns `go mod tidy` to synchronize the go.mod file.
Modifies go.mod and go.sum, potentially altering dependencies.
run_govulncheckRuns `govulncheck` to identify known vulnerabilities.
Read-only analysis, no code modification.
module_graphGenerates a module graph of dependencies.
Read-only operation, no side effects.
Safety Assessment
This server provides powerful code analysis and manipulation capabilities. It's safe for read-only operations like code navigation and diagnostics. However, running tests or applying code actions carries a moderate risk of unintended changes and should be carefully reviewed.
- Uses LSP for code analysis, which is generally safe.
- Provides structured logging for auditing.
- Allows configurable runtime parameters.
- Supports progress streaming for long-running commands.
- Can execute `go test`, `go mod tidy`, and `govulncheck`, which can modify the workspace.
- Exposes code actions that could potentially introduce unintended changes.
- Relies on the security of the underlying `gopls` LSP server.
- Requires access to the Go workspace, potentially exposing sensitive code.
