Notepad++ MCP Server
FastMCP 2.12 compatible MCP server for comprehensive Notepad++ automation and control.
โจ 15 powerful tools including advanced tab and session management๐งช 18 comprehensive tests with real Windows API integration๐ฏ Production-ready with structured logging and error handling
๐ Installation & Setup
๐ฆ Option 1: DXT Installation (Recommended)
- Download the latest DXT file from Releases
- Open Claude Desktop
- Go to Settings โ Developer โ MCP Servers
- Drag & Drop the DXT file onto the extensions screen
- Restart Claude Desktop - the server will auto-install and configure
๐ Option 2: Python Installation
# Install from PyPI
pip install notepadpp-mcp
# Or install from source
git clone https://github.com/sandraschi/notepadpp-mcp.git
cd notepadpp-mcp
pip install -e .
โ๏ธ Claude Desktop Configuration
Add to your Claude Desktop configuration:
{
"mcpServers": {
"notepadpp-mcp": {
"command": "notepadpp-mcp",
"args": []
}
}
}
๐ง Manual Configuration (if needed)
{
"mcpServers": {
"notepadpp-mcp": {
"command": "python",
"args": ["-m", "notepadpp_mcp.tools.server"],
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}/src"
}
}
}
}
๐ Requirements
๐ฅ๏ธ System Requirements
- Windows 10/11 (64-bit)
- Notepad++ 8.0+ installed and accessible
- Python 3.10+ with pip
- pywin32 for Windows API integration
๐ ๏ธ Dependencies
- FastMCP 2.12+ - MCP framework
- pywin32 - Windows API bindings
- psutil - System monitoring
- pathlib - Path operations
๐จ Important Notes
- Notepad++ must be installed on the system
- Server requires Windows API access (pywin32)
- First run may require Notepad++ to be started manually
๐ฏ New in v1.0: Advanced Workspace Management
๐ Tab Management Tools
Organize and navigate multiple open files efficiently:
- List all tabs: See filenames, modification status, and active tab
- Switch tabs: Jump to any tab by index (0-based)
- Close tabs: Remove tabs individually or current tab
๐พ Session Management Tools
Save and restore your entire workspace:
- Save sessions: Preserve all open files and cursor positions
- Load sessions: Restore complete workspace state
- List sessions: Browse saved workspace configurations
๐ก Usage Examples
# Get comprehensive help about all tools
get_help()
# List all open tabs
list_tabs()
# Save current workspace
save_session("my_project_session")
# Load a saved session
load_session("my_project_session")
# Switch to tab 2
switch_to_tab(2)
๐ Project Structure
notepadpp-mcp/
โโโ src/notepadpp_mcp/
โ โโโ tools/ # MCP server implementation
โ โโโ docs/ # Documentation and examples
โ โโโ tests/ # Test suite
โ โโโ dxt/ # DXT packaging configuration
โโโ pyproject.toml # Package configuration
โโโ README.md # This file
โโโ LICENSE # MIT license
๐ Documentation
- Complete API Documentation - Comprehensive guide
- Product Requirements Document - Vision and roadmap
- Configuration Examples - Integration templates
๐ ๏ธ Tools Overview (15 Total)
| Category | Tools | Description |
|---|---|---|
| File Operations | 4 | Create, open, save, and inspect files |
| Text Operations | 2 | Insert and search text content |
| Status & Info | 3 | Monitor system and document state |
| Tab Management | 3 | Organize and navigate multiple files |
| Session Management | 3 | Save and restore workspace states |
Total: 15 production-ready tools with comprehensive Windows API integration.
โก Features
๐ File Operations (4 tools)
open_file- Open files in Notepad++new_file- Create new filessave_file- Save current fileget_current_file_info- Get file metadata
๐ Text Operations (2 tools)
insert_text- Insert text at cursor positionfind_text- Search text with case sensitivity options
๐ Status & Information (3 tools)
get_status- Notepad++ status and window infoget_system_status- Comprehensive system diagnosticsget_help- Hierarchical help system
๐ Tab Management (3 tools) โจ NEW
list_tabs- List all open tabs with metadataswitch_to_tab- Switch between tabs by indexclose_tab- Close tabs by index or current tab
๐พ Session Management (3 tools) โจ NEW
save_session- Save workspace to named sessionload_session- Load saved sessionslist_sessions- List all saved sessions
๐ง Core Capabilities
- ๐ฏ Windows Integration: Native Windows API with pywin32
- โก FastMCP 2.12: Latest MCP framework compliance
- ๐ Structured Logging: Professional error handling
- ๐งช Comprehensive Testing: 18 tests covering all tools
- ๐ Self-Documenting: Built-in help system
๐ ๏ธ Development
# Clone and install
git clone https://github.com/sandraschi/notepadpp-mcp.git
cd notepadpp-mcp
pip install -e .[dev]
# Run comprehensive tests
python -m pytest src/notepadpp_mcp/tests/
# Format code
black src/
# Test real Notepad++ integration
python demonstration_test.py
# Development helper
python dev.py test|format|build|validate-dxt
๐งช Testing
- 18 comprehensive tests covering all tools
- Real Windows API testing with actual Notepad++ integration
- Demonstration script (
demonstration_test.py) tests live functionality - CI/CD ready with automated testing pipeline
๐๏ธ Architecture
๐ฏ Core Components
- NotepadPPController - Windows API integration layer
- FastMCP Server - MCP protocol implementation
- Tool Decorators - Automatic tool registration
- Structured Logging - Professional error handling
๐ง Integration Flow
- MCP Client (Claude Desktop) โ FastMCP Server
- Server โ NotepadPPController โ Windows API
- Windows API โ Notepad++ Application โ User Interface
๐ File Structure
src/notepadpp_mcp/
โโโ tools/server.py # Main MCP server (966 lines)
โโโ tests/ # Comprehensive test suite
โโโ docs/ # Documentation and examples
โโโ dxt/ # DXT packaging configuration
๐ Troubleshooting
โ Common Issues
"Notepad++ not found"
# Check if Notepad++ is installed
python demonstration_test.py
# Install Notepad++
# Download from: https://notepad-plus-plus.org/downloads/
# Or via Chocolatey: choco install notepadplusplus
"Windows API not available"
# Install pywin32
pip install pywin32
# Restart Python environment
# Try running demonstration script again
python demonstration_test.py
"Server not connecting"
{
"mcpServers": {
"notepadpp-mcp": {
"command": "python",
"args": ["-m", "notepadpp_mcp.tools.server"],
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}/src"
}
}
}
}
"Tools not appearing in Claude"
- Restart Claude Desktop after configuration
- Check logs in Claude developer console
- Verify Notepad++ is running on the system
- Run demonstration script to test functionality
๐ Getting Help
Run Diagnostics
# Test all functionality
python demonstration_test.py
# Check tool availability
python -c "from notepadpp_mcp.tools.server import app; print('Tools:', len(app._tools))"
Debug Mode
# Enable debug logging
import logging
logging.basicConfig(level=logging.DEBUG)
# Run server with debug output
python -m notepadpp_mcp.tools.server
Manual Testing
# Test individual tools
from notepadpp_mcp.tools.server import get_status, get_help
# Get status
status = await get_status()
print("Status:", status)
# Get help
help_info = await get_help()
print("Help:", help_info)
๐ค Contributing
๐ Development Setup
# Clone repository
git clone https://github.com/sandraschi/notepadpp-mcp.git
cd notepadpp-mcp
# Install development dependencies
pip install -e .[dev]
# Run tests
python -m pytest
# Format code
black src/
# Build DXT package
python dev.py build
๐ Reporting Issues
- Run demonstration script first:
python demonstration_test.py - Check existing issues on GitHub
- Include error logs and system information
- Test with different Notepad++ versions if possible
๐ก Feature Requests
- Check existing tools in the tools overview
- Consider Windows API limitations
- Test with real Notepad++ workflows
- Follow FastMCP 2.12 patterns
๐ Changelog
v1.0.0 - Current Release
- โ 15 comprehensive tools for Notepad++ automation
- โ Real Windows API integration with pywin32
- โ Advanced tab and session management
- โ 18 comprehensive tests with full coverage
- โ DXT packaging for easy installation
- โ Production-ready error handling and logging
Planned Features
- Multi-instance support for multiple Notepad++ windows
- Plugin integration for extended functionality
- Configuration files for custom settings
- Batch operations for multiple file processing
๐ License
MIT - see LICENSE