GT

goldbergyoni/test-coverage-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

42 stars 2 forks 质量 63 趋势 0

Goldbergyoni/test-coverage-mcp 是从 https://github.com/goldbergyoni/test-coverage-mcp. 导入的 MCP 服务器候选

概览

Goldbergyoni/test-coverage-mcp 是从 https://github.com/goldbergyoni/test-coverage-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

让你的代理人在为你编码时保持保险覆盖意识

“嘿,我是编码代理。我刚做了一个炫酷又炫酷的功能…但糟糕,我把覆盖🤓范围降级了。我怎么会知道?”

“嘿,我是测试代理。我被指派用测试覆盖一些代码,但我怎么知道哪些领域没覆盖?” 😳

给你的编码和测试代理关注:MCP服务器,提供即时、可靠、高效的测试覆盖率,适用于任何编程语言(基于LCOV)。

__

🚀 刚刚上线(2025年11月)!我最近花了很多时间打磨这个库。如果你觉得有价值,星星⭐能向其他开发者传递这个项目值得关注的信号

问题

当AI编码代理在没有适当覆盖工具的情况下处理你的代码时,他们会面临三个关键问题:

  1. 覆盖盲点 - 他们无法判断自己的更改是否改善了或倒退了测试覆盖率
  2. 令牌浪费 - 他们为了解析大量LCOV文件(有些超过10 MB)而销毁了数千个令牌
  3. 不可靠的脚本 - 他们即兴制作自定义解析脚本,但经常失败或产生错误结果

解决方案

该MCP服务器通过提供以下功能解决了这三个问题:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Test Coverage MCP

Make your agents coverage-aware as they code for you

“Hey, I’m a coding agent. I just created flashy nifty feature… but oops, I downgraded the coverage 🤓. How could I know that?”

“Hey, I’m a testing agent. I was tasked to cover some code with testing, but how can I find which areas are not covered?😳”

Give your coding and testing agent eyes: MCP server that provides instant, reliable, token-efficient test coverage data for any programming language (LCOV based)

__

🚀 Just launched (November 2025) ! I spend great time these days on polishing this library. If you find this valuable, a ⭐ star helps signal to other developers that this project is worth their attention

The Problem

When AI coding agents work on your code without proper coverage tooling, they face three critical issues:

  1. Coverage Blindness - They can’t see if their changes improved or regressed test coverage
  2. Token Waste - They burn thousands of tokens trying to parse massive LCOV files (some exceed 10 MB)
  3. Unreliable Scripts - They improvise custom parsing scripts that often fail or produce incorrect results

The Solution

This MCP server solves all three problems by providing:

  • Coverage Awareness - Agents can check coverage anytime with a simple tool call
  • Token Efficiency - Get coverage summaries in <100 tokens instead of thousands
  • Accuracy - Production-grade LCOV parsing that handles all format variations
  • Baseline Tracking - Measure coverage progress within a session without keeping state in memory

Test Coverage: This project maintains 95% test coverage and we’re targeting 100% soon.

Two Main Workflows

1. Query Coverage Summary

Ask for overall project coverage or coverage for specific files:

// Get overall project coverage
coverage_summary({ lcovPath: "./coverage/lcov.info" });
// Returns: { linesCoveragePercentage: 87.5, branchesCoveragePercentage: 82.1 }

// Get coverage for specific files
coverage_file_summary({
  lcovPath: "./coverage/lcov.info",
  filePath: "src/utils/parser.ts",
});
// Returns: { path: "src/utils/parser.ts", linesCoveragePercentage: 92.0, branchesCoveragePercentage: 88.5 }

2. Baseline Tracking for Session Progress

Establish a baseline at session start, then measure your progress:

// At session start - record current coverage as baseline
start_recording({ lcovPath: "./coverage/lcov.info" });
// Returns: "Recording started"
在 GitHub 查看完整 README

安装

npx -y test-coverage-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "test-coverage": { "command": "npx", "args": ["-y", "test-coverage-mcp"] } } }