Logo de Test Coverage MCP

Test Coverage MCP

Communauté
goldbergyoni

Context engineering: Make your agents aware of how they affect đŸ§Ș test coverageđŸ§Ș during a coding session

Éditeurgoldbergyoni
DépÎttest-coverage-mcp
LangueTypeScript
Forks
1
Étoiles
41
Outils disponibles
4
Type de transportstdio
Catégories
Liens
  • Connectez des outils Ă  vos workflows IA

    Test Coverage MCP propose des fonctionnalités MCP utilisables par les clients et agents IA compatibles.

  • 4 outils disponibles

    Parcourez les actions invocables ci-dessous, avec leurs noms et descriptions lorsque le serveur les fournit.

  • Configuration prĂȘte Ă  copier

    Utilisez les exemples de configuration pour configurer ce serveur dans votre client MCP préféré.

  • Indicateurs de popularitĂ© open source

    41 étoiles et 1 forks sur le dépÎt associé.

Test Coverage MCP

npm version License: MIT Coverage CI Last Commit

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:

typescript
// 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:

typescript
// At session start - record current coverage as baseline
start_recording({ lcovPath: "./coverage/lcov.info" });
// Returns: "Recording started"

// ... agent writes code and tests ...

// Check coverage impact
get_diff_since_start({ lcovPath: "./coverage/lcov.info" });
// Returns: { linesPercentageImpact: +2.3, branchesPercentageImpact: +1.8 }

Why baseline tracking? Without it, agents would need to keep initial coverage in their stateful memory throughout the session, consuming valuable context window space.

Installation

bash
npm install -g test-coverage-mcp

Configuration

Add this MCP server to your AI coding tool's configuration:

Claude Desktop (Claude Code)

macOS: Edit ~/Library/Application Support/Claude/claude_desktop_config.json Windows: Edit %APPDATA%\Claude\claude_desktop_config.json

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

After updating, restart Claude Desktop.

Cursor IDE

Create or edit .cursor/mcp.json in your project root:

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

GitHub Copilot (VS Code)

Create or edit .vscode/mcp.json in your workspace:

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

Requires VS Code 1.99+ or Visual Studio 17.14+. Enterprise users need "MCP servers in Copilot" policy enabled.

Windsurf (Codeium IDE)

macOS: Edit ~/.codeium/windsurf/mcp_config.json Windows: Edit %APPDATA%\Codeium\Windsurf\mcp_config.json Linux: Edit ~/.codeium/windsurf/mcp_config.json

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

Or use the GUI: Settings → Advanced Settings → Cascade → Add Server

Available Tools

coverage_summary

Get overall project coverage from an LCOV file.

Input:

typescript
{
  lcovPath?: string  // Optional. Defaults to "./coverage/lcov.info"
}

Output:

typescript
{
  linesCoveragePercentage: number,      // 0-100
  branchesCoveragePercentage: number    // 0-100
}

Example:

typescript
coverage_summary({ lcovPath: "./coverage/lcov.info" });
// { linesCoveragePercentage: 87.5, branchesCoveragePercentage: 82.1 }

coverage_file_summary

Get coverage for a specific file.

Input:

typescript
{
  lcovPath?: string,  // Optional. Defaults to "./coverage/lcov.info"
  filePath: string    // Required. Path to the file
}

Output:

typescript
{
  path: string,
  linesCoveragePercentage: number,      // 0-100
  branchesCoveragePercentage: number    // 0-100
}

Example:

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

start_recording

Record current coverage as a baseline for later comparison.

Input:

typescript
{
  lcovPath: string; // Required. Path to LCOV file to record
}

Output:

typescript
"Recording started";

Example:

typescript
start_recording({ lcovPath: "./coverage/lcov.info" });
// "Recording started"

get_diff_since_start

Compare current coverage against the recorded baseline.

Input:

typescript
{
  lcovPath: string; // Required. Path to current LCOV file
}

Output:

typescript
{
  linesPercentageImpact: number,      // Positive = improvement, negative = regression
  branchesPercentageImpact: number    // Positive = improvement, negative = regression
}

Example:

typescript
get_diff_since_start({ lcovPath: "./coverage/lcov.info" });
// { linesPercentageImpact: +2.3, branchesPercentageImpact: +1.8 }

Usage Examples

Example 1: Check Coverage Before Starting Work

Agent: "Let me check the current test coverage before I start working"
[Uses coverage_summary tool]
Agent: "Current coverage is 87.5% lines and 82.1% branches. I'll aim to maintain or improve this."

Example 2: Track Coverage Impact During Development

Agent: "I'll record the baseline coverage first"
[Uses start_recording tool]

Agent: "Now I'll add the new authentication feature with tests"
[Writes code and tests]

Agent: "Let me check the coverage impact"
[Uses get_diff_since_start tool]
Agent: "Great! Coverage increased by 2.3% for lines and 1.8% for branches."

Example 3: Verify Specific File Coverage

Agent: "Let me check coverage for the file I just modified"
[Uses coverage_file_summary with filePath: "src/auth/validator.ts"]
Agent: "The validator.ts file now has 95% line coverage and 92% branch coverage."

How It Works

This MCP server:

  1. Parses LCOV files using a production-grade parser that handles all LCOV format variations
  2. Calculates coverage percentages for overall project or individual files
  3. Stores baselines in a temporary directory for session-based tracking
  4. Returns compact JSON responses that consume minimal tokens

LCOV Format Support

This server supports all standard LCOV file formats, including:

  • Files with summary sections (SF:, end_of_record)
  • Files with line-by-line data only (DA: entries)
  • Files with branch coverage data (BRDA:, BRF:, BRH:)
  • Mixed formats within the same file

Troubleshooting

"LCOV file not found"

  • Ensure you've run your test suite with coverage enabled first
  • Check that the path to your LCOV file is correct (relative paths are resolved from current working directory)
  • Default path is ./coverage/lcov.info

"No coverage data found for file"

  • Verify the file path matches exactly as it appears in the LCOV file
  • Some test frameworks use absolute paths, others use relative paths

"No baseline recording found"

  • You must call start_recording before calling get_diff_since_start
  • Baselines are stored in temporary storage and cleared when the system restarts

Development

bash
# Install dependencies
npm install

# Build
npm run build

# Run tests (with coverage!)
npm test

# Run linter
npm run lint

# Test with MCP inspector
npm run inspect

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © Yoni Goldberg

Links

Improvement ideas

  • coverage_file_summary returns nested properties also declared as flat
  • Start recording overrides other sessions files
  • Improve record naming - setSessionBaseline, getDiffSinceBaseline

Installation

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

Outils disponibles

  • coverage_summary

    Analyzes an LCOV coverage file and returns overall project line coverage percentage. Use this before making code changes to establish a baseline or after changes to verify impact.

  • coverage_file_summary

    Analyzes an LCOV coverage file and returns line coverage percentage for a specific file. Use this to check coverage for individual files.

  • start_recording

    Records the current coverage as a baseline snapshot. Use this before making code changes to later compare against.

  • get_diff_since_start

    Compares current coverage against the recorded baseline and returns the impact (positive or negative). Use this after making changes to see coverage impact.

Utilisez le serveur MCP Test Coverage MCP avec plusieurs modĂšles IA

TypingMind connecte les outils MCP au niveau de l’espace de travail. Une fois Test Coverage MCP connectĂ©, vous pouvez donc l’utiliser avec diffĂ©rents modĂšles IA dans TypingMind sans avoir Ă  le configurer sĂ©parĂ©ment pour chaque modĂšle. Cette intĂ©gration MCP s’exĂ©cute localement sur votre appareil via le connecteur MCP de TypingMind.

Guide de configuration du connecteur local

Choisissez cette méthode si le serveur MCP doit accéder à des fichiers locaux, à des applications ou à des ressources privées sur votre ordinateur.

1

Ouvrir les paramĂštres MCP

Dans TypingMind, accédez à « ParamÚtres », puis à « ParamÚtres avancés » et à « Model Context Protocol », et choisissez « Configurer connecteur ».

  1. Ouvrez TypingMind dans votre navigateur.
  2. Cliquez sur l’icîne Paramùtres.
  3. Accédez aux paramÚtres avancés.
  4. Ouvrez la section Model Context Protocol.
  5. Cliquez sur « Configurer connecteur » et choisissez « Cet appareil ».
Écran de configuration du connecteur MCP de TypingMind avec l’option « Cet appareil » sĂ©lectionnĂ©e
2

Exécuter la commande du connecteur

Choisissez « Cet appareil », copiez la commande depuis TypingMind et exĂ©cutez-la dans Terminal. Laissez le processus en cours d’exĂ©cution pendant que vous utilisez MCP.

  1. Copiez la commande de configuration affichée par TypingMind.
  2. Ouvrez Terminal sur macOS ou Windows Terminal sur Windows.
  3. Collez et exécutez la commande.
  4. Autorisez l’installation du paquet si Terminal vous demande de confirmer.
  5. Gardez la fenĂȘtre de Terminal ouverte et le processus en cours d’exĂ©cution pendant que vous utilisez les outils MCP.
3

Ajoutez Test Coverage MCP en tant que serveur

Lorsque l’état du connecteur affiche « PrĂȘt », cliquez sur « Éditer serveurs » et collez la configuration du serveur MCP.

  1. Attendez que l’état du connecteur affiche « PrĂȘt ».
  2. Cliquez sur « Éditer serveurs ».
  3. Collez la configuration du serveur MCP Test Coverage MCP.
  4. Enregistrez la liste des serveurs.
  5. Actualisez pour vĂ©rifier que le connecteur est toujours prĂȘt.
ParamĂštres MCP de TypingMind affichant un serveur actif et le bouton « Éditer serveurs »
{
  "mcpServers": {
    "test-coverage-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "test-coverage-mcp"
      ]
    }
  }
}
4

Utiliser la connexion avec différents modÚles

Enregistrez la liste des serveurs, ouvrez « Plugins », activez les outils MCP de Test Coverage MCP, puis sélectionnez un modÚle IA compatible dans TypingMind et utilisez les outils dans une discussion ou attribuez-les à un agent IA.

  1. Ouvrez la page Plugins dans TypingMind.
  2. Activez les outils MCP de Test Coverage MCP.
  3. Démarrez une discussion et choisissez le modÚle IA que vous souhaitez utiliser.
  4. Utilisez les outils MCP dans le chat ou attribuez-les Ă  un agent IA.
  5. Passez à un autre modÚle IA selon vos besoins sans rétablir la connexion MCP.
Discussion TypingMind utilisant des outils MCP activĂ©s avec un modĂšle d’IA sĂ©lectionnĂ©
Pouvez-vous utiliser Test Coverage MCP pour m’aider dans cette tñche ?
Test Coverage MCP
Bien sĂ»r. J’ai tout lu.
Voici ce que j’ai trouvĂ© avec Test Coverage MCP.

Foire aux questions

À quoi sert le serveur MCP Test Coverage MCP ?

Test Coverage MCP est un serveur MCP qui permet aux applications IA compatibles d’accĂ©der Ă  des outils et Ă  des informations contextuelles externes. Dans TypingMind, il vous suffit d’ajouter ce serveur MCP une seule fois pour rendre ses outils disponibles dans votre espace de travail IA.

Puis-je utiliser le serveur MCP Test Coverage MCP avec plusieurs modĂšles IA dans TypingMind ?

Oui. TypingMind connecte les outils MCP au niveau de l’espace de travail. Vous pouvez donc utiliser Test Coverage MCP avec diffĂ©rents modĂšles IA comme Claude, ChatGPT, Gemini ou d’autres modĂšles configurĂ©s dans TypingMind, sans avoir Ă  configurer le serveur MCP sĂ©parĂ©ment pour chaque modĂšle.

Pourquoi utiliser le connecteur MCP Test Coverage MCP avec TypingMind ?

TypingMind est l’une des meilleures interfaces de chat avec les LLM, car elle rĂ©unit plusieurs modĂšles IA, prompts, plugins, agents IA, clĂ©s API et outils MCP dans un seul espace de travail. Une fois Test Coverage MCP connectĂ©, vous pouvez utiliser ses outils MCP avec vos modĂšles prĂ©fĂ©rĂ©s tout en gardant vos discussions bien organisĂ©es dans TypingMind.

Comment connecter le serveur MCP Test Coverage MCP Ă  TypingMind ?

Test Coverage MCP fonctionne via le connecteur MCP local de TypingMind. C’est l’option idĂ©ale lorsque le serveur MCP doit accĂ©der Ă  des fichiers locaux, des applications de bureau, des outils en ligne de commande ou des ressources privĂ©es sur votre ordinateur.

Quels outils le serveur MCP Test Coverage MCP propose-t-il dans TypingMind ?

Test Coverage MCP propose 4 outils MCP que vous pouvez activer depuis la page Plugins de TypingMind et utiliser dans les discussions ou attribuer Ă  des agents IA.

Dois-je partager mes clés API avec TypingMind pour utiliser le serveur MCP Test Coverage MCP ?

Non. TypingMind privilĂ©gie le fonctionnement local et vous permet de garder le contrĂŽle de vos fournisseurs de modĂšles, clĂ©s API, prompts et paramĂštres MCP. Si Test Coverage MCP nĂ©cessite une authentification, ajoutez les en-tĂȘtes, les paramĂštres OAuth ou la configuration locale requis pour ce serveur MCP lors de la crĂ©ation de la connexion.

Serveurs MCP similaires

Tout voir

Créez votre propre espace IA dÚs maintenant

Abonnez-vous Ă  notre newsletter pour ĂȘtre informĂ© des nouvelles fonctionnalitĂ©s et des prochains cadeaux Ă  gagner 👇