Gopls Mcp

io.github.xieyuschen由 GitHub 帳號 xieyuschen 發布v1.0.7更新於 Oct 24, 2026

Semantic code analysis for Go using gopls - language-aware navigation, definitions, references

已驗證STDIO僅桌面開發者工具

概覽

AI 產生的概覽

透過 gopls 讓助理對 Go 程式碼進行編譯器層級的語意分析:定義、參照、介面實作與呼叫階層。

可以做什麼
gopls-mcp 透過 Go 語言伺服器 gopls 提供 Go 語意分析,讓助理依語意而非文字比對來瀏覽程式碼。它能解析型別系統,包括介面滿足關係、跨套件識別以及被遮蔽的範圍,適合用來找出實作某介面的所有具體型別、追蹤呼叫階層、梳理套件相依關係。README 提到一項涵蓋 11 個任務的基準測試,在語意任務上它比以 grep 為主的瀏覽方式少用 2 至 4 倍的工具呼叫並更快完成。
適用情境
當助理需要處理 Go 程式庫並回答語意問題時值得加入,例如哪些型別實作了某個介面、呼叫如何串接、套件之間如何相依。對於單一檔案內的簡單查找,README 指出一般 grep 同樣有效且額外負擔較小。
執行需求
以本機程序方式在使用者機器上透過 stdio 執行,僅限桌面端。清單中未宣告任何套件、環境變數、標頭或身分驗證。安裝方式包括 Claude Code 或 Codex 外掛,以及適用於 Linux、macOS 與 Windows 的手動安裝指令碼,之後再依用戶端進行設定。
安裝前請注意
README 的手動安裝說明把遠端安裝指令碼直接管線交給 shell 執行,會在你的機器上執行第三方程式碼;外掛方式被描述為建議的替代做法。此伺服器會讀取你的 Go 原始碼並把分析結果傳送給助理,因此應把工作區中的程式碼視為對模型可見。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Gopls Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

gopls-mcp

Give your AI Agent the compiler's brain, not a text searcher.

Documentation: https://gopls-mcp.org

gopls-mcp delivers type-checker-level semantic analysis directly to your LLM. Unlike text search, it resolves Go's type system — interface satisfaction, cross-package identity, and shadowed scopes — with the same precision as the compiler.

Where it pays off most is on semantic tasks: finding all concrete types that implement an interface, tracing call hierarchies, and mapping package dependencies. A benchmark over 11 tasks shows gopls-mcp uses 2–4× fewer tool calls and finishes faster than grep-based navigation on those tasks. For simple same-file lookups, plain bash/grep remains equally effective and carries less overhead.

Install

Claude Code (plugin — recommended)

/plugin marketplace add https://github.com/xieyuschen/gopls-mcp.git/plugin install gopls-mcp

The plugin automatically installs the binary and injects the routing skill — no manual setup required.

Codex (plugin — recommended)

bash
codex plugin marketplace add https://github.com/xieyuschen/gopls-mcp.gitcodex plugin add gopls-mcp

Manual install (all clients)

Linux / macOS:

bash
curl -sSL https://gopls-mcp.org/install.sh | bash

Windows (PowerShell):

powershell
irm https://gopls-mcp.org/install.ps1 | iex

Then follow the per-client setup at https://gopls-mcp.org/quick-start.

Contribute

The project is actively developing, and feel free to raise PRs or issues if you find anything to improve. AI generated code will also be accepted but do remember to narrow the change to a specific feature for reviewer to quickly review them.

Disclaimer: gopls-mcp is a fork of gopls and is a community-driven project. It is not an official Go team product and is not affiliated with or endorsed by Google LLC. This project is licensed under the same BSD license as its upstream source.

來源:README.md,提交 2a45722

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.7最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分