Skip to main content
Glama
jbr

semantic-edit-mcp

by jbr

semantic-edit-mcp

codecov ci crates.io version badge

A Model Context Protocol server for AST-aware code editing

Supported Languages and Important Language Notes

  • Rust

    • Must have rustfmt available on the PATH

    • Currently assumes edition 2024 for formatting, eventually this will be determined from context

  • Python

    • Must have ruff available on the PATH

  • JavaScript/TypeScript/JSON/JSX/TSX

    • Must have biome available on the PATH

  • TOML

    • No external dependencies, taplo formatting included

  • Plaintext / markdown / default editor

    • No external dependencies

Related MCP server: semamerge

Tools

  edit                   Apply a validated edit to a file and see the resulting diff
  retarget-edit          Move the most recent edit to a corrected anchor without resending its content
  undo-edit              Revert the most recent edit, restoring the file's prior content
  find-anchor            Show every location an anchor matches in a file, with context
  set-working-directory  Set the working context path for a session

Edits persist immediately when they validate (parse + formatter). The returned diff is for review-after-the-fact: if the edit landed somewhere other than intended, retarget-edit moves it and undo-edit (single-level) reverts it.

Installation

$ cargo install semantic-edit-mcp

Usage with Claude Desktop or gemini-cli

Add this to your MCP configuration JSON file:

{
  "mcpServers": {
    "edit": {
      "command": "/path/to/semantic-edit-mcp/semantic-edit-mcp",
      "args": ["serve"]
    }
  }
}

License


Related MCP Connectors

Related MCP Servers