Skip to content

MCP server follow-up improvements #608

@st0012

Description

@st0012

From PR #586 review — deferred suggestions and ideas for future iterations.

New tools

  • resolve_at_position — Given file + line + column, return the declaration being referenced. The most powerful navigation primitive for LLM debugging workflows. (Morriar)
  • find_method_references — Expose graph.method_references() as a name-based search for method call sites (e.g., "find all calls to validate"). Not fully resolved, but very useful. (Morriar)
  • get_diagnostics — Expose graph.all_diagnostics() to return parse/type errors. Lets an LLM understand what's broken before editing. (Morriar)

Tool enhancements

  • Include method parameters in get_declarationMethodDefinition#parameters() data exists but isn't serialized. LLMs need signatures without reading source. (Morriar)
  • Reverse index for find_constant_referencesBuild declaration_id → Vec<const_ref_offset> at startup for O(k) lookups instead of O(n) scans. Addressed by using declaration.references() which already tracks resolved references per declaration. (Morriar, vinistock)
  • Audit codebase_stats tool usefulness — Is aggregate codebase info useful to agents, or only to tool developers? (vinistock)
  • Type-safe Location to prevent double to_presentation — Follow up similar to PR Create DisplayLocation #607 to make it impossible to call to_presentation() multiple times and accidentally bump line/col values. (vinistock)

Code organization

  • Split server.rs into separate files per tool handler — Prevents the file from growing too large and enables unit testing each handler independently. (vinistock)
  • Add unit tests alongside integration tests — Current tests all spawn the server and do real IO. Add unit tests for tool logic, keep a few integration tests. (vinistock)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions