- Explore MCP Servers
- claude-text-editor
Claude Text Editor
What is Claude Text Editor
Claude Text Editor is a seamless text editing system that integrates with Claude Desktop through the Model Context Protocol (MCP), allowing users to edit text effortlessly on macOS.
Use cases
Use cases include editing documents, refining code snippets, enhancing academic papers, and improving written communication in emails or reports.
How to use
To use Claude Text Editor, select text anywhere on macOS, right-click and choose ‘Edit with Claude’. The edited text will be automatically returned to you.
Key features
Key features include zero-friction editing, file-based processing, automatic queue management, customizable prompts, system-wide integration, desktop notifications, auto-clipboard functionality, and native MCP integration.
Where to use
Claude Text Editor can be used in various fields such as content creation, programming, academic writing, and any other area that requires text editing on macOS.
Overview
What is Claude Text Editor
Claude Text Editor is a seamless text editing system that integrates with Claude Desktop through the Model Context Protocol (MCP), allowing users to edit text effortlessly on macOS.
Use cases
Use cases include editing documents, refining code snippets, enhancing academic papers, and improving written communication in emails or reports.
How to use
To use Claude Text Editor, select text anywhere on macOS, right-click and choose ‘Edit with Claude’. The edited text will be automatically returned to you.
Key features
Key features include zero-friction editing, file-based processing, automatic queue management, customizable prompts, system-wide integration, desktop notifications, auto-clipboard functionality, and native MCP integration.
Where to use
Claude Text Editor can be used in various fields such as content creation, programming, academic writing, and any other area that requires text editing on macOS.
Content
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.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)
- Restart Claude Desktop after installation
- Create a new chat named
claude_text_editor
- 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 resources
- Claude will confirm the tools are available and start monitoring for files
- 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.txt
Usage
Basic Workflow
- Keep Claude Desktop open with the
claude_text_editor
chat active - Use the keyboard shortcut (⌥⌘.):
- With selected text: processes the selection
- Without selection: processes clipboard contents
- Claude processes automatically and saves results to
~/.claude_text_editor/outbox/
- Get instant feedback:
- Desktop notification appears (requires Homebrew + terminal-notifier)
- “Glass” sound plays (always works)
- Text is automatically copied to clipboard
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-clipboard
Quick 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 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:
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)
- Open Shortcuts app
- File → Import or drag
Edit_with_Claude.shortcut
from the project folder - The shortcut is already configured and ready to use!
Option 2: Create Shortcut Manually
- Open Shortcuts app
- Click + to create new shortcut
- Add these actions:
- Receive Text: From “Quick Actions”
- Run Shell Script:
- Shell:
/bin/bash
- Pass Input: “to stdin”
- Script:
~/claude-text-editor/claude_text_shortcut.sh
- Shell:
- Settings (⚙️):
- ✅ Use as Quick Action
- ✅ Services Menu
- Name: “Edit with Claude”
Add Keyboard Shortcut
- System Settings → Keyboard → Keyboard Shortcuts → Services
- Find “Edit with Claude” under “Text”
- 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 output
Troubleshooting
Server won’t connect
- Check the logs:
tail -100 ~/Library/Logs/Claude/mcp-server-text-editor.log
- Verify conda environment:
conda activate claude-text-editor && which python
- Test the server directly:
~/claude-text-editor/mcp-server-wrapper.sh
Tools not available in Claude Desktop
- Ensure Claude Desktop was restarted after configuration
- Check that the config file path is correct for your username
- Verify the wrapper script is executable
- 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.py
Python or module not found
- Ensure conda is properly initialized in your shell
- Verify the environment is activated:
conda activate claude-text-editor
- Check that MCP is installed:
pip list | grep mcp
Uninstallation
To completely remove Claude Text Editor from your system:
./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
~/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:
- Adding new tools to the MCP server
- Creating additional client scripts for specific workflows
- Integrating with other applications via AppleScript or shell scripts
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- 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