Pmd

io.github.roeiba由 GitHub 帳號 roeiba 發布v0.1.2更新於 Oct 25, 2026

MCP server for PMD static code analyzer - run code analysis and detect duplicates

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

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理對原始碼執行 PMD 靜態程式碼分析器及其重複程式碼偵測器。

可以做什麼
對原始碼檔案執行 PMD 靜態分析,利用內建規則集在 Java、Apex 及多種其他語言中找出未使用變數、空的 catch 區塊等常見程式設計缺陷。使用內建的複製貼上偵測器(CPD)在多種語言中找出重複程式碼。將規則違規與重複程式碼結果回傳給助理以便檢視。
適用情境
適合希望助理不必離開對話就能檢查程式碼庫中的常見缺陷或重複程式碼,尤其是 Java、Apex 或其他支援語言的專案。
執行需求
透過 npm 套件 @springsoftware/pmd-mcp 以 stdio 傳輸在使用者機器上作為本機程序執行。僅限桌面端,不支援網頁執行。未宣告驗證、環境變數或標頭。PMD 本身是以 Java 為基礎的分析器,通常需要可用的 Java 環境。
安裝前請注意
分析會讀取你的原始碼檔案並把結果傳送給助理,因此不要指向無法與模型提供者分享的程式碼。未宣告任何憑證或寫入操作。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

PMD - source code analyzer

[PMD Logo]

[Join the chat] [Build Snapshot] [Maven Central] [Reproducible Builds] [Coverage Status] [Codacy Badge] [Contributor Covenant] [Documentation (latest)] [Gurubase] [Docker Image Version]

PMD is an extensible multilanguage static code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It's mainly concerned with Java and Apex, but supports 16 other languages. It comes with 400+ built-in rules. It can be extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees (AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query.

Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce, Kotlin, Swift, Modelica, PL/SQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL. Scala is supported, but there are currently no Scala rules available.

Additionally, it includes CPD, the copy-paste-detector. CPD finds duplicated code in Coco, C/C++, C#, CSS, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin, Lua, Matlab, Modelica, Objective-C, Perl, PHP, PL/SQL, Python, Ruby, Salesforce.com Apex and Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL.

🚀️ Installation and Usage

Download the latest binary zip from the releases and extract it somewhere.

Execute bin/pmd check or bin\pmd.bat check.

See also Getting Started

Demo:

This shows how PMD analyses openjdk:

[Demo]

There are plugins for Maven and Gradle as well as for various IDEs. See Tools / Integrations

ℹ️ How to get support?

🤝️ Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Our latest source of PMD can be found on GitHub. Fork us!

For details, see How to contribute to PMD.

The rule designer is developed over at pmd/pmd-designer. Please see its README for developer documentation.

💵️ Financial Contributors

Become a financial contributor and help us sustain our community. Contribute

✨️ Contributors

This project follows the all-contributors specification. Contributions of any kind welcome!

See credits for the complete list.

📝️ License

BSD Style

來源:README.md,提交 887f19a

工具

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

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

    請在儲存庫或註冊中心條目中宣告授權條款。