# Coveralls MCP

> Coveralls Code Coverage Analytics API tracks your code quality metrics by managing repositories, submitting coverage reports, and monitoring build statuses through natural conversation with your AI agent.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** code-coverage, ci-cd, testing, quality-assurance, static-analysis

## Description

Your agent connects to this MCP when you need to know if a feature release is stable. Instead of navigating multiple CI/CD dashboards or digging through log files, you ask your AI client for the current code coverage status. It checks the latest reports and tells you exactly what's missing—which test suite failed or which file dropped below the acceptable quality threshold. This MCP lets you manage everything from setting up new repositories to triggering a full build rerun if something looks suspicious. Because it provides deep visibility into your commit history and testing results, it’s essential for maintaining high code quality standards. Vinkius makes this connection easy; just link your agent once and gain access to all these developer tools.

## Tools

### close_parallel_build
Closes an active, parallel build sequence within the Coveralls system.

### create_repo
Creates a brand new repository entry on Coveralls for tracking coverage metrics.

### get_build_web_data
Retrieves the raw JSON data from a specific build's web page, allowing deep analysis of its results.

### get_file_web_data
Pulls the JSON representation for a single source file’s web page, useful for checking file-specific coverage details.

### get_job_web_data
Gets the raw JSON data from an individual job's web page, showing what happened during that specific test run.

### get_repo
Retrieves fundamental information about a repository from Coveralls using its API token.

### get_repo_web_data
Fetches the JSON data for an entire repository's web page, giving an overview of its history and status.

### rerun_build
Triggers a complete recalculation or rerun of existing build processing to resolve temporary errors.

### submit_job
Submits a full coverage report (a job) using source files and Git metadata for tracking purposes.

### update_repo
Modifies the details of an existing repository on Coveralls, like changing its name or tokens.

## Prompt Examples

**Prompt:** 
```
Get the repository details and token for github/vurb-ai/mcp-server.
```

**Response:** 
```
I've retrieved the details for 'vurb-ai/mcp-server'. The repository is active, and your repo_token is `abc123xyz...`. Coverage is currently tracking at 92.5%.
```

**Prompt:** 
```
Update the coverage threshold for github/my-org/app to fail if it drops below 80%.
```

**Response:** 
```
I've updated the repository settings for 'my-org/app'. The `commit_status_fail_threshold` is now set to 80. Any builds with coverage below this will be marked as failed.
```

**Prompt:** 
```
Rerun the processing for build number 45678 on Coveralls.
```

**Response:** 
```
Triggering a rerun for build #45678... The request was successful, and Coveralls is now re-calculating the coverage data for that build.
```

## Capabilities

### Manage Code Repositories
Create or update the configuration details and tokens for multiple version control repositories.

### Report Coverage Data
Send detailed test reports, including source file data and Git metadata, to track coverage improvements.

### Check Build Status History
Fetch structured JSON data about specific build web pages or entire repository health records for deep analysis.

### Control CI/CD Pipelines
Manage complex parallel builds by triggering final calculations or closing active build sequences.

### Fix Build Issues
Trigger a rerun of the build processing when you spot transient errors that need re-checking.

## Use Cases

### Investigating a Sudden Drop in Coverage
A developer notices coverage dropped below 90% after a merge. They ask their agent to analyze the last build's raw data, triggering `get_build_web_data`. The agent identifies which source file (`get_file_web_data`) is missing test cases so they can fix it immediately.

### Setting up a New Microservice
The DevOps engineer needs to track a new service. They first use `create_repo` to initialize the coverage tracking, then connect their CI/CD pipeline to submit initial reports using `submit_job`.

### Dealing with Stalled Builds
The QA lead sees multiple parallel builds running that are no longer needed. They ask the agent to manage them, which calls `close_parallel_build` to clean up the build environment and keep resources clear.

### Troubleshooting Build Failures
A critical feature build failed inexplicably. Instead of restarting the entire pipeline manually, they ask the agent to run `rerun_build`. The agent triggers the rerun and monitors the result until success.

## Benefits

- Stop switching between tabs. Instead of checking a dashboard, you ask your agent to get the repository info using `get_repo` and instantly know if the current branch meets quality standards.
- Save time debugging pipelines. If a build seems stuck or incomplete, use `close_parallel_build` to clean up the state and prevent resource leaks without manual intervention.
- Improve report accuracy. When you suspect an issue, don't just rely on visual checks; run `get_job_web_data` to pull the raw JSON data for programmatic analysis.
- Handle regressions faster. If coverage drops, use `submit_job` immediately from your terminal with fresh test results rather than waiting for a full pipeline cycle.
- Maintain stable systems. Use `rerun_build` when you suspect a build failed due to temporary network issues, letting the agent handle the retry logic.

## How It Works

The bottom line is, your AI client handles all the API complexity so you just get a clean status update and actionable next steps.

1. First, connect your agent and provide your Coveralls Personal Access Token.
2. Next, tell the agent what repository or job status you want to analyze (e.g., 'What's the coverage for my main branch?').
3. Finally, the agent calls the necessary tools to retrieve data or submit a report, giving you an immediate answer on code health.

## Frequently Asked Questions

**How do I submit coverage reports using submit_job?**
You must provide the service name, job ID, source files, and Git metadata. The agent uses `submit_job` to package all this data correctly for Coveralls.

**What's the difference between get_repo and get_repo_web_data?**
`get_repo` gives you high-level, fundamental information about the repository. `get_repo_web_data` pulls a much larger chunk of JSON data from the web page, giving deeper historical insights.

**How can I fix a build that fails due to temporary issues?**
You use `rerun_build`. This tells your agent to trigger a full re-process of the failed build. The agent handles talking to Coveralls to make sure the recalculation starts.

**Can I track multiple repositories with this MCP?**
Yes, you can manage several repos by first calling `get_repo` for each one and then using those credentials to run other tools like `update_repo` across the board.

**What is the difference between using `get_repo` and fetching web data with `get_repo_web_data`?**
The API call gives you structured JSON objects, perfect for direct processing. Web data retrieval fetches a raw JSON representation of what's visible on the actual repository page, which is useful if you need to analyze visual trends or complex layouts not exposed in the core metadata.

**How do I manage multiple concurrent build processes using `close_parallel_build`?**
`close_parallel_build` officially terminates a set of parallel builds. This function is essential for managing CI/CD workflows where multiple jobs run simultaneously; it ensures the entire build sequence completes or fails cleanly, preventing orphaned processes.

**If I encounter an API rate limit when using `get_job_web_data`, how do I handle it?**
Rate limits mean you're making too many requests in a short window. Wait about one minute and try the call again. For continuous monitoring, consider batching your data calls or implementing exponential backoff logic in your agent code.

**Does `create_repo` require specific permissions beyond the personal API token?**
Yes, the provided personal API token must have write access to create new repository records. If you get a permission error, check that your token scope includes resource management rights for Coveralls.

**How do I retrieve my repository's secret token for CI configuration?**
Use the `get_repo` tool by providing the service (e.g., 'github') and repository name. The agent will return the repository details, including the `repo_token` needed for your CI environment variables.

**Can I submit a coverage report for a specific CI job manually?**
Yes! The `submit_job` tool allows you to send coverage data directly. You'll need to provide the `repo_token`, `service_name`, `service_job_id`, and the `source_files` JSON array containing coverage metrics.

**How do I finalize a parallel build once all individual jobs are finished?**
Use the `close_parallel_build` tool. Provide your `repo_token` and the `build_num`. This triggers Coveralls to aggregate all parallel jobs and calculate the final coverage percentage for the build.