Skip to main content
Glama

Features

  • Read & Write Integration: Capable of both reading documents and generating Word / PowerPoint files based on structured parameters.

  • Wide Format Support: Supports TXT, CSV, Markdown, DOC, DOCX, PDF, PPT, PPTX, EPUB, XLSX, XLS.

  • Structured Writing: Supports generation of paragraphs, tables, title pages, bullet point pages, and presentation tables.

  • Legacy Format Export: Can export .doc and .ppt when LibreOffice is installed.

  • MCP Protocol: Compliant with MCP standards, usable as a tool for AI assistants (e.g., Trae IDE).

  • Easy Integration: Ready to use with simple configuration.

  • Reliable Performance: Automated testing covers reading, generation, conversion fallbacks, and tool interfaces.

  • File System Support: Read and write documents directly from the file system.


Related MCP server: office-mcp-server

📚 Documentation Center

User Guide · API Reference · Contribution Guide · Changelog · License


Architecture

graph TB
    A[AI Assistant / User<br/>AI 助手 / 用户] -->|Call MCP tools<br/>调用 MCP 工具| B[MCP Document Reader<br/>MCP 文档读取器]
    B -->|Read<br/>读取| C[Document Readers<br/>文档读取器]
    B -->|Generate<br/>生成| D[Document Writers<br/>文档生成器]
    C -->|TXT / CSV / MD| E[Text-based Readers<br/>文本类读取器]
    C -->|DOC / DOCX| F[Word Readers<br/>Word 读取器]
    C -->|PPT / PPTX| G[Presentation Readers<br/>演示读取器]
    C -->|PDF / EPUB / Excel| H[Structured Readers<br/>结构化读取器]
    D -->|write_word_document| I[DOCX Builder<br/>DOCX 生成器]
    D -->|write_presentation| J[PPTX Builder<br/>PPTX 生成器]
    I -->|Optional conversion<br/>可选转换| K[LibreOffice -> DOC]
    J -->|Optional conversion<br/>可选转换| L[LibreOffice -> PPT]
    E --> M[Return text / metadata<br/>返回文本 / 元数据]
    F --> M
    G --> M
    H --> M
    K --> M
    L --> M
    M --> A
    
    style A fill:#e1f5ff
    style B fill:#fff4e1
    style C fill:#f0f0f0
    style D fill:#e8f5e9
    style E fill:#e8f5e9
    style F fill:#e8f5e9
    style G fill:#e8f5e9
    style H fill:#fff9c4

Supported Formats

Capability

Format

Extension

Description

Read

Text

.txt

Supports multi-encoding text extraction

Read

CSV

.csv

Normalized to tab-separated text

Read

Markdown

.md, .markdown

Direct Markdown text extraction

Read

Word

.doc, .docx

.doc read via command / LibreOffice fallback

Read

PDF

.pdf

Text extraction

Read

PowerPoint

.ppt, .pptx

.pptx native parsing, .ppt fallback read

Read

EPUB

.epub

Chapter extraction based on spine order

Read

Excel

.xlsx, .xls

Extract worksheet and cell content

Generate

Word

.docx

Native generation, supports paragraphs and tables

Generate

Word

.doc

Generated via docx -> doc LibreOffice conversion

Generate

PowerPoint

.pptx

Native generation, supports titles, body, bullets, tables

Generate

PowerPoint

.ppt

Generated via pptx -> ppt LibreOffice conversion

Installation

pip install mcp-documents-reader

If you need PowerPoint generation functionality, ensure python-pptx is available in your environment.

If you need to export legacy formats like .doc or .ppt, please install LibreOffice and ensure soffice or libreoffice is added to your PATH.

Install from Source

git clone https://github.com/xt765/mcp_documents_reader.git
cd mcp_documents_reader
pip install -e .

MCP Tools

This server provides the following tools:

read_document

Read any supported document type using a unified interface.

Parameters:

  • filename (string, required): Document file path, supports absolute or relative paths.

extract_document_images

Extract embedded images from DOCX files and return structured JSON metadata.

Parameters:

  • filename (string, required): DOCX file path.

  • output_dir (string, optional): Directory to export images.

write_word_document

Generate .docx Word documents, or export .doc via LibreOffice conversion.

Parameters:

  • filename (string, required): Output path, suffix must be .docx or .doc.

  • title (string, optional): Document title.

  • paragraphs (array of strings, optional): Paragraphs to write in order.

  • tables (array of objects, optional): Table definitions, supports title, headers, rows.

write_presentation

Generate .pptx presentations, or export .ppt via LibreOffice conversion.

Parameters:

  • filename (string, required): Output path, suffix must be .pptx or .ppt.

  • title (string, optional): Title page title.

  • subtitle (string, optional): Title page subtitle.

  • slides (array of objects, optional): Slide definitions, supports title, paragraphs, bullets, table.

Configuration

Using in Trae IDE / Claude Desktop

Add the following to your MCP configuration file:

Option 1: Using PyPI (Recommended)

{
  "mcpServers": {
    "mcp-document-reader": {
      "command": "uvx",
      "args": [
        "mcp-documents-reader"
      ]
    }
  }
}

Option 2: Using GitHub Repository

{
  "mcpServers": {
    "mcp-document-reader": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/xt765/mcp_documents_reader",
        "mcp_documents_reader"
      ]
    }
  }
}

Option 3: Using Gitee Repository (Faster for domestic access)

{
  "mcpServers": {
    "mcp-document-reader": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://gitee.com/xt765/mcp_documents_reader",
        "mcp_documents_reader"
      ]
    }
  }
}

Usage

As an MCP Tool

Once configured, the AI assistant can directly call the following tools:

# 读取 DOCX 文件
read_document(filename="example.docx")

# 读取演示文稿
read_document(filename="example.pptx")

# 生成 DOCX 报告
write_word_document(
    filename="report.docx",
    title="周报",
    paragraphs=["本周总结", "下周计划"],
    tables=[
        {
            "title": "指标表",
            "headers": ["名称", "数值"],
            "rows": [["线索", 42], ["成交", 8]],
        }
    ],
)

# 生成 PPTX 汇报
write_presentation(
    filename="briefing.pptx",
    title="季度汇报",
    subtitle="Q2",
    slides=[
        {
            "title": "亮点",
            "paragraphs": ["概述段落"],
            "bullets": ["重点 A", "重点 B"],
        }
    ],
)

As a Python Library

from mcp_documents_reader import DocumentReaderFactory

# 使用工厂类(推荐)
reader = DocumentReaderFactory.get_reader("document.pdf")
content = reader.read("/path/to/document.pdf")

# 检查格式是否支持
if DocumentReaderFactory.is_supported("file.xlsx"):
    reader = DocumentReaderFactory.get_reader("file.xlsx")
    content = reader.read("/path/to/file.xlsx")

Tool Interface Details

read_document

Read any supported document type.

Parameter

Type

Required

Description

filename

string

Document file path, supports absolute or relative paths

Install Server
A
license - permissive license
A
quality
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • Presentations.AI MCP server — create designed slide decks from a topic, text, or document.

  • MCP-native collaborative markdown editor with real-time AI document editing

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/crispvibe/mcp-document-studio'

If you have feedback or need assistance with the MCP directory API, please join our Discord server