The Claude Document MCP Server enables Claude Desktop to work with Microsoft Word, Excel, and PDF files through the Model Context Protocol (MCP). It provides capabilities for creating, editing, and converting documents across these popular file formats.
This MCP server requires Python 3.10 or higher.
Run the setup script to automatically install dependencies and configure for Claude Desktop:
git clone https://github.com/alejandroBallesterosC/document-edit-mcp
cd document-edit-mcp
./setup.sh
This will:
If you prefer to set up manually:
cd claude-document-mcp
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .
Copy the claude_desktop_config.json
file to:
~/Library/Application Support/Claude/
%APPDATA%\Claude\
The server provides various functions for document operations organized by file type.
create_word_document(filepath: str, content: str) -> Dict
This function creates a new Word document at the specified filepath using the provided content.
edit_word_document(filepath: str, operations: List[Dict]) -> Dict
Allows you to edit existing Word documents by specifying a list of operations such as adding, editing, or deleting paragraphs and headings.
convert_txt_to_word(source_path: str, target_path: str) -> Dict
Converts a plain text file to a Word document format.
create_excel_file(filepath: str, content: str) -> Dict
Creates a new Excel spreadsheet at the specified filepath using JSON or CSV-like text content.
edit_excel_file(filepath: str, operations: List[Dict]) -> Dict
Allows you to modify existing Excel files by updating cells, ranges, or adding/deleting rows, columns, and sheets.
convert_csv_to_excel(source_path: str, target_path: str) -> Dict
Converts a CSV file to Excel format for easier manipulation.
create_pdf_file(filepath: str, content: str) -> Dict
Creates a new PDF file at the specified location using the provided text content.
convert_word_to_pdf(source_path: str, target_path: str) -> Dict
Converts an existing Word document to PDF format.
The server logs all operations to both the console and a logs/document_mcp.log
file. Check these logs if you encounter any issues during operation.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.