Document Operations (Word, Excel, PDF) MCP server

Enables document operations on Microsoft Word, Excel, and PDF files through FastMCP and Python tools for creating, editing, converting, and manipulating files without switching applications
Back to servers
Provider
Alejandro Ballesteros
Release date
Mar 25, 2025
Language
Python
Stats
17 stars

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.

Installation

This MCP server requires Python 3.10 or higher.

Automatic Setup (Recommended)

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:

  • Create a virtual environment
  • Install required dependencies
  • Configure the server for Claude Desktop
  • Create necessary directories

Manual Setup

If you prefer to set up manually:

  1. Install dependencies:
cd claude-document-mcp
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .
  1. Configure Claude Desktop:

Copy the claude_desktop_config.json file to:

  • Mac: ~/Library/Application Support/Claude/
  • Windows: %APPDATA%\Claude\
  1. Restart Claude Desktop

Using the MCP Server

The server provides various functions for document operations organized by file type.

Working with Word Documents

Creating Word Documents

create_word_document(filepath: str, content: str) -> Dict

This function creates a new Word document at the specified filepath using the provided content.

Editing Word Documents

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.

Converting Text Files to Word

convert_txt_to_word(source_path: str, target_path: str) -> Dict

Converts a plain text file to a Word document format.

Working with Excel Spreadsheets

Creating Excel Files

create_excel_file(filepath: str, content: str) -> Dict

Creates a new Excel spreadsheet at the specified filepath using JSON or CSV-like text content.

Editing Excel Files

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.

Converting CSV to Excel

convert_csv_to_excel(source_path: str, target_path: str) -> Dict

Converts a CSV file to Excel format for easier manipulation.

Working with PDF Files

Creating PDF Files

create_pdf_file(filepath: str, content: str) -> Dict

Creates a new PDF file at the specified location using the provided text content.

Converting Word to PDF

convert_word_to_pdf(source_path: str, target_path: str) -> Dict

Converts an existing Word document to PDF format.

Troubleshooting

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.

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later