Skip to main content
Glama
diffblue

Diffblue Cover MCP Server

Official
by diffblue

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DIFFBLUE_COVER_CLINoThe location of the installed dcover command line
DIFFBLUE_COVER_OPTIONSNoUse these dcover options as well as those supplied by the LLM

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
createA

Invoke Diffblue Cover to generate unit tests for Java code.

This tool executes the dcover CLI to automatically generate JUnit tests for the specified Java classes, methods, or packages. It supports various configuration options to control the test generation process.

Args: path: Path to the dcover executable. If not provided, searches system PATH and the DIFFBLUE_COVER_CLI environment variable. working_directory: Root directory of the Java project to test. Defaults to the current working directory. dcover_timeout: Maximum execution time in seconds. Defaults to 600. Set to None for no timeout (not recommended). entry_points: List of fully-qualified Java targets (packages, classes, or methods) to generate tests for. Examples: ['com.example.MyClass', 'com.example.MyClass.myMethod']. If None, tests entire project. args: Additional arguments to pass to dcover. Defaults to None. ctx: MCP server context for logging and progress reporting (auto-injected by FastMCP).

Returns: dict: Execution result containing: - return_code (int): Exit code (0 for success) - status (str): "success" if completed without errors - output (str): Complete stdout/stderr from dcover - command (list[str]): The exact command that was executed - working_directory (Path): Directory where command was run

Raises: ToolError: If dcover executable not found, command fails, or timeout exceeded. The error includes the partial output collected before failure.

Note: If DIFFBLUE_COVER_OPTIONS environment variable is set, it overrides all option parameters (batch, skip_verification, etc.) except path, working_directory, timeout, and entry_points.

This tool requires a valid Diffblue Cover license. See:
https://docs.diffblue.com/features/cover-cli/commands-and-arguments#create-tests
refactorA

Invoke Diffblue Cover to refactor the project (aliased as 'fix-build').

This tool executes the dcover refactor command to apply automated refactorings, such as fixing build issues or adding missing dependencies.

Args: path: Path to the dcover executable. If not provided, searches system PATH and the DIFFBLUE_COVER_CLI environment variable. working_directory: Root directory of the Java project to test. Defaults to the current working directory. dcover_timeout: Maximum execution time in seconds. Defaults to 600. Set to None for no timeout (not recommended). dry_run: If True, passes the '--dry-run' flag to check for readiness without applying changes. args: Additional arguments to pass to dcover. Defaults to None. ctx: MCP server context for logging and progress reporting (auto-injected by FastMCP).

Returns: dict: Execution result containing: - return_code (int): Exit code (0 for success) - status (str): "success" if completed without errors - output (str): Complete stdout/stderr from dcover - command (list[str]): The exact command that was executed - working_directory (Path): Directory where command was run

Raises: ToolError: If dcover executable not found, command fails, or timeout exceeded. The error includes the partial output collected before failure.

issuesA

Invoke Diffblue Cover to identify project issues.

This tool executes the dcover issues command to output a prioritized list of project issues that may prevent test generation.

Args: path: Path to the dcover executable. If not provided, searches system PATH and the DIFFBLUE_COVER_CLI environment variable. working_directory: Root directory of the Java project to test. Defaults to the current working directory. dcover_timeout: Maximum execution time in seconds. Defaults to 600. Set to None for no timeout (not recommended). limit: Limit the number of issues to output. skip: Skip the first N issues from the report. prompt: If True, outputs a suggested prompt for each actionable issue. cover_json: Location of the JSON-formatted test-writing summary report. dry_run: If True, passes the '--dry-run' flag to check for readiness. args: Additional arguments to pass to dcover. Defaults to None. ctx: MCP server context for logging and progress reporting (auto-injected by FastMCP).

Returns: dict: Execution result containing: - return_code (int): Exit code (0 for success) - status (str): "success" if completed without errors - output (str): Complete stdout/stderr from dcover - command (list[str]): The exact command that was executed - working_directory (Path): Directory where command was run

Raises: ToolError: If dcover executable not found, command fails, or timeout exceeded. The error includes the partial output collected before failure.

Prompts

Interactive templates invoked by user choice

NameDescription
write testsProvide system prompt for Java unit test writing guidance. Establishes LLM context as a Java unit testing expert to improve test generation quality and suggestions. Returns: list[dict]: System role message defining the assistant's expertise.

Resources

Contextual data attached and managed by the client

NameDescription
create_optionsProvides the configuration options for creating tests with Diffblue Cover.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/diffblue/cover-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server