Propose: MCP API v2 — 4-tool graph navigator + ops CLI#48
Conversation
|
Great direction overall — I like the GPS framing and the 4-tool surface. I have a few consistency questions to de-risk implementation planning:
If you want, I can also propose exact wording edits to sections 7/10/11 so the implementation prompts have zero ambiguity. |
Reframes the MCP as a graph navigator (GPS), not a reasoning engine. The agent's job is to walk; the MCP's job is to expose what's adjacent. MCP becomes 4 tools: search, find, describe, neighbors. Drop trace/impact/ask — agent reasoning, not MCP responsibility. Move 5 ops tools (refresh, meta, tables, diagnose-ignore, analyze-pr) into a user-rag CLI. The agent never calls them; operators do. Shared NodeFilter schema across search/find/neighbors. Required direction + edge_types on neighbors (no fan-out by accident). 4-PR migration plan with hard cutover, no aliases. Walked 20 use cases through the design: 12 in 1-2 calls, 5 are agent-driven neighbours loops (correct), 3 are CLI/diff-grep, 0 missing primitives.
12b9163 to
d6c47ce
Compare
|
Good catches, all three were real. Pushed as
Also tightened the distribution summary: "12 of 20 single-shot MCP, 5 of 20 agent-driven MCP loop, 3 of 20 not navigation — UC11 pure diff-grep, UC12/UC16 CLI workflows." No more conflation. No need for the wording-edit offer — these were the only three drift spots. Proposal is consistent end-to-end now. |
|
Follow-up review after the update (proposal + plan + prompts): this is much tighter now, but I still see a few execution-risk nits worth fixing before delegation.
Everything else (the 3 earlier drift issues) looks resolved and the overall direction is strong. |
… pretty test, manual evidence disclaimer
|
All four nits addressed in 1) Test-count contract (rigid totals → baseline+delta) Replaced every absolute "N passed, 4 skipped" assertion across the plan and the cursor prompts with baseline + N new (or − deletions) phrasing. DoD checkboxes now read "Full suite green; the N new tests in 2) NodeFilter key-count inconsistency Re-counted the YAML schema in propose §4. The actual total is 15 keys (not 14): 3 universal + 5 symbol-only + 3 route-only + 4 client-only. The "4 symbol-only" line was wrong on my side —
3) PR-V2-4 pretty-output ambiguity → PTY-only Picked PTY-only and explicitly forbade the side-door flag. Plan PR-V2-4 §1 now reads:
4) Manual evidence brittleness Added a single shared disclaimer to the "Common rules" preamble of
Consistency pass run: no Ready to delegate when you are. |
Loosen brittle file-list and grep/count gate wording while keeping strict scope boundaries. Validation now prefers surface assertions plus narrowly-related test harness allowances. Co-authored-by: Cursor <cursoragent@cursor.com>
Discussion PR — not for merge yet
Adds
propose/MCP-API-V2-REDESIGN-PROPOSE.md. Goal: redesign the MCP API so the AMA agent (and any future agents) have an obvious, flexible, and small surface to navigate the Java codebase graph.This PR is for review and comment. Implementation will land as PR-V2-1..4 once the design is locked.
Why now
trace_*tools confused the author of last week's PR reviews — and we hit this same class of confusion when debugging the emptylist_clients()call this week.Core design call
The MCP is a GPS for the codebase, not a reasoning engine. Three phases per agent question — Locate → Inspect → Walk — and that's the entire abstraction. Multi-hop traversal is the agent's job; the MCP exposes structure.
This rules out
trace_*,impact_*, and any NL "ask" tool. The agent walks vianeighborsin a loop and decides its own stop conditions.v2 surface
MCP — 4 tools (the agent's surface):
search(query, filter?)find(kind, filter)describe(id)neighbors(ids, direction, edge_types)direction+edge_typesREQUIREDCLI — 5 subcommands (the operator's toolbelt —
user-ragcommand):user-rag refreshrefresh_code_indexuser-rag metagraph_metauser-rag tableslist_code_index_tablesuser-rag diagnose-ignore <path>diagnose_ignoreuser-rag analyze-pr [--diff-file F]analyze_pr23 → 4 MCP tools. The 5 ops tools move out of the MCP entirely because the agent never calls them — operators do.
What's dropped
trace_request_flow,trace_flow,impact_analysis— agent reasoning, not MCP responsibility.find_callers/find_route_callers/find_route_handlers/list_by_*— collapsed intofind+neighborswith explicit edge types.codebase_searchparameter explosion — split betweensearch(vector) andfind(filter).Walked through 20 use cases
Distribution under v2 (see §7 of the proposal):
neighborsloop — exactly the questions that should require thinkingMigration — 4 PRs
search/find/describe/neighborsalongside v1; equivalence tests.metaper-edge-type counts,searchpopulatessymbol_id,describereturnsedge_summary.user_rag/cli.py, remove from MCP, update README.~700 LoC of test changes, ~500 LoC of handler+CLI code. No graph schema changes.
What I want from this discussion
findvslist?describevsinspect? The proposal locks names but they're cheap to change pre-implementation.Once aligned, I'll split into 4 Cursor task prompts via the
cursor-task-promptskill and the implementation can start with PR-V2-1.Companion to today's
**/out/**fix (PR #47) — that was a symptom of the API's other failure mode (silent path filtering), this proposal addresses the agent-facing failure mode (overlapping tools, no multi-hop primitive).