Allows processing and editing JavaScript files with targeted modifications using tools like sed and awk, supporting operations such as version bumping, import path updates, and debug code removal.
Supports package.json management for npm packages, particularly for version bumping and dependency updates through targeted text replacement.
Enables precise editing of TypeScript files including modifying imports, fixing formatting, and updating configuration values without rewriting entire files.
MCP SmallEdit
A Model Context Protocol (MCP) server that provides tools for making small, targeted edits to files using stream editors like sed
and awk
.
Why SmallEdit?
When making minor changes to files (fixing typos, updating version numbers, changing config values), using full file replacement is inefficient. SmallEdit provides targeted editing capabilities that:
- Save tokens by only specifying what to change
- Reduce errors by not rewriting entire files
- Enable bulk operations across multiple files
- Provide preview capabilities before applying changes
Installation
Tools Available
1. sed_edit
Make small edits using sed patterns.
Examples:
2. sed_multifile
Apply patterns to multiple files.
Examples:
3. quick_replace
Simple find and replace without regex.
Examples:
4. line_edit
Edit specific lines by number.
Examples:
5. awk_process
Process files with AWK for complex operations.
Examples:
Configuration
Add to your MCP client config:
Common Use Cases
Version Bumping
Update Import Paths
Remove Debug Code
Fix Formatting
Safety Features
- Automatic Backups: Creates
.bak
files by default - Preview Mode: Test patterns before applying
- Error Handling: Clear error messages for invalid patterns
- File Validation: Checks file existence before editing
Notes
- All file paths are relative to the current working directory
- Backup files (
.bak
) are created by default unless disabled - Use preview mode to test complex patterns
- Escape special characters appropriately in patterns
License
MIT
This server cannot be installed
Provides tools for making small, targeted edits to files using stream editors like sed and awk, enabling efficient modifications without full file replacement.
Related MCP Servers
- AsecurityAlicenseAqualityA line-oriented text file editor. Optimized for LLM tools with efficient partial file access to minimize token usage.Last updated -6134PythonMIT License
- AsecurityAlicenseAqualityLeverages Vim's native text editing commands and workflows, which Claude already understands, to create a lightweight code assistance layer.Last updated -8628186TypeScriptMIT License
- AsecurityAlicenseAqualityShell and file edit capabilities tightly coupled to provide a powerful coding experience. You can work with different modes: architect and code-writer for separate plan and implementation phase. You can get it to invoke any cli command, e.g., compiling, type checking, linting, github cli, pythonLast updated -6543PythonApache 2.0
- -securityAlicense-qualityA TypeScript-based MCP server that provides tools for making precise line-based edits to text files within allowed directories.Last updated -27TypeScriptMIT License