This section describes how to integrate Jtest's MCP (Model Context Protocol) server with AI coding agents, such as GitHub Copilot and Codex CLI.
The MCP server exposes Jtest's capabilities — including static analysis rule documentation, violation reporting, and Jtest's feature documentation — directly to AI assistants, enabling context-aware code assistance driven by Jtest analysis results.
The MCP server is located at <INSTALL_DIR>/integration/mcp/.
Prerequisites:
Jtest
is installed.Jtest
's bundled JRE automatically).Run the MCP launcher script for your platform:
<INSTALL_DIR>/integration/mcp/jtestmcp.bat<INSTALL_DIR>/integration/mcp/jtestmcpSearch Jtest documentation — queries Jtest feature docs bundled in jtest-ai-docs.zip
Jtest
rulesJtest
XML report (report.xml) to retrieve violationsThe server uses the current working directory as the workspace root and stores its local cache in .jtest/jtestmcp/ within that directory.
Create or update the .copilot/mcp-config.json file in your user home with the following content:
Windows
{
"mcpServers": {
"jtestmcp": {
"type": "local",
"command": "<INSTALL_DIR>\\integration\\mcp\\jtestmcp.bat",
"tools": [
"*"
],
"args": []
}
}
} |
Linux / macOS
{
"mcpServers": {
"jtestmcp": {
"type": "local",
"command": "<INSTALL_DIR>/integration/mcp/jtestmcp",
"tools": [
"*"
],
"args": []
}
}
} |
Replace the command path with the actual path to your Jtest installation.
"tools": ["*"] entry enables all tools provided by the MCP server.~/.copilot/mcp-config.json — applies globally to all projects.Create or update the .codex/config.toml file in your home directory or project root with the following content:
Windows
[mcp_servers.jtestmcp] command = "<INSTALL_DIR>\\integration\\mcp\\jtestmcp.bat" |
Linux / macOS
[mcp_servers.jtestmcp] command = "<INSTALL_DIR>/integration/mcp/jtestmcp" |
~/.codex/config.toml.The MCP server reads its settings from <INSTALL_DIR>/integration/mcp/etc/jtestmcp.properties. The default configuration is:
documentation.path=${jtestmcp:root_dir}/jtest-ai-docs.zip
rule.documentation.path=${jtestmcp:root_dir}/jtest-ai-rules.zip
rule.doc.html.location=${jtestmcp:root_dir}/../../rules/doc.zip
product.name=Jtest |
The MCP server stores its runtime cache in the following location:
<workspace>/.jtest/jtestmcp/
%TEMP%\jtest\jtestmcp\ (Windows) or $TMPDIR/jtest/jtestmcp/ (Linux/macOS)
The workspace directory is automatically set to the current working directory from which the coding agent launches the MCP server process.
| Issue | Resolution |
|---|---|
| Server fails to start | Verify the path in command points to the correct Jtest 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 |