# Getting Started - Cover MCP (Beta)

## Prerequisites

Before you begin:

1. Clone the Diffblue Cover MCP server repository <https://github.com/diffblue/cover-mcp/>
2. Install `uv` , a Python project manager tool from <https://docs.astral.sh/uv/>
3. Install [Diffblue Cover CLI](/get-started/get-started/get-started-cover-cli.md)

**Note** Comprehensive documentation for setup and installation can be found in the [README.md](https://github.com/diffblue/cover-mcp/blob/main/README.md) file in the Diffblue Cover MCP server repository <https://github.com/diffblue/cover-mcp/>.

## Quick Installation

### Option 1: Install globally for your AI tool

Choose your AI development environment:

For **Claude Code**: `uv run fastmcp install claude-code --server-spec main.py`

For **Claude Desktop**: `uv run fastmcp install claude-desktop --server-spec main.py`

For **Cursor**: `uv run fastmcp install cursor --server-spec main.py`

For **Gemini CLI**: `uv run fastmcp install gemini-cli --server-spec main.py`

### Option 2: Install per-project

To generate a server configuration suitable for copy/pasting in to a `mcp.json` file, run `uv run fastmcp install mcp-json --server-spec main.py` .

```json
"Diffblue Cover": {
  "command": "uv",
  "args": [
    "run",
    "--with",
    "fastmcp",
    "fastmcp",
    "run",
    "/placeholder/path/to/cover-mcp/main.py"
  ]
}
```

**Note** The path placeholder paths used in these JSON snippets will depend on where you've cloned the Diffblue Cover MCP server repository.

### Configuration

Add environment variables to customize the location your Diffblue Cover CLI installation:

```json
"Diffblue Cover": {
  "command": "uv",
  "args": [
    "run",
    "--with",
    "fastmcp",
    "fastmcp",
    "run",
    "/placeholder/path/to/cover-mcp/main.py"
  ],
  "env": {
    "DIFFBLUE_COVER_CLI": "/path/to/dcover"
  }
}
```

* `DIFFBLUE_COVER_CLI`: Custom path to dcover executable

If you want to supply additional CLI arguments to every invocation of `dcover` you can supply the `DIFFBLUE_COVER_OPTIONS` , for example (the complete configuration would look something like the following):

```json
"Diffblue Cover": {
  "command": "uv",
  "args": [
    "run",
    "--with",
    "fastmcp",
    "fastmcp",
    "run",
    "/placeholder/path/to/cover-mcp/main.py"
  ],
  "env": {
    "DIFFBLUE_COVER_CLI": "/path/to/dcover",
    "DIFFBLUE_COVER_OPTIONS": "--verbose"
  }
}

```

## Validating the MCP Server Configuration

The Diffblue MCP Server exposes tools, prompts, and resources to allow you to interact with Cover through AI applications. Your AI application should show you a list of tools, prompts, and resources available though the MCP connections.

Claude code, if configured and connected to the MCP server will show something like:

{% code fullWidth="false" %}

```
Diffblue Cover MCP Server

Status: ✔ connected
Command: uv
Args: run --with fastmcp fastmcp run /placeholder/path/to/cover-mcp/main.py
Config location: /path/to/project/.mcp.json
Capabilities: tools · resources · prompts
Tools: 1 tools

❯ 1. View tools
  2. Reconnect
  3. Disable
```

{% endcode %}

## Using the MCP Server

From here you can instruct your AI application to "write unit tests for the java code contained in this project" to start `dcover` running across the whole project, for example. You can also provide specific classes or packages.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cover-docs-preview.diffblue.com/features/cover-mcp-server-beta/getting-started-cover-mcp-beta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
