Skip to content

Connect the MCP server

witnyx mcp runs the release security check as a Model Context Protocol (MCP) server, so a coding agent can check a software bill of materials (SBOM) through tools instead of the command line. It speaks JSON-RPC on standard input and output and opens no network port. Standard output carries only JSON-RPC; diagnostics go to standard error. Your MCP client starts the server, and the server stops when the client closes its standard input.

Terminal window
$ witnyx mcp --help
Usage: witnyx mcp [-hV] [--cache-dir=DIR] [--format=FORMAT] [--repo-dir=DIR]
[--timeout=SECONDS]
Start an MCP server for coding agents on standard input and output. It runs
until the client closes standard input.
--cache-dir=DIR Cache directory for public data (default: the
platform's cache folder).
--format=FORMAT With --help: text (the default) or json, a
machine-readable reference.
-h, --help Show this help message and exit.
--repo-dir=DIR The repository root (default: the current directory).
--timeout=SECONDS Time budget in seconds (default: 120).
-V, --version Print version information and exit.
  • --repo-dir is the folder the tools work in, the server’s folder. Always give it, with the absolute path of the repository.
  • --cache-dir and --timeout work as they do for witnyx check: the cache of public data, and the time budget of each check.

The command reference lists the options with their defaults.

The server’s folder is the real path of --repo-dir, or of the folder the server starts in when --repo-dir is not given. The tools read and write only inside it.

  • Folders it refuses. Some clients start servers in / or in your home folder. mcp refuses the file-system root, your home folder (HOME, or USERPROFILE on Windows) and any folder that contains it, such as /Users or /home. It then prints a WX-CONFIG error on standard error and exits with code 2 before the server starts.
  • Paths in tool arguments. The sbom and repoDir arguments must lie inside the server’s folder once symbolic links are followed. A relative path is taken from that folder. Any other path is a tool error, such as sbom is outside the folder this MCP server was started for., and nothing is read or written.
  • One server per repository. An agent that works in two repositories needs a server for each.

A tool argument comes from an agent, and an agent can be steered by text it reads. So the server treats every path argument as untrusted: a path that leads outside its folder is refused before anything is read, and the error names only the argument.

Every tool returns one text item that holds a JSON document. A wrong argument is a tool error (isError: true) whose text is the error document, with the code WX-CONFIG.

Tool Arguments What it returns
check_sbom All optional: sbom (a path; without it, the SBOM is found in repoDir as witnyx check finds it), repoDir, failOn (as --fail-on), offline, timeoutSeconds The report, as witnyx check --agent prints it. result.exitCode means what the exit code of check means: a triggered rule is not a tool error. A check that cannot run is a tool error that holds the error document.
explain_finding id (required), sbom, repoDir Every finding with that ID, in any letter case, each with an explanation of its kind, its fix, its docsUrl and the next actions that name its component, with the report’s agentNotes and, when a match is actively exploited, its regulatoryNote. It uses this session’s last check_sbom report for the same SBOM and folder, and runs the check when there is none. An unknown ID is a tool error.
propose_not_affected Required: id, component, justification, expires, assessedBy. Optional: note, repoDir Adds one pending “not affected” entry to .witnyx.yml, and returns the entry, the file, a unified diff and a next action that asks the user to review the entry.
get_report_schema name: report (the default), error, config, init, help or upload That JSON Schema. It reads no file and makes no request.
  • A report from check_sbom is a report for an agent: caller.type is agent and caller.detectedBy is mcp, and it carries the agent notes and, when one applies, the regulatory note. Use from an AI agent explains both.
  • check_sbom reads .witnyx.yml in repoDir. It has no --config and no --strict.
  • check_sbom and explain_finding send package IDs and versions to OSV, as witnyx check does. Privacy lists what leaves the machine.
  • propose_not_affected never fills in approvedBy or approvedOn. Its entry counts only after a person approves it; until then, the finding still counts for failOn. After it changes .witnyx.yml, explain_finding runs the check again instead of using the older report. Mark a finding “not affected” describes the entry and the approval.

Each client needs the command witnyx and the arguments mcp, --repo-dir and the absolute path of the repository. witnyx must be on the PATH that the client starts servers with; otherwise give the full path of the binary as the command.

The set-ups below follow each client’s documentation as of November 2026. Clients change their formats: check the linked page when an entry does not load.

In the root folder of your repository, run:

Terminal window
claude mcp add --transport stdio witnyx -- witnyx mcp --repo-dir "$PWD"

Everything after -- is the command that starts the server, and the shell puts the folder’s absolute path in place of "$PWD". Without --scope, Claude Code stores the server for this project only, and for you only. Check it with claude mcp get witnyx, or with /mcp in a Claude Code session. Source: Connect Claude Code to tools via MCP.

Create .cursor/mcp.json in your project:

{
"mcpServers": {
"witnyx": {
"type": "stdio",
"command": "witnyx",
"args": ["mcp", "--repo-dir", "${workspaceFolder}"]
}
}
}

Cursor replaces ${workspaceFolder} with the project’s root folder, the one that contains .cursor/mcp.json, so you can commit the file for your team. Source: Model Context Protocol (MCP) in Cursor’s documentation.

Add the server to .mcp.json at the root of your workspace:

{
"mcpServers": {
"witnyx": {
"type": "stdio",
"command": "witnyx",
"args": ["mcp", "--repo-dir", "/absolute/path/to/the/repository"],
"tools": ["*"]
}
}
}

"tools": ["*"] makes all four tools available. The file holds an absolute path, which differs from one machine to another, so keep it out of version control unless every machine uses the same path. For a server of your own across workspaces, VS Code also reads the same mcpServers entries from ~/.copilot/mcp-config.json; give each repository’s server its own name there. VS Code’s documentation marks .vscode/mcp.json and its servers format as the deprecated Local harness’s; use .mcp.json for a new set-up. Source: MCP configuration reference in VS Code’s documentation.

The server does not use the client’s roots: its folder is --repo-dir. But when the client sends notifications/roots/list_changed, the MCP Java SDK asks the client for roots/list. If the client answers with an error, or not within 10 seconds, the SDK ends the session. mcp then prints one line on standard error and exits with code 0. The SDK has no setting to ignore roots changes, so restart the server from your client when this happens.

See also: Install and Build from source for putting witnyx on the PATH.

What you see What to do
The server does not start, and its error says it needs a repository folder The client started it in / or in your home folder without --repo-dir. Add --repo-dir with the repository’s absolute path.
A tool error that says an argument is outside the folder this MCP server was started for The path leads outside the server’s folder. Give a path inside it, or start a server for the other repository.
The client cannot start witnyx The command is not on the client’s PATH. Give the full path of the binary as the command.
The tools stop answering after you changed the client’s folders The session ended after a roots change. Restart the server.
check_sbom returns result.exitCode 1 The check ran and a failure rule triggered. That is a result, not a tool error.

Witnyx is a record-keeping and workflow tool. It does not certify compliance. Nothing on this site is legal advice.