Regex Test Mcp

io.github.MukundaKatta由 GitHub 帳號 MukundaKatta 發布v0.1.0更新於 Oct 24, 2026

Trustworthy JS regex testing. Real offsets, named groups, safe against zero-width loops.

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

概覽

AI 產生的概覽

讓助理實際測試 JavaScript 正規表達式,回傳精確的符合位置、分組與取代結果。

可以做什麼
透過真正的 JavaScript 正規表達式引擎執行樣式,而不是憑空猜測。提供三個工具:test_regex 回傳第一個符合項目及其起訖位置、捕獲分組與具名分組;find_all 回傳所有不重疊的符合項目,且對零寬符合安全;replace 回傳取代後的字串與 replaced 布林值,支援 $1、$ 與 $& 語法。因此對前瞻、錨點、具名分組與 Unicode 轉義都能得到準確語意。
適用情境
適合需要驗證正規表達式而非直接斷定其行為的情境,例如確認某個樣式是否符合、在巢狀捕獲時取得正確的分組索引,或核對取代輸出。主要面向撰寫與除錯 JavaScript 樣式的開發者。
執行需求
以 stdio 程序在本機執行,透過 npx 從 npm 套件 @mukundakatta/regex-test-mcp 安裝。需要 Node.js 以及桌面版 MCP 用戶端,例如 Claude Desktop、Cursor、Cline、Windsurf 或 Zed。未宣告任何帳號、API 金鑰、環境變數或標頭。
安裝前請注意
此伺服器只評估傳入的樣式與文字,不會索取任何憑證或密鑰。樣式由 JavaScript 正規表達式引擎執行,因此異常的樣式可能很慢,甚至卡住程序;傳入的文字在本機處理,不會傳送給第三方。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

@mukundakatta/regex-test-mcp

MCP server for trustworthy regex testing. Three tools: test_regex, find_all, replace. All use the actual JS regex engine, so you get exact semantics for lookahead, anchors, named groups, and Unicode escapes.

Why this exists

LLMs reliably hallucinate regex behavior. Common ways they're wrong:

  • Confidently stating a pattern matches when it doesn't (or vice versa)
  • Wrong group indices when there are nested capture groups
  • Forgetting that . excludes newlines without the s flag
  • Hand-rolling replace results that miss edge cases ($& semantics, named-group syntax)

Routing the actual test through this MCP server avoids all of those.

Tools

ToolReturns
test_regex(pattern, text, flags?){matched, match, start, end, groups, named_groups} for the first match
find_all(pattern, text, flags?)All non-overlapping matches (always behaves as g); zero-width safe
replace(pattern, text, replacement, flags?)New string + replaced boolean; supports $1, $<name>, $&

Install — Claude Desktop

json
{  "mcpServers": {    "regex-test": { "command": "npx", "args": ["-y", "@mukundakatta/regex-test-mcp"] }  }}

Same shape for Cursor / Cline / Windsurf / Zed.

License

MIT OR Apache-2.0.

來源:packages/regex-test-mcp/README.md,提交 6fad5bb

工具

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

版本歷史

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

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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