Skip to main content
Glama

MCP SmallEdit

by MikeyBeez

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

npm install -g @bard/mcp-smalledit

Tools Available

1. sed_edit

Make small edits using sed patterns.

Examples:

// Replace all occurrences sed_edit({ file: "package.json", pattern: "s/0.1.0/0.2.0/g" }) // Delete lines containing pattern sed_edit({ file: "config.ts", pattern: "/DEBUG_MODE/d" }) // Preview changes first sed_edit({ file: "index.ts", pattern: "s/foo/bar/g", preview: true })

2. sed_multifile

Apply patterns to multiple files.

Examples:

// Update imports across all TypeScript files sed_multifile({ pattern: "s/'.\\//src\\//g", filePattern: "*.ts", directory: "src" }) // Remove console.log from all JS files sed_multifile({ pattern: "/console\\.log/d", filePattern: "*.js" })

3. quick_replace

Simple find and replace without regex.

Examples:

// Replace text literally quick_replace({ file: "README.md", find: "version 1.0", replace: "version 2.0" }) // Replace only first occurrence quick_replace({ file: "config.json", find: "localhost", replace: "production.server.com", all: false })

4. line_edit

Edit specific lines by number.

Examples:

// Replace line 42 line_edit({ file: "index.ts", lineNumber: 42, action: "replace", content: "export const VERSION = '2.0.0';" }) // Delete lines 10-20 line_edit({ file: "test.ts", lineRange: "10,20", action: "delete" }) // Insert after line 5 line_edit({ file: "imports.ts", lineNumber: 5, action: "insert_after", content: "import { newModule } from './new-module';" })

5. awk_process

Process files with AWK for complex operations.

Examples:

// Sum numbers in second column awk_process({ file: "data.csv", script: "{sum += $2} END {print sum}" }) // Extract specific columns awk_process({ file: "data.tsv", script: "{print $1, $3}", outputFile: "extracted.txt" })

Configuration

Add to your MCP client config:

{ "mcpServers": { "smalledit": { "command": "mcp-smalledit" } } }

Common Use Cases

Version Bumping

sed_edit({ file: "package.json", pattern: 's/"version": "[^"]*"/"version": "1.2.3"/g' })

Update Import Paths

sed_multifile({ pattern: "s|'@old/package|'@new/package|g", filePattern: "*.ts" })

Remove Debug Code

sed_multifile({ pattern: "/\\/\\/\\s*DEBUG:/d", filePattern: "*.js" })

Fix Formatting

// Add missing semicolons sed_multifile({ pattern: "s/^\\([^;]*\\)$/\\1;/", filePattern: "*.ts" })

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

-
security - not tested
F
license - not found
-
quality - not tested

Provides tools for making small, targeted edits to files using stream editors like sed and awk, enabling efficient modifications without full file replacement.

  1. Why SmallEdit?
    1. Installation
      1. Tools Available
        1. 1. sed_edit
        2. 2. sed_multifile
        3. 3. quick_replace
        4. 4. line_edit
        5. 5. awk_process
      2. Configuration
        1. Common Use Cases
          1. Version Bumping
          2. Update Import Paths
          3. Remove Debug Code
          4. Fix Formatting
        2. Safety Features
          1. Notes
            1. License

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                A line-oriented text file editor. Optimized for LLM tools with efficient partial file access to minimize token usage.
                Last updated -
                6
                134
                Python
                MIT License
                • Apple
                • Linux
              • A
                security
                A
                license
                A
                quality
                Leverages Vim's native text editing commands and workflows, which Claude already understands, to create a lightweight code assistance layer.
                Last updated -
                8
                628
                186
                TypeScript
                MIT License
              • A
                security
                A
                license
                A
                quality
                Shell 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, python
                Last updated -
                6
                543
                Python
                Apache 2.0
                • Apple
                • Linux
              • -
                security
                A
                license
                -
                quality
                A TypeScript-based MCP server that provides tools for making precise line-based edits to text files within allowed directories.
                Last updated -
                27
                TypeScript
                MIT License
                • Apple

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/MikeyBeez/mcp-smalledit'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server