MCP Gopls
未认领Model Context Protocol (MCP) server for Go using gopls – LSP-powered analysis, tests, coverage, and tooling.
安装
go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latest工具(16 个)
analyze_coverage
“Run analyzecoverage for ./pkg/... with per-function stats.”
check_diagnostics
“Request diagnostics for cmd/mcp-gopls/main.go.”
find_references
“Ask the tool for references to ServeStdio.”
format_document
“Run the formatter over pkg/tools/refactor.go.”
get_completion
“Trigger completions at pkg/server/server.go:55.”
get_hover_info
“Call gethoverinfo on pkg/tools/workspace.go:88.”
go_to_definition
“Use gotodefinition on pkg/server/server.go:42.”
list_code_actions
“List code actions for pkg/server/server.go:80-90.”
module_graph
“Call modulegraph to inspect dependencies.”
refactor_plan
“Feed refactorplan the diagnostics JSON to plan fixes.”
rename_symbol
“Rename clientFactory to newClientFactory via the tool.”
run_go_mod_tidy
“Invoke rungomodtidy to sync go.mod.”
run_go_test
“Execute rungotest on ./cmd/....”
run_govulncheck
“Run rungovulncheck and stream findings.”
search_workspace_symbols
“Search workspace symbols for NewWorkspaceConfig.”
summarize_diagnostics
“Use the summarizediagnostics prompt on the latest diagnostics.”