This section describes how to integrate the dotTEST's MCP (Model Context Protocol) server with AI coding agents, such as GitHub Copilot and Codex CLI.
The MCP server exposes dotTEST's capabilities — including static analysis rule documentation, violation reporting, and dotTEST's feature documentation — directly to AI assistants, enabling context-aware code assistance driven by dotTEST analysis results.
The MCP server is located at <INSTALL_DIR>/integration/mcp/.
Prerequisites:
dotTEST
is installed.- Java is available (the launcher uses
dotTEST
's bundled JRE automatically).
Running the MCP Server Launcher
Run the MCP launcher script: <INSTALL_DIR>/integration/mcp/When launched, the MCP server starts a local process that communicates over stdio using the Model Context Protocol. The coding agent connects to it and gains access to the following tools:dottestmcp.bat
Search dotTEST documentation — queries dotTEST feature docs bundled in
dottest-ai-docs.zip
- Get static analysis rule documentation — retrieves detailed documentation for specific
dotTEST
rules - Get relevant rules — finds rules related to a given topic or keyword
- Get violations from a report — parses and filters a
dotTEST
XML report (report.xml) to retrieve violations Get a path to dottestcli — returns a path to
dottestcliinside the same installation directory as the MCP server. This can be customized by setting thedottest.cli.pathproperty in themcp/etc/dottestmcp.propertiesfile
The server uses the current working directory as the workspace root and stores its local cache in .dottest/dottestmcp/ within that directory.
Integrating with GitHub Copilot
Add the dottestmcp tool via Copilot's command line (provide the full path to the batch file):
copilot mcp add dottestmcp "<INSTALL_DIR>\integration\mcp\dottestmcp.bat"
Alternatively, create or update the .copilot/mcp-config.json file in your user home with the following content:
{
"mcpServers": {
"dottestmcp": {
"type": "local",
"command": "<INSTALL_DIR>\\integration\\mcp\\dottestmcp.bat",
"tools": [
"*"
],
"args": []
}
}
}
Replace the
<INSTALL_DIR>in thecommandpath with the actual path to your dotTEST installation.- The
"tools": ["*"]entry enables all tools provided by the MCP server.- User level:
~/.copilot/mcp-config.json— applies globally to all projects.
- User level:
Integrating with Codex CLI
Add the dottestmcp tool via the Codex command line (provide the full path to the batch file):
codex mcp add dottestmcp "<INSTALL_DIR>\integration\mcp\dottestmcp.bat"
Alternatively, create or update the .codex/config.toml file in your user home directory (user level) or project root (project level) with the following content:
[mcp_servers.dottestmcp] command = "<INSTALL_DIR>\integration\mcp\dottestmcp.bat"
Replace the
<INSTALL_DIR>in thecommandpath with the actual path to your dotTEST installation.- The configuration file is typically located at
~/.codex/config.toml. - Codex CLI will automatically start the MCP server process when needed and communicate with it over stdio.
MCP Server Configuration
The MCP server reads its settings from <INSTALL_DIR>/integration/mcp/etc/dottestmcp.properties. The default configuration is:
documentation.path=${dottestmcp:root_dir}/dottest-ai-docs.zip
rule.documentation.path=${dottestmcp:root_dir}/dottest-ai-rules.zip
rule.doc.html.location=${dottestmcp:root_dir}/../../rules/doc.zip
product.name=dotTEST
dottest.cli.path property can change the behavior of the get_dottestcli_path tool in case customization is needed.Local Storage
The MCP server stores its runtime cache in the following location:
- Default:
<workspace>/.dottest/dottestmcp/ - Fallback (if write access is unavailable):
%TEMP%\dottest\dottestmcp\
The workspace directory is automatically set to the current working directory from which the coding agent launches the MCP server process.
Troubleshooting
| Issue | Resolution |
|---|---|
| Server fails to start | Verify the path in command points to the correct dotTEST installation. |
java not found | The launcher uses |
| No tools visible in agent | Confirm the MCP server process started without errors. Check the logs in
|
| Violations not returned | Ensure the report.xml path passed to the tool is accessible from the workspace directory. |
| Cache issues | Delete the |