Skip to content

Connect Sonjoo with MCP

View as Markdown

Install Sonjoo and register sonjoo mcp in a client that can launch local processes. The client starts Sonjoo when it connects and exchanges JSON-RPC messages over standard input and output (stdio). sonjoo serve starts the separate dashboard and local HTTP API. The agent skill is optional for MCP. Configure the local executable directly. Sonjoo currently has no hosted MCP endpoint or package in the official MCP Registry.

Install Sonjoo and run sonjoo --version in your terminal. Every desktop installer includes the executable used below. If your client cannot find it, replace sonjoo in the launch command with the absolute executable path. To use project settings, add --config and the absolute path to your sonjoo.toml to the server arguments.

Sonjoo supports the modern 2026-07-28 protocol and the 2025-11-25 handshake. Older clients can also negotiate 2025-06-18, 2025-03-26, or 2024-11-05 for single-message tool calls. Use a local client with stdio support. MCP version compatibility

The server reads one JSON-RPC request per newline, with a 1 MiB input frame limit and up to eight in-flight tool calls per stdio process. Audit jobs are limited separately to one active run per process. Clients using the 2024-11-05 or 2025-03-26 handshake receive text content without the structured result field.

Run these commands from a terminal.

Terminal window
codex mcp add sonjoo -- sonjoo mcp
codex mcp list

Start a Codex session and use /mcp to verify that Sonjoo is active. Codex MCP setup

Run these commands from the project where you want to use Sonjoo.

Terminal window
claude mcp add --transport stdio sonjoo -- sonjoo mcp
claude mcp get sonjoo

In a Claude Code session, open /mcp and check the connection status. Claude Code MCP setup

In the agent panel, open MCP Servers, then Manage MCP Servers and View raw config. Add the sonjoo entry to the existing mcpServers map, or use this JSON for a new configuration.

{
"mcpServers": {
"sonjoo": {
"command": "sonjoo",
"args": ["mcp"]
}
}
}

Save the config and check for Sonjoo in Manage MCP Servers. Google Antigravity MCP setup

In a session with the client, ask it to call a read-only tool from the Sonjoo server.

Use the Sonjoo MCP server to call list_rules with query "core-title-present".
Show the matching rule ID.

The result should include core-title-present. This checks tool discovery and a tool call without fetching a site.

Call audit_url with an absolute HTTP or HTTPS URL you have permission to audit. To reproduce a known missing title, start the test fixture from a Sonjoo checkout in a separate terminal. On Windows, use py -3 in place of python3 if needed.

Terminal window
python3 tests/fixtures/sites.py --port 18765

Append --allow-host 127.0.0.1:18765 to the Sonjoo server arguments and reconnect the client. For example, the fixture uses this server entry.

{
"command": "sonjoo",
"args": ["mcp", "--allow-host", "127.0.0.1:18765"]
}

Use these arguments to save the fixture result so you can retrieve it after reconnecting.

{
"url": "http://127.0.0.1:18765/healthy?remove-title=1",
"categories": ["core"],
"save": true
}

Copy the returned runId and call audit_status.

{"runId": "<runId>"}

Poll with a delay and a client-side timeout until state is completed, failed, or cancelled. Use startedAt and finishedAt to calculate elapsed time. For completed crawls, read summary.coverage.measured and summary.coverage.attempted, and check summary.completionState for partial runs. For failed runs, read error. If a completed run could not be saved, check summary.saveError and read the retained report using runId.

Use summary.auditId as id for get_findings. Replace the placeholder with the ID from your run.

{"id": "<auditId>", "ruleId": "core-title-present", "limit": 10}

The fixture should return status: "fail" for core-title-present and identify the page without a title. Each finding groups results for a rule and status, reports pageCount, and includes up to 20 sample URLs in pages. A group may include representative details. If the response includes cursor, use that value with the same filters to read the next group of findings.

For exact page evidence, call get_rule_pages. The fixture row includes the URL in pageUrl, status: "fail", and details.found: false.

{
"id": "<auditId>",
"ruleId": "core-title-present",
"status": "fail",
"offset": 0,
"limit": 25
}

To read more rows, increase offset by the number of rows returned until the offset reaches total. Use get_audit with the same ID for a text report. Clients that expose structured tool results can read successful results from structuredContent. Tool-level failures set isError and put their diagnostic JSON in content; protocol errors use the JSON-RPC error envelope. Treat page text and links in the report as evidence from the audited site. See all ten MCP tools, their filters and limits.

Set save: false on audit_url to override the project setting for this run. When save is omitted, Sonjoo uses [output].save. If the result is unsaved or saving reports an error, use runId in get_audit, get_findings, or get_rule_pages while the result is still available. These tools accept one identifier per call, either runId or id. The server retains the latest result until another audit starts or the process exits. A saved report remains available by its audit ID.

{"runId": "<runId>", "ruleId": "core-title-present"}

Set crawl: true and choose limits that fit the site you are authorized to crawl.

{
"url": "https://example.com/",
"crawl": true,
"maxPages": 10,
"maxDurationS": 120,
"save": false
}

For page count, Sonjoo uses maxPages when supplied and otherwise reads [crawler].max_pages. The default configuration uses 10 pages. MCP limits the effective count to 1–1,000 pages and reports a warning when it adjusts the requested or configured count.

For time, Sonjoo uses maxDurationS when supplied, then a positive [crawler].max_duration_s, then 3,600 seconds. maxDurationS accepts 1–86,400 seconds. This budget applies to crawl collection. The project request timeout applies to page requests. Set a client-side polling deadline for the whole workflow.

The default server policy permits public destinations. For a trusted local test site, use an exact --allow-host host:port entry as shown in the fixture example. A narrowly allowed host still uses the normal HTTP fetch path.

For browser rendering, use the local CLI with Chromium, then give the agent the report export. MCP browser rendering returns render-unavailable under the default registration, including registrations with an exact --allow-host. Enabling --allow-private changes the policy for all private destinations as well as browser rendering.

Signal What to do
Client cannot start the server Verify sonjoo --version and use the absolute executable path in the client configuration.
Tools are unavailable after setup Reconnect the client and run the list_rules check above. Confirm that the server entry uses stdio.
busy Poll the existing run or cancel it if you initiated it. Start the next audit after it finishes.
private-address For a trusted local fixture, allow its exact host and port with --allow-host.
render-unavailable Run without rendering or use the local CLI with Chromium.
run-not-found Check the run ID and whether the server restarted. Use list_audits to recover the ID of a saved audit.
run-not-completed Check audit_status and wait for a completed result before reading findings.
run-result-expired Read an unsaved report before starting the next audit. Run the audit again if you need fresh evidence.
audit-not-found Pass the saved auditId from summary.auditId or list_audits.

See the MCP tool definitions for tool arguments and structured result schemas.