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’

コメント

「その他」の他のコンテンツ