MCP Test Runner

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

Local test execution and coverage summaries for onboarding agents.

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

一個本機 MCP 伺服器,可執行 pytest 與 Jest 測試、解析其 JSON 輸出並彙總 pytest 覆蓋率,讓助理以實際執行結果驗證程式碼結論。

可以做什麼
在受限的工作目錄中執行 pytest 或 Jest 並回傳原始指令輸出,可設定逾時、CPU 與記憶體上限,並提供健康檢查用於快速驗證。執行單一 pytest 節點 ID 或依測試名稱樣式執行 Jest 測試。將 pytest 與 Jest 的 JSON 輸出正規化為統一的測試結果結構。從覆蓋率 JSON 檔彙總 pytest-cov 覆蓋率總計。
適用情境
適合助理在熟悉或分析程式碼庫時,以實際測試執行而非猜測來支撐結論,例如把陳述標記為已驗證、未驗證或被推翻。最適用於使用 pytest 的 Python 專案,或可使用 Jest 的 JavaScript 專案。
執行需求
以 Python 3.11+ 套件形式從 PyPI 本機安裝(發行名稱 lovranran-mcp-test-runner,主控台指令 mcp-test-runner),透過 stdio 執行。目標專案需要 pytest 及 pytest-json-report,覆蓋率需要 pytest-cov;Jest 透過 npx 執行,因此需要 Node.js 與可解析的 Jest。CPU 與記憶體限制依賴支援 resource.setrlimit 的 POSIX 平台。未宣告驗證、環境變數或標頭。
安裝前請注意
這些工具會在指定工作目錄中以子程序方式執行測試指令,因此只應指向你信任的專案;測試程式碼可執行任意指令。Jest 透過 npx 呼叫,若本機未安裝 Jest 可能會下載套件。資源限制僅限 POSIX,v1 沒有 Docker 隔離。覆蓋率彙總僅支援 pytest,執行類工具回傳原始輸出,需另行解析。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

mcp-test-runner

MCP server for deterministic local test execution and normalized test result reporting.

mcp-test-runner is the verification layer for codebase onboarding agents. It exposes focused MCP tools for running pytest and Jest, parsing test output, and summarizing coverage so downstream agents can mark claims as verified, unverified, or contradicted by real execution.

Codebase Onboarding Stack

mcp-test-runner is the verification layer in a three-server MCP tool stack for Project 6 wayfinder, a codebase onboarding agent.

  • mcp-repo-mapper maps repository structure, languages, entry points, framework evidence, and Python dependency edges.
  • mcp-ast-explorer provides symbol-grounded Python definition, signature, reference, call-chain, and class-hierarchy lookups.
  • mcp-test-runner runs local pytest/Jest checks and coverage summaries so agent claims can be verified against execution.

In wayfinder, this server turns high-risk code understanding claims into verified, unverified, or contradicted evidence from real test execution.

Status

This repository is a Python-first v1 MCP test runner. It supports bounded pytest execution, Jest command execution, single-test targeting, pytest coverage summaries, and normalized pytest/Jest JSON parsing.

The server does not use an LLM. Test results come from subprocess execution and structured parser output.

Tools

ToolPurpose
health()Returns ok for smoke checks.
run_pytest(path, test_filter?, timeout_seconds?, cpu_seconds?, memory_mb?)Run pytest in a bounded working directory and return raw command output.
run_jest(path, test_filter?, timeout_seconds?, cpu_seconds?, memory_mb?)Run Jest through npx jest and return raw command output.
run_single_test(path, test_id, framework?, timeout_seconds?, cpu_seconds?, memory_mb?)Run one pytest node id or one Jest test-name pattern.
parse_test_output(stdout, framework)Normalize test runner JSON output.
get_coverage_summary(path, framework?, timeout_seconds?, cpu_seconds?, memory_mb?)Return pytest-cov JSON coverage totals.

Supported Scope

  • Python 3.11+ package.
  • FastMCP 2.x server.
  • pytest execution with JSON report output via pytest-json-report.
  • Jest command execution via npx jest --json --outputFile.
  • pytest and Jest JSON normalization into one TestRunResult schema.
  • Single pytest node id execution and Jest test-name targeting.
  • pytest-cov coverage summary from .coverage.json.
  • Subprocess timeout plus POSIX resource.setrlimit CPU / memory caps.

Current Limitations

  • v1 does not use Docker. It uses cwd validation, subprocess timeouts, and POSIX resource limits.
  • Resource limits require a POSIX platform that supports resource.setrlimit.
  • Jest execution expects Node.js plus project-local or npx-resolvable Jest.
  • Jest single-test targeting uses --testNamePattern; it does not parse Jest file-specific node ids.
  • Coverage summary is pytest-only in v1.
  • Tools return raw command output for execution; call parse_test_output to normalize framework JSON.

Local Development

Install dependencies:

bash
uv sync --extra dev

The PyPI distribution name is lovranran-mcp-test-runner because mcp-test-runner is already taken on PyPI. The installed console script remains mcp-test-runner.

Run the MCP server:

bash
uv run mcp-test-runner

Run verification:

bash
uv run ruff check .uv run mypyuv run pytest

License

MIT

來源:README.md,提交 e24d639

工具

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

版本歷史

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

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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