Skip to main content
Glama

mcp-gopls

MCP LSP ゴー

Claude のような AI アシスタントが Go の Language Server Protocol (LSP) と対話し、高度な Go コード分析機能のメリットを享受できるようにする Model Context Protocol (MCP) サーバー。

概要

この MCP サーバーは、AI アシスタントが次のことを実行できるように支援します。

  • LSPを使ってGoコードを分析する
  • 定義に移動して参照を見つける
  • コード診断をチェックする
  • シンボルのホバー情報を取得する
  • 補完候補を取得する

建築

このプロジェクトでは、mark3labs/mcp-goライブラリを使用してモデルコンテキストプロトコル(MCP)を実装しています。MCPとの統合により、AIアシスタントとGoツール間のシームレスな通信が可能になります。

サーバーは、言語サーバー プロトコル (LSP) を介して、Go の公式言語サーバーであるgoplsと通信します。

特徴

  • LSP 統合: コード分析のための Go の言語サーバー プロトコルへの接続
  • コードナビゲーション: コード内の定義と参照を見つける
  • コード品質: 診断とエラーの取得
  • 詳細情報: ホバー情報と補完候補

プロジェクト構造

. ├── cmd │ └── mcp-gopls # Application entry point ├── pkg │ ├── lsp # LSP client to communicate with gopls │ │ ├── client # LSP client implementation │ │ └── protocol # LSP protocol types and features │ ├── server # MCP server │ └── tools # MCP tools exposing LSP features

インストール

go install github.com/hloiseaufcms/mcp-gopls/cmd/mcp-gopls@latest

カーソルに追加

{ "mcpServers": { "mcp-gopls": { "command": "mcp-gopls" } } }

MCPツール

MCP サーバーは次のツールを提供します。

道具説明
go_to_definitionシンボルの定義に移動する
find_referencesシンボルへのすべての参照を検索する
check_diagnosticsファイルの診断情報を取得する
get_hover_infoシンボルの詳細情報を取得する
get_completion位置の完了候補を取得する
analyze_coverageGoコードのテストカバレッジを分析する

使用例

MCP をサポートする AI アシスタントでサーバーを使用する:

# Ask the AI to get information about the code Can you find the definition of the `ServeStdio` function in this project? # Ask for diagnostics Are there any errors in my main.go file? # Ask for information about a symbol What does the Context.WithTimeout function do in Go?

発達

git clone https://github.com/hloiseaufcms/mcp-gopls.git cd mcp-gopls go mod tidy go build -o mcp-gopls cmd/mcp-gopls/main.go ./mcp-gopls

前提条件

  • Go 1.24以上
  • gopls がインストールされていること ( go install golang.org/x/tools/gopls@latest )

ライセンス

Apacheライセンス2.0

-
security - not tested
-
license - not tested
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Claude のような AI アシスタントが Go の Language Server Protocol (LSP) と対話し、高度な Go コード分析機能のメリットを享受できるようにする Model Context Protocol (MCP) サーバー。

  1. 概要
    1. 建築
      1. 特徴
        1. プロジェクト構造
          1. インストール
            1. カーソルに追加
              1. MCPツール
                1. 使用例
                  1. 発達
                    1. 前提条件
                      1. ライセンス

                        Related MCP Servers

                        • A
                          security
                          F
                          license
                          A
                          quality
                          Model Context Protocol (MCP) server that integrates Redash with AI assistants like Claude, allowing them to query data, manage visualizations, and interact with dashboards through natural language.
                          Last updated -
                          10
                          104
                          21
                          JavaScript
                          • Apple
                        • A
                          security
                          A
                          license
                          A
                          quality
                          A Model Context Protocol (MCP) server that enables AI assistants to control and interact with Android devices, allowing for device management, app debugging, system analysis, and UI automation through natural language commands.
                          Last updated -
                          29
                          143
                          Python
                          Apache 2.0
                          • Linux
                          • Apple
                        • A
                          security
                          F
                          license
                          A
                          quality
                          A Model Context Protocol (MCP) server that integrates with OmniFocus to enable Claude (or other MCP-compatible AI assistants) to interact with your tasks and projects.
                          Last updated -
                          7
                          163
                          15
                          TypeScript
                        • A
                          security
                          A
                          license
                          A
                          quality
                          A foundation for building custom local Model Context Protocol (MCP) servers that provide tools accessible to AI assistants like Cursor or Claude Desktop.
                          Last updated -
                          1
                          9
                          TypeScript
                          MIT License

                        View all related MCP servers

                        MCP directory API

                        We provide all the information about MCP servers via our MCP API.

                        curl -X GET 'https://glama.ai/api/mcp/v1/servers/hloiseaufcms/mcp-gopls'

                        If you have feedback or need assistance with the MCP directory API, please join our Discord server