trackmcp
Back to directory
lucapinello

claude-text-editor

View on GitHub

MCP-powered text editing system that integrates Claude

6 stars ShellAI & Machine Learning Updated Sep 19, 2025

Documentation

Claude Text Editor

A seamless text editing system that integrates with Claude Desktop through the Model Context Protocol (MCP). Select text anywhere on macOS, send it to Claude for editing, and automatically receive the edited version.

Features

  • ๐Ÿš€ Zero-friction editing: Select text โ†’ Right-click โ†’ "Edit with Claude" โ†’ Get edited text
  • ๐Ÿ“ File-based processing: No timeouts, no focus switching required
  • ๐Ÿ”„ Automatic queue management: Drop files in inbox, get results in outbox
  • ๐ŸŽฏ Customizable prompts: Define your editing instructions in `claude_prompt.txt`
  • ๐Ÿ–ฅ๏ธ System-wide integration: Works with any macOS application
  • ๐Ÿ”” Desktop notifications: Get notified when text processing is complete
  • ๐Ÿ“‹ Auto-clipboard: Edited text is automatically copied to your clipboard
  • ๐Ÿค– MCP-powered: Native integration with Claude Desktop

Prerequisites

  • macOS (tested on macOS 14.x)
  • Claude Desktop app installed
  • Terminal access
  • Internet connection
  • Homebrew (optional but recommended for desktop notifications)
    • Install from: https://brew.sh
    • Or run: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`

Installation

bash
# Clone the repository
git clone https://github.com/lucapinello/claude-text-editor.git
cd claude-text-editor

# Run the install script
./install.sh

The install script will:

  • Check for Python/conda/mamba
  • Create the necessary directories
  • Set up the Python environment from `environment.yml`
  • Install dependencies (including MCP)
  • Install `terminal-notifier` for desktop notifications (if Homebrew is installed)
  • Configure Claude Desktop
  • Copy all files to the correct locations
  • Create the default prompt file

Note: Desktop notifications require Homebrew. Without it, you'll still get audio feedback (Glass sound) when text is processed.

Getting Started with Claude Desktop

After installation, you need to initialize the Claude Text Editor in Claude Desktop:

Initialize Claude Text Editor (Easy Method)

1. Restart Claude Desktop after installation

2. Create a new chat named `claude_text_editor`

3. Copy and paste this message and press Enter:

code
I'm using the Claude Text Editor MCP server.

CONTINUOUS TEXT EDITOR MONITORING TASK

CORE DIRECTIVE: Monitor and process text files indefinitely without stopping.

OPERATIONAL RULES:
- Run FOREVER until explicitly told to stop
- Work silently - NO status updates, NO explanations
- Only output when actually processing a file (minimal output only)

INFINITE LOOP PROCESS:
- check_edit_queue
- If files exist โ†’ get_text_to_edit โ†’ edit โ†’ save_edited_text
- wait_for_files (30 seconds)
- Return to step 1

OUTPUT MINIMIZATION:
- Process files without commentary
- No logging except essential file processing confirmations
- Maintain silent operation to conserve resources

4. Claude will confirm the tools are available and start monitoring for files

5. Keep this chat open while using the text editor - Claude will automatically process files as they arrive

Testing Your Setup

bash
# Test with a simple file
echo "This is a test sentance with bad grammer." > ~/.claude_text_editor/inbox/test.txt

# Claude should automatically process it if the chat is monitoring
# Check the result
cat ~/.claude_text_editor/outbox/test.txt

Usage

Basic Workflow

1. Keep Claude Desktop open with the `claude_text_editor` chat active

2. Use the keyboard shortcut (โŒฅโŒ˜.):

    3. Claude processes automatically and saves results to `~/.claude_text_editor/outbox/`

    4. Get instant feedback:

      Using the Client Script

      bash
      # Edit text from clipboard
      pbpaste | ~/claude-text-editor/claude_text_client.py
      
      # Edit text from a file
      cat myfile.txt | ~/claude-text-editor/claude_text_client.py
      
      # Edit with custom timeout
      echo "Edit this text" | ~/claude-text-editor/claude_text_client.py --timeout 60
      
      # Edit without copying to clipboard
      echo "Edit this text" | ~/claude-text-editor/claude_text_client.py --no-clipboard

      Quick Command Line Function

      Add this to your `~/.zshrc` or `~/.bashrc` for instant text editing:

      bash
      ce() {
          if [ $# -eq 0 ]; then
              # No arguments: use clipboard
              pbpaste | ~/claude-text-editor/claude_text_client.py
          else
              # Arguments provided: pipe them through the client
              printf '%s\n' "$*" | ~/claude-text-editor/claude_text_client.py
          fi
      }

      Now you can quickly edit text from anywhere:

      bash
      # Edit clipboard contents
      ce
      
      # Edit typed text directly
      ce Fix this sentence that have bad grammer

      Both methods use the full client workflow with notifications and clipboard integration!

      Customizing Edit Instructions

      Edit `~/.claude_text_editor/claude_prompt.txt` to change how Claude processes your text:

      text
      Please edit the following text to:
      - Make it more formal and professional
      - Fix any technical inaccuracies
      - Add relevant examples where appropriate
      
      Text to edit:

      System-Wide Text Editing Shortcut

      The install script sets up the necessary files. To enable the keyboard shortcut:

      Option 1: Import Pre-made Shortcut (Easiest)

      1. Open Shortcuts app

      2. File โ†’ Import or drag `Edit_with_Claude.shortcut` from the project folder

      3. The shortcut is already configured and ready to use!

      Option 2: Create Shortcut Manually

      1. Open Shortcuts app

      2. Click + to create new shortcut

      3. Add these actions:

        4. Settings (โš™๏ธ):

          Add Keyboard Shortcut

          1. System Settings โ†’ Keyboard โ†’ Keyboard Shortcuts โ†’ Services

          2. Find "Edit with Claude" under "Text"

          3. Add shortcut: โŒฅโŒ˜. (Option+Command+Period)

          Now you can:

          • Select text โ†’ โŒฅโŒ˜. โ†’ Claude processes it โ†’ Result is copied to clipboard!
          • No selection โ†’ โŒฅโŒ˜. โ†’ Claude processes clipboard contents โ†’ Result is copied to clipboard!

          Architecture

          The system consists of several components:

          • MCP Server (`text-editor-server.py`): Integrates with Claude Desktop
          • File Monitor: Watches `~/.claude_text_editor/inbox/` for new files
          • Client Script (`claude_text_client.py`): Command-line interface for text editing
          • Wrapper Script (`mcp-server-wrapper.sh`): Manages Python environment

          File Flow

          code
          User Input โ†’ inbox/ โ†’ Claude processes โ†’ outbox/ โ†’ User receives output

          Troubleshooting

          Server won't connect

          1. Check the logs: `tail -100 ~/Library/Logs/Claude/mcp-server-text-editor.log`

          2. Verify conda environment: `conda activate claude-text-editor && which python`

          3. Test the server directly: `~/claude-text-editor/mcp-server-wrapper.sh`

          Tools not available in Claude Desktop

          1. Ensure Claude Desktop was restarted after configuration

          2. Check that the config file path is correct for your username

          3. Verify the wrapper script is executable

          4. Look for error messages in the logs

          Permission errors

          bash
          chmod +x ~/claude-text-editor/mcp-server-wrapper.sh
          chmod +x ~/claude-text-editor/claude_text_client.py

          Python or module not found

          1. Ensure conda is properly initialized in your shell

          2. Verify the environment is activated: `conda activate claude-text-editor`

          3. Check that MCP is installed: `pip list | grep mcp`

          Uninstallation

          To completely remove Claude Text Editor from your system:

          bash
          ./uninstall.sh

          The uninstall script will:

          • Remove the installation directory
          • Delete the conda environment (if used)
          • Clean up Claude Desktop configuration
          • Optionally remove data directories
          • Provide instructions for manual cleanup of shortcuts

          Development

          Project Structure

          code
          ~/claude-text-editor/
          โ”œโ”€โ”€ text-editor-server.py           # MCP server implementation
          โ”œโ”€โ”€ mcp-server-wrapper.sh           # Environment wrapper
          โ”œโ”€โ”€ claude_text_client.py           # Command-line client
          โ””โ”€โ”€ ~/.claude_text_editor/
              โ”œโ”€โ”€ inbox/                      # Drop text files here
              โ”œโ”€โ”€ outbox/                     # Receive edited files here
              โ””โ”€โ”€ claude_prompt.txt           # Editing instructions

          Extending the System

          You can extend the system by:

          1. Adding new tools to the MCP server

          2. Creating additional client scripts for specific workflows

          3. Integrating with other applications via AppleScript or shell scripts

          Contributing

          Contributions are welcome! Please:

          1. Fork the repository

          2. Create a feature branch

          3. Make your changes

          4. Submit a pull request

          License

          MIT License - see LICENSE file for details

          Acknowledgments

          Frequently asked questions

          What is claude-text-editor?

          claude-text-editor is MCP-powered text editing system that integrates Claude

          How do I install claude-text-editor?

          Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

          Is claude-text-editor open source?

          Yes โ€” it is hosted on GitHub at https://github.com/lucapinello/claude-text-editor and has 6 stars.

          Related MCP tools

          aaddrickclaude-desktop-debian

          Claude Desktop for Debian-based Linux distributions for the Model Context Protocol. Enhance AI assistants with powerful integrations. Shell-based implementation

          1,409 Shell
          All-Hands-AIopenhands

          ๐Ÿ™Œ OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.

          64,677 Python
          agentartificial-intelligencechatgpt+6
          Mintplex-Labsanything-llm

          The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.

          50,686 JavaScript
          ai-agentscustom-ai-agentsdeepseek+16
          mem0aimem0

          Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.

          42,646 Python
          agentsaiai-agents+12
          zhayujiechatgpt-on-wechat

          ๅŸบไบŽๅคงๆจกๅž‹ๆญๅปบ็š„่Šๅคฉๆœบๅ™จไบบ๏ผŒๅŒๆ—ถๆ”ฏๆŒ ๅพฎไฟกๅ…ฌไผ—ๅทใ€ไผไธšๅพฎไฟกๅบ”็”จใ€้ฃžไนฆใ€้’‰้’‰ ็ญ‰ๆŽฅๅ…ฅ๏ผŒๅฏ้€‰ๆ‹ฉChatGPT/Claude/DeepSeek/ๆ–‡ๅฟƒไธ€่จ€/่ฎฏ้ฃžๆ˜Ÿ็ซ/้€šไน‰ๅƒ้—ฎ/ Gemini/GLM-4/Kimi/LinkAI๏ผŒ่ƒฝๅค„็†ๆ–‡ๆœฌใ€่ฏญ้Ÿณๅ’Œๅ›พ็‰‡๏ผŒ่ฎฟ้—ฎๆ“ไฝœ็ณป็ปŸๅ’Œไบ’่”็ฝ‘๏ผŒๆ”ฏๆŒๅŸบไบŽ่‡ชๆœ‰็Ÿฅ่ฏ†ๅบ“่ฟ›่กŒๅฎšๅˆถไผไธšๆ™บ่ƒฝๅฎขๆœใ€‚

          39,573 Python
          aiai-agentchatgpt+17
          mudlerlocalai

          :robot: The free, Open Source alternative to OpenAI, Claude and others. Self-hosted and local-first. Drop-in replacement for OpenAI, running on consumer-gra...

          36,790 Go
          aiapiaudio-generation+17

          Run your own MCP server? See who uses it and what to fix.

          Measure it with TrackMCP