Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

fix(init): stop printing a lone backslash in MCP registration (#1848)

xerj-orgee5027773866
diff --git a/engine/crates/xerj-autoindex/src/init.rs b/engine/crates/xerj-autoindex/src/init.rs
index e75190d4d..0e2e725c9 100644
--- a/engine/crates/xerj-autoindex/src/init.rs
+++ b/engine/crates/xerj-autoindex/src/init.rs
@@ -257,9 +257,9 @@ fn mcp_registration(bin: &str, url: &str) -> String {
format!(
"MCP registration for other clients (restart the session after; success: `{MCP_SUCCESS_TOOL}` is in the tool list):\n\
\x20 Claude Code, every project: claude mcp add --scope user xerj{env} -- {} mcp\n\
- \x20 Cursor: `.cursor/mcp.json` when that directory exists (init writes it; root key \"mcpServers\")\n\\
- \x20 Windsurf, Claude Desktop, Cline: copy the \"xerj\" entry from .mcp.json; the root key is \"mcpServers\"\n\\
- \x20 VS Code (.vscode/mcp.json): root key \"servers\", not \"mcpServers\"; the entry needs \"type\": \"stdio\"\n\\
+ \x20 Cursor: `.cursor/mcp.json` when that directory exists (init writes it; root key \"mcpServers\")\n\
+ \x20 Windsurf, Claude Desktop, Cline: copy the \"xerj\" entry from .mcp.json; the root key is \"mcpServers\"\n\
+ \x20 VS Code (.vscode/mcp.json): root key \"servers\", not \"mcpServers\"; the entry needs \"type\": \"stdio\"\n\
\x20 Codex (.codex/config.toml, trusted projects only; xerj init writes it when .codex/ exists): [mcp_servers.xerj]",
shell_quote(bin)
)
@@ -1176,6 +1176,24 @@ mod tests {
}
}
+ /// #1838: a `\n\\` typo in the format string printed a lone `\\` between
+ /// the Cursor / Windsurf / VS Code registration lines.
+ #[test]
+ fn mcp_registration_has_no_lone_backslash_line() {
+ let printed = mcp_registration("/usr/local/bin/xerj", DEFAULT_URL);
+ for (i, line) in printed.lines().enumerate() {
+ assert!(
+ line.trim() != "\\",
+ "line {} is a stray backslash:\n{printed}",
+ i + 1
+ );
+ }
+ assert!(
+ printed.contains("Windsurf, Claude Desktop, Cline"),
+ "{printed}"
+ );
+ }
+
/// What init prints and what the skill teaches are one registration, not
/// two that drift: the same Claude Code command and the same root keys.
#[test]