8000 fix(mcp): say how to start a node when XERJ_URL is down by xerj-org · Pull Request #2085 · xerj-org/xerj · GitHub
[go: up one dir, main page]

Skip to content

fix(mcp): say how to start a node when XERJ_URL is down - #2085

Merged
xerj-org merged 2 commits into
mainfrom
cursor/mcp-node-down-hint-af83
Oct 21, 2026
Merged

xerj-org merged 2 commits into
mainfrom
cursor/mcp-node-down-hint-af83

Conversation

@xerj-org
Copy link
Copy Markdown
Owner

Written by an AI coding agent (Cursor Grok 4.7), run by the account that opens this pull request.

Fixes #2079

What this changes, and why

xerj mcp proxies tool calls to XERJ_URL and does not start a node. When nothing was listening, xerj_search, xerj_map, and the other thin proxies returned only request to <url> failed: <reqwest error>. rc.97 field reports (#2025, #2027, #2032, #2033) show agents treating that as a dead end and falling back to ripgrep. They recovered only after finding the start command themselves.

A connect failure (connection refused, or otherwise unreachable) now says that no XERJ node is listening at that URL, that xerj mcp does not start one, and prints the documented command xerj --insecure --data-dir ~/xerj-data (llms.txt "Start here" step 1, the README, and the xerj mcp CLI reference). HTTP responses, including 401, stay XERJ returned HTTP <status>: <body>.

Evidence

cargo +1.97.1 test -p xerj-mcp --lib
test result: ok. 102 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.23s

The new cases in that run: node_not_listening_names_the_url_and_the_documented_start_command, a_refused_connection_on_xerj_search_tells_the_agent_to_start_the_node, an_unreachable_node_is_an_error_not_an_empty_map (connection refused on 127.0.0.1:1), an_http_401_is_not_rewritten_as_node_down (local HTTP/1.1 401), and a_non_connect_transport_error_keeps_the_request_failed_text (builder error, not a down node).

cargo +1.97.1 clippy -p xerj-mcp --lib --bins --tests -- -D warnings
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 22s
(exit 0)

cargo +1.97.1 fmt -p xerj-mcp -- --check
(exit 0)

Checks

  • cargo fmt --all (CI runs rustfmt --check and clippy -D warnings) — ran cargo +1.97.1 fmt -p xerj-mcp -- --check, the crate this PR touches. Not workspace-wide.
  • Scoped release build of the crates touched: cargo build --release -j 32 -p <crate>
  • cargo test -p <crate> passes — cargo +1.97.1 test -p xerj-mcp --lib (102 passed). Integration tests under engine/crates/xerj-mcp/tests/ were compiled by clippy --tests and not executed; they boot an in-process node and do not cover this error string.
  • ES-YAML conformance suite at 0 failed — not applicable: no engine wire-protocol change. This is the MCP client's transport-error text.
  • New ES-compatible behaviour has a matching YAML case — not applicable, same reason.
  • Docs updated if user-visible behaviour changed — CHANGELOG.md under [Unreleased]. The start command is already the one in llms.txt / the README / the xerj mcp CLI reference; this PR quotes it instead of editing those pages.
  • For non-trivial changes: the applicable audit in docs/CONTRIBUTION_REVIEW.md — independent branch off current origin/main (8b066e4b). No durable state, recovery path, or engine HTTP contract changes. Only the MCP tool text for a failed connect changes.
  • Operational audit — N/A. This does not change an operational document or a runnable recipe.

Not run: cargo build --release -p xerj-mcp (debug tests and clippy covered the crate). ES-YAML runner (no engine change). cargo fmt --all / workspace clippy (only xerj-mcp is touched).

Provenance

  • Written by: AI agent (Cursor Grok 4.7), run by the account opening this pull request, who has reviewed it
  • Verified (commands run, output observed): the cargo test, cargo clippy, and cargo fmt --check commands above, on Rust 1.97.1. Connection refused was a real connect to 127.0.0.1:1. The 401 was a real HTTP/1.1 response from a local listener.
  • Assumed (not tested, and what would falsify it): that reqwest reports a refused TCP connection as Error::is_connect() on every platform we ship, not only this Linux host. A platform where connection refused is not is_connect() and not ErrorKind::ConnectionRefused / the listed unreachable strings would keep the old request to … failed text. xerj_code_search uses a separate transport (McpXc) and is unchanged.
Open in Web Open in Cursor 

MCP tool calls turned a refused connection into "request to <url> failed".
Field reports on v1.0.0-rc.97 show agents treating that as a dead end and
falling back to ripgrep instead of starting the node.

A connect failure now says no XERJ node is listening at XERJ_URL, that
xerj mcp does not start one, and prints the documented command
`xerj --insecure --data-dir ~/xerj-data` (llms.txt "Start here", the
README, and the xerj mcp CLI reference). HTTP responses, including 401,
stay "XERJ returned HTTP <status>: ...".

Written by an AI coding agent.

Fixes #2079.

Co-authored-by: xerj-org <xerj-org@users.noreply.github.com>
@cla-bot cla-bot Bot added the cla-signed label Oct 21, 2026
@xerj-org
xerj-org marked this pull request as ready for review October 21, 2026 16:40
@xerj-org
xerj-org merged commit 44b8d65 into main Oct 21, 2026
2 checks passed
@xerj-org
Copy link
Copy Markdown
Owner Author

Xerj Merger made the fix: reviewed the diff. When an MCP proxy tool can't connect to XERJ_URL (connection refused, host or network unreachable, DNS failure), the result now says no XERJ node is listening there, that xerj mcp doesn't start one, and gives the documented start command xerj --insecure --data-dir ~/xerj-data (the same command as llms.txt and the README). The OS error is kept for diagnosis. HTTP responses, including 401, and builder errors keep their old text. xerj_map uses the same helper. I merged main in (CHANGELOG conflict only). Locally, cargo fmt --check, clippy -p xerj-mcp --all-targets -D warnings and cargo test --profile ci-test -p xerj-mcp all pass, including the 4 new or updated tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP: tool calls when no node is running just fail; point the agent at how to start the node

2 participants

0