MCP.so
登录

MCP LSP Go

@hloiseaufcms

基本信息

分类

其他

许可证

Apache-2.0

传输方式

stdio

作者

hloiseaufcms

关于 MCP LSP Go

Model Context Protocol (MCP) server for Go using gopls – LSP-powered analysis, tests, coverage, and tooling.

MCP LSP Go 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "mcp-gopls": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "\\"
      ]
    }
  }
}

MCP LSP Go 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP LSP Go?

An MCP server that bridges AI assistants (Claude, Cursor, Copilot) with Go’s language server (gopls) to provide navigation, diagnostics, testing, coverage, and code tooling capabilities via the Model Context Protocol.

How to use MCP LSP Go?

Install with go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latest, then configure your AI client (Cursor, Claude Desktop, GitHub Copilot) to run mcp-gopls --workspace /absolute/path/to/your/go/project. A Docker image is also available for containerized setups.

Key features of MCP LSP Go

  • Configurable runtime via flags and environment variables
  • Structured logging with text or JSON output
  • Full LSP surface: navigation, diagnostics, formatting, rename, code actions
  • Go tooling helpers: test, coverage, mod tidy, vulncheck, module graph
  • Extra MCP resources and prompts for diagnostics and refactoring
  • Progress streaming for long-running operations

Use cases of MCP LSP Go

  • Navigate to symbol definitions and find references across a workspace
  • Run Go tests and analyze code coverage with per-function stats
  • Fetch diagnostics, hover information, and code completions for any file
  • Execute code formatting, renaming, and list available code actions
  • Inspect module dependencies and run vulnerability checks

常见问题

1

How does MCP LSP Go differ from the built-in gopls MCP server?

MCP LSP Go offers a richer tool set: go-to-definition, hover, completion, formatting, code actions, go test, coverage, mod tidy, and module graph—features absent from the built-in gopls MCP. The built-in server is sufficient for read-only tools like diagnostics and symbol search.

2

What are the runtime requirements?

The server is written in Go and tested with Go 1.25.x and `gopls@latest`. It runs as a stdio-based MCP server and can be configured via command-line flags or the `MCP_GOPLS_*` environment variables.

3

Does it support progress streaming?

Yes. Long-running commands emit `notifications/progress` events so clients can surface status updates to the user.

4

Can I use MCP LSP Go with Docker?

Yes. An official Docker image is available at `ghcr.io/hloiseau/mcp-gopls:latest`. You can mount your Go project as a volume and run `--workspace /workspace`.

5

How is the server configured for different AI clients?

The binary and arguments are identical across clients: `mcp-gopls --workspace /path/to/project`. Each client (Cursor, Claude Desktop, GitHub Copilot) uses a slightly different JSON configuration file to define the server’

评论

其他 分类下的更多 MCP 服务器