C/C++test CT provides an MCP (Model Context Protocol) Server extension that allows you to smoothly integrate your AI agents or applications (for example, Copilot) with C/C++test CT functionality. The C/C++test CT MCP Server can be integrated within any LLM-based development environment that supports MCP Server integration, including VS Code and other environments. With this extension, an AI agent can interact directly with C/C++test CT, providing context-aware guidance and analysis.
This extension allows you to use your AI agents to:
The MCP server launcher is located in the <INSTALL_DIR>/integration/mcp directory.
The following procedure demonstrates how to integrate an LLM-based agent (using Copilot as an example) with C/C++test CT.
INSTALL_DIR>/integration/mcp/cpptestmcpChoose 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.
After configuring the MCP server, you can use the provided MCP tools in Copilot Chat.
Example prompts:
Consider using instruction files to explicitly describe your project structure (for example, the location of coverage data files) or to define more complex workflows.
| 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. |