Skip to content

Fix MCP relative paths and accept a single query alias - #121

Merged
Naoray merged 2 commits into
mainfrom
fix/mcp-paths-5222
Oct 27, 2026
Merged

Naoray merged 2 commits into
mainfrom
fix/mcp-paths-5222

Conversation

@Naoray

@Naoray Naoray commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

MCP searches now try relative paths against every configured root and accept a root’s final name. A unique allowed match is used; missing matches list the roots, and ambiguous matches return AMBIGUITY with candidate paths. Existing confinement and local-content checks still apply. Unavailable and outside-root paths share a refusal message that never reveals the canonical target, including through broken symlinks.

Search accepts query as a single-phrasing alternative to queries; the deserializer rejects both together. Search and extract advertise flat object schemas with optional selection properties for client compatibility. Extract’s strict selection decision table remains enforced in code.

The tools/list integration assertion intentionally checks optional queries/query properties instead of a top-level oneOf. It also rejects top-level oneOf, anyOf and allOf for every advertised tool. This covers extract as well as search.

Documentation explains these inputs, ambiguity for . with multiple roots, exact case and Unicode spelling for root-name shortcuts, text-only startup, and the observed indexing memory peak. The unsupported query-memory figure is removed; existing absolute setup paths and three-tool documentation are retained.

Validation:

  • Tests cover root-name collisions, case and Unicode spelling, second-root matches, ambiguity, missing paths, traversal, symlinks, hidden local-content paths, non-disclosing errors, query parsing, strict extraction selections, and the public tools/list schemas.
  • cargo fmt --all
  • cargo clippy --workspace --all-targets --offline -- -D warnings
  • cargo test --workspace --offline --no-fail-fast --quiet

Tests requiring real model weights and timing measurements remain ignored; no model weights were downloaded.

@Naoray
Naoray merged commit 2e1a107 into main Oct 27, 2026
15 checks passed
@Naoray
Naoray deleted the fix/mcp-paths-5222 branch October 27, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant