mcp-doc-reader

mcp-doc-reader

Enables AI assistants to read and extract text content from PDF, Excel, and Word documents via the Model Context Protocol.

Category
Visit Server

README

MCP Doc Reader

English | 中文

A Model Context Protocol (MCP) server that enables AI assistants to read and extract content from PDF, Excel, and Word documents.

Features

  • PDF Reading: Extract text content from PDF files using pdfminer.six
  • Excel Reading: Read .xlsx and .xls files with formatted table output
  • Word Reading: Extract text and tables from .docx files
  • Cross-Platform: Works on Windows, Linux, and macOS
  • Unicode Support: Full support for non-ASCII characters (Chinese, Japanese, etc.)

Installation

Using uvx (Recommended)

uvx mcp-doc-reader

Using pip

pip install mcp-doc-reader

From Source

git clone https://github.com/yourusername/mcp-doc-reader.git
cd mcp-doc-reader
pip install -e .

Configuration

Add the following to your MCP client configuration (e.g., Claude Desktop, Cursor):

Option 1: Using uvx (Recommended)

{
  "mcpServers": {
    "DocReader": {
      "command": "uvx",
      "args": ["mcp-doc-reader"]
    }
  }
}

Option 2: Using pip-installed command

{
  "mcpServers": {
    "DocReader": {
      "command": "mcp-doc-reader"
    }
  }
}

Option 3: Windows with Unicode Support

For Windows systems with non-ASCII file paths (e.g., Chinese characters):

{
  "mcpServers": {
    "DocReader": {
      "command": "cmd",
      "args": [
        "/c",
        "chcp 65001 >nul && uvx mcp-doc-reader"
      ]
    }
  }
}

Option 4: Linux/macOS with Python module

{
  "mcpServers": {
    "DocReader": {
      "command": "python",
      "args": ["-m", "docreader"]
    }
  }
}

Available Tools

read_pdf

Read text content from a PDF file.

Parameters:

  • file_path (string, required): Absolute path to the PDF file

Example:

{
  "name": "read_pdf",
  "arguments": {
    "file_path": "/path/to/document.pdf"
  }
}

read_excel

Read content from an Excel file (.xlsx or .xls).

Parameters:

  • file_path (string, required): Absolute path to the Excel file

Example:

{
  "name": "read_excel",
  "arguments": {
    "file_path": "/path/to/spreadsheet.xlsx"
  }
}

read_word

Read text content from a Word file (.docx).

Parameters:

  • file_path (string, required): Absolute path to the Word file

Example:

{
  "name": "read_word",
  "arguments": {
    "file_path": "/path/to/document.docx"
  }
}

Usage Examples

Once configured, you can ask your AI assistant to:

  • "Read the contents of /path/to/report.pdf"
  • "Extract data from /path/to/data.xlsx"
  • "What does the document /path/to/memo.docx contain?"

Development

Setup Development Environment

git clone https://github.com/yourusername/mcp-doc-reader.git
cd mcp-doc-reader
pip install -e ".[dev]"

Run Tests

pytest

Build Package

pip install build
python -m build

Publish to PyPI

pip install twine
twine upload dist/*

Project Structure

mcp-doc-reader/
├── src/
│   └── docreader/
│       ├── __init__.py
│       ├── __main__.py
│       ├── server.py
│       └── readers/
│           ├── __init__.py
│           ├── pdf_reader.py
│           ├── excel_reader.py
│           └── word_reader.py
├── examples/
│   ├── mcp_config_pip.json
│   ├── mcp_config_uvx.json
│   ├── mcp_config_windows.json
│   └── mcp_config_linux.json
├── pyproject.toml
├── README.md
└── LICENSE

Troubleshooting

Windows: Unicode/Chinese filename issues

If you encounter issues with non-ASCII characters in file paths on Windows, use the Windows-specific configuration that sets the code page to UTF-8:

{
  "mcpServers": {
    "DocReader": {
      "command": "cmd",
      "args": ["/c", "chcp 65001 >nul && mcp-doc-reader"]
    }
  }
}

.doc files not supported

The Word reader only supports .docx format. To read .doc files, please convert them to .docx first using Microsoft Word or LibreOffice.

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured