MCP server
tx0 mcp serves tx0 as tools over the Model Context Protocol, on standard input and output. A coding agent calls them to check its changes, apply fixes, explain findings and suppress them with a reason.
The server ships in the tx0 binary; there is nothing else to install. tx0 init --agents prints the configuration below for the clients it knows. To also get findings without the agent asking, add the post-edit hook.
Claude Code
$ claude mcp add tx0 -- tx0 mcp This adds the server for you in the current project. To share it with everyone who works on the repository, add it with --scope project, which writes it to .mcp.json at the root:
$ claude mcp add --scope project tx0 -- tx0 mcp Cursor, Gemini CLI, Claude Desktop
Clients that read an mcpServers object take this block:
{
"mcpServers": {
"tx0": { "command": "tx0", "args": ["mcp"] }
}
}- Cursor:
.cursor/mcp.jsonin the project, or~/.cursor/mcp.jsonfor every project. - Gemini CLI:
.gemini/settings.jsonin the project, or~/.gemini/settings.json. - Claude Desktop:
claude_desktop_config.json, which Settings, Developer, Edit Config opens.
A client started from the desktop may not see the PATH of your shell. If it cannot start tx0, put the full path from command -v tx0 into "command".
Codex
[mcp_servers.tx0]
command = "tx0"
args = ["mcp"]Which project it checks
Started without a path, tx0 mcp finds the project from its current directory as the other commands do: the nearest directory with tx0.toml or .git. The tools then use the same tx0.toml, cache and baseline as tx0 check and the hook. A client that starts servers in another directory needs the path:
$ tx0 mcp /path/to/project The tools
Results come as structured content and as text in the agent format. The server speaks protocol version 2025-06-18 and announces these tools:
- check
- Check the tree and report findings: a summary line, then findings grouped by file, each with an id, line:column, level, rule, message, the source line, and its fix as a diff when one is known. Use
changed: trueafter editing to see only what your uncommitted changes introduced. - check_text
- Check content that is not saved yet, as if it were the file at
path. Returns the findings of that content in the same form ascheck. - fix
- Preview or apply the fixes of findings named by id, safe or unsafe. Nothing is written unless
applyis true; the result always includes the diff. - explain
- Describe a rule (what it finds, its tier and level, how to configure and suppress it) or a finding by id (the finding, its fix, and the card of its rule). With
ruleandpath, also say why the rule runs on that file or not. - suppress
- Suppress one finding with a comment in the syntax of its file, placed and checked so that it suppresses only that finding. Use it when a finding is wrong or intended; the reason is kept in the code.
- rules
- List the rules with their tier, level and summary, one JSON object per line, and whether each runs on
path. - status
- Say which tree and configuration the server uses, and the counts and gate of the last check.
- metrics
- Measure the tree or some paths: lines of code, comment lines, complexity, nesting (complexity weighted by depth), length and parameters of functions, with totals, the functions that rank highest, and duplicated code. Read-only.
- coverage
- Line coverage from lcov, Cobertura or JaCoCo reports, mapped to the files of the tree: the total, the files with the most lines not run and, with
changedorsince, the coverage of the changed lines with the lines not run. Read-only. - gate
- Evaluate the quality gate of tx0.toml: conditions on new code (with
changedorsince) and on the whole tree for findings by level, duplication, function complexity and coverage. Says which conditions fail and what makes them fail: functions over the complexity limit, new lines not covered, files with duplicated lines. Read-only.
It also tells the agent to call check with changed: true after editing, so it sees only what its own changes introduced. Coding agents shows the whole loop.