Skip to main content
Glama
jiahuidegit

doc-mcp-server

by jiahuidegit

๐Ÿ“„ Document Analyzer MCP Server

English | ็ฎ€ไฝ“ไธญๆ–‡

PyPI version License: MIT Python 3.10+ MCP

Make AI understand complex documents - MCP server solving AI context limitations


๐ŸŽฏ Key Features

  • โœ… Smart Document Analysis - Auto-detect sections, handle merged cells

  • โœ… Multi-format Support - Excel (.xlsx, .xls) | PDF/Word in development

  • โœ… Precise Field Mapping - Field mapping table + section-level reading

  • โœ… High Performance - Structured caching + lazy loading

Related MCP server: mcp-excel

๐Ÿš€ Quick Start

Installation

macOS / Linux (Recommended with pipx)

# Install pipx
brew install pipx  # macOS
# or sudo apt install pipx  # Ubuntu/Debian

# Install doc-mcp-server
pipx install doc-mcp-server

Windows

pip install doc-mcp-server

For more installation options, see Full Installation Guide

Configure Claude Code

Add to ~/.claude.json or your project's config file:

{
  "mcpServers": {
    "document-analyzer": {
      "command": "doc-mcp-server"
    }
  }
}

For detailed configuration, see Quick Start Guide

๐Ÿ“š Full Documentation

๐Ÿ’ก Usage Example

# 1. Analyze document structure
analyze_document(file_path="/path/to/document.xlsx")

# 2. Read specific section
read_section(file_path="/path/to/document.xlsx", section_name="Section 1")

# 3. Read single field
read_field(file_path="/path/to/document.xlsx", field_key="Section1_CompanyName")

๐Ÿ› ๏ธ Available Tools

Tool

Description

analyze_document

Analyze document structure and generate metadata

get_structure

Get cached document structure

read_field

Read specific field value

read_section

Read entire section data

write_field

Write field value (Excel only)

list_sections

List all sections

list_fields

List all fields

export_structure

Export document structure

๐ŸŽฏ Why Use This?

Problem: Large Excel files consume massive tokens when directly read by AI

  • โŒ Traditional: Read entire 323-row Excel โ†’ 15000+ tokens โ†’ Often fails

  • โœ… Using MCP: Structured reading โ†’ 2000 tokens โ†’ 90%+ success rate

Performance Improvements:

  • ๐Ÿš€ Token consumption reduced by 87% (15000 โ†’ 2000)

  • โœ… Success rate improved from 30% to 90%+

  • โšก Handles 323 rows ร— 24 columns with 4249 merged cells

๐Ÿค Contributing & Feedback


๐Ÿ“„ License

MIT License - see LICENSE for details


Made with โค๏ธ by Yang Jiahui

Related MCP Connectors

Related MCP Servers