Skip to content

fix: avoid absolutizing graph query paths in HTTP MCP#56

Merged
linhdmn merged 1 commit into
mainfrom
fix/mcp-project-arg-routing
May 20, 2026
Merged

fix: avoid absolutizing graph query paths in HTTP MCP#56
linhdmn merged 1 commit into
mainfrom
fix/mcp-project-arg-routing

Conversation

@linhdmn
Copy link
Copy Markdown
Member

@linhdmn linhdmn commented May 20, 2026

Summary

  • HTTP MCP server was resolving file, doc, path, and files[] arguments to absolute paths for ALL tools
  • This caused graph-query tools like get_context, search_code, find_function to hang on large graphs because the BE graph stores paths as project-relative values (e.g., ./platform-core/...)
  • Fixed by only absolutizing path arguments for filesystem-oriented tools (mcp_index, mcp_index_docs, mcp_init, detect_changes)

Root Cause

When ?project=/Users/linh/doan/work/be was in the URL, the server was resolving:

  • ./platform-core/.../Users/linh.doan/work/be/platform-core/...

Graph queries then failed to find these absolute paths and fell back to expensive scans.

Test plan

  • cargo test test_project_routing_only_absolutizes_filesystem_tools
  • cargo test mcp_server
  • mcp_hello
  • mcp_status
  • search_code
  • find_function
  • query_file
  • get_context ✓ (no longer hangs)
  • mcp_index ✓ (accepts project-relative path)

@linhdmn linhdmn merged commit a64aa2a into main May 20, 2026
4 checks passed
@linhdmn linhdmn deleted the fix/mcp-project-arg-routing branch May 20, 2026 03:24
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