Overview
C/C++test CT includes an MCP (Model Context Protocol) Server extension that enables seamless integration between C/C++test CT and AI agents or LLM-based coding assistants (such as GitHub Copilot). This MCP Server can be used within any LLM-enabled development environment that supports MCP integration, including VS Code and others. With this extension, an AI agent can interact directly with C/C++test CT, delivering context-aware guidance, analysis, and automation.
This extension allows you to use your AI coding assistant to:
- Retrieve line coverage information for analyzed code.
- Provide guidance and instructions for applying coverage suppressions to specific code sections.
- Access information from the product user guide.
The MCP server launcher is located in the <INSTALL_DIR>/integration/mcp directory.
The Parasoft MCP server uses the stdio transport protocol exclusively. Parasoft MCP tools do not access any external systems or services.
The following procedure demonstrates how to integrate an LLM-based agent (using Copilot as an example) with C/C++test CT.
Configuring the VS Code IDE to Use the MCP Server with Copilot Chat
- In VS Code, go to the Command Palette, and choose MCP: Add Server...
- Select Command (stdio) and press ENTER to confirm.
- Enter the MCP server launcher: <
INSTALL_DIR>/integration/mcp/cpptestmcp - Specify the Server ID.
Choose where to save the configuration:
User Settings - available in all workspaces
Workspace settings - available in this workspace
A JSON file will be created containing the MCP configuration.
- The MCP server entry is added to MCP servers JSON configuration file.
Using the MCP Tools with Copilot Chat
After configuring the MCP server, you can use the provided MCP tools in Copilot Chat.
Example prompts:
- List the uncovered lines in goo.cpp.
- Which lines in this file are coverable?
- Suppress line coverage in line 15 with the reason "Unreachable code".
- What is Simple Condition Coverage?
Consider using instruction files to explicitly describe your project structure (for example, the location of coverage data files) or to define more complex workflows.
MCP Server Tools Reference
| Tool | Description |
|---|---|
query_line_coverage | Returns line coverage information for a source file. Analyzes coverage data files (.cov) to provide a list of line numbers based on the query type: 'coverable', 'covered', 'notcovered', 'suppressed'. |
| how_to_suppress_coverage | Returns instructions on how to apply coverage suppressions in C/C++test CT. Provides guidance on suppressing coverage analysis for specific lines, functions, or code sections that should be excluded from coverage reporting. |
search_documentation | Searches the C/C++test CT documentation to retrieve relevant pages matching the user query. Returns the content of each page and its source URL. Use this tool to learn about code coverage and unit testing. |