Skip to content

feat(api): /api/v2/* MCP-parity endpoints#695

Draft
DvirDukhan wants to merge 1 commit into
dvirdukhan/bench-combinedfrom
dvirdukhan/api-v2-mcp-parity
Draft

feat(api): /api/v2/* MCP-parity endpoints#695
DvirDukhan wants to merge 1 commit into
dvirdukhan/bench-combinedfrom
dvirdukhan/api-v2-mcp-parity

Conversation

@DvirDukhan
Copy link
Copy Markdown
Contributor

Summary

Adds 7 new HTTP endpoints that wrap the existing async tool functions in api.mcp.tools.* directly. No logic duplication: FastMCP's @app.tool decorator returns the original callable, so importing the functions and awaiting them from a FastAPI route works as-is.

POST /api/v2/search_code
POST /api/v2/get_callers
POST /api/v2/get_callees
POST /api/v2/get_dependencies
POST /api/v2/impact_analysis
POST /api/v2/find_path
POST /api/v2/ask

Each accepts a small pydantic request body matching the MCP tool's kwargs (project, branch, symbol_id, …) and returns the function's native payload unchanged. Auth follows the existing read-route pattern (public_or_auth).

Why

The React UI keeps using the existing UI-shaped routes (/api/graph_entities, /api/get_neighbors, /api/find_paths, …). Agent integrations (and our SWE-bench harness) want the agent-shaped verb surface the MCP server already exposes. Until now the only way to get that over HTTP was to reshape responses client-side. With these endpoints, an HTTP client and an MCP client get byte-identical output for the same query.

Risk

Purely additive. No existing routes change. New routes are async wrappers around already-tested MCP tool functions.

Stacked

Add seven new HTTP endpoints that wrap the existing async tool
functions in api.mcp.tools.* directly, with no logic duplication
(FastMCP's @app.tool returns the original callable, so importing
them and awaiting from a FastAPI route works as-is):

  POST /api/v2/search_code
  POST /api/v2/get_callers
  POST /api/v2/get_callees
  POST /api/v2/get_dependencies
  POST /api/v2/impact_analysis
  POST /api/v2/find_path
  POST /api/v2/ask

Each accepts a small pydantic request body matching the MCP tool's
kwargs (project, branch, symbol_id, ...) and returns the function's
native payload unchanged. Auth follows the existing read-route
pattern (public_or_auth).

Motivation: the React UI keeps using the existing UI-shaped routes
(/api/graph_entities, /api/get_neighbors, /api/find_paths, ...).
Agent integrations (and our SWE-bench harness) want the agent-shaped
verb surface the MCP server already exposes. Until now the only way
to get that over HTTP was to reshape responses client-side. With
these endpoints, an HTTP client and an MCP client get byte-identical
output for the same query.

No existing routes change; this is purely additive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4fca3c94-1531-4292-bf1d-ab37a39cbab5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dvirdukhan/api-v2-mcp-parity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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