Skip to content

Phase 1: Extend MCP Server with File Editing Tools (Week 1) #271

Description

@AlexMikhalev

Part of Epic #270

Objective

Add 6 new file editing tools to existing MCP server, leveraging terraphim-automata for intelligent matching.

Tasks

1. Add File Editing Tools to MCP Server

Location: crates/terraphim_mcp_server/src/lib.rs

Add to existing 17 tools:

  • edit_file_search_replace - Using automata strategies
  • edit_file_fuzzy - Using fuzzy_autocomplete_search_levenshtein
  • edit_file_patch - Apply unified diff
  • edit_file_whole - Whole file rewrite
  • validate_edit - Pre-edit validation
  • lsp_diagnostics - Post-edit validation

2. Leverage Existing Automata Functions

  • find_matches → exact search
  • fuzzy_autocomplete_search_levenshtein → fuzzy match
  • fuzzy_autocomplete_search → Jaro-Winkler match
  • replace_matches → base for code replacement

3. Add Block Anchor Matching to Automata

Location: crates/terraphim_automata/src/lib.rs

4. Generate TypeScript Types

  • Use existing WASM support
  • Generate types for all new tools

Success Criteria

  • 6 new MCP tools exposed
  • Block anchor matching added
  • TypeScript types generated
  • Integration tests pass
  • Can edit a file using 3+ strategies

Time: 1 week

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions