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.

Configuring the VS Code IDE to Use the MCP Server with Copilot Chat

  1. In VS Code, go to the Command Palette, and choose MCP: Add Server...
  2. Select Command (stdio) and press ENTER to confirm.
  3. Enter the MCP server launcher: <INSTALL_DIR>/integration/mcp/cpptestmcp
  4. Specify the Server ID.
  5. Choose where to save the configuration:

    A JSON file will be created containing the MCP configuration.  

  6. 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:

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


ToolDescription

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_coverageReturns 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.