claude-text-editor
MCP-powered text editing system that integrates Claude
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
Quick Install (Recommended)
# Clone the repository
git clone https://github.com/lucapinello/claude-text-editor.git
cd claude-text-editor
# Run the install script
./install.shThe 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:
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 resources4. 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
# 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.txtUsage
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
# 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-clipboardQuick Command Line Function
Add this to your `~/.zshrc` or `~/.bashrc` for instant text editing:
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:
# Edit clipboard contents
ce
# Edit typed text directly
ce Fix this sentence that have bad grammerBoth 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:
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
User Input โ inbox/ โ Claude processes โ outbox/ โ User receives outputTroubleshooting
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
chmod +x ~/claude-text-editor/mcp-server-wrapper.sh
chmod +x ~/claude-text-editor/claude_text_client.pyPython 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:
./uninstall.shThe 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
~/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 instructionsExtending 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
- Built using the Model Context Protocol (MCP)
- Powered by Claude Desktop
- Python environment management by Miniforge
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
Claude Desktop for Debian-based Linux distributions for the Model Context Protocol. Enhance AI assistants with powerful integrations. Shell-based implementation
๐ OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.
Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.
ๅบไบๅคงๆจกๅๆญๅปบ็่ๅคฉๆบๅจไบบ๏ผๅๆถๆฏๆ ๅพฎไฟกๅ ฌไผๅทใไผไธๅพฎไฟกๅบ็จใ้ฃไนฆใ้้ ็ญๆฅๅ ฅ๏ผๅฏ้ๆฉChatGPT/Claude/DeepSeek/ๆๅฟไธ่จ/่ฎฏ้ฃๆ็ซ/้ไนๅ้ฎ/ Gemini/GLM-4/Kimi/LinkAI๏ผ่ฝๅค็ๆๆฌใ่ฏญ้ณๅๅพ็๏ผ่ฎฟ้ฎๆไฝ็ณป็ปๅไบ่็ฝ๏ผๆฏๆๅบไบ่ชๆ็ฅ่ฏๅบ่ฟ่กๅฎๅถไผไธๆบ่ฝๅฎขๆใ
: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...
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP