mcp-local-reader
Enables OCR text recognition from images using OpenAI vision models (e.g., GPT-4o) to extract and convert image content into searchable markdown.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-local-readerread the file /home/user/document.pdf"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-LOCAL-Reader
中文版 | 日本語 | Français | Deutsch
AI-Ready Document Converter - Transform any local file into AI-optimized markdown format for seamless integration with Claude Desktop, Claude Code, and other MCP clients.
Intelligent Document Processing - High-performance local file content extraction with advanced parsing for PDF, Office documents, images, and more. Automatically converts complex documents into clean, structured markdown that AI models can easily understand and process.
Features
📄 AI-Optimized File Processing
PDF Documents: Advanced parsing with PyMuPDF4LLM → Clean markdown output
Office Suite: Word, Excel, PowerPoint → Structured tables and text
OpenDocument: ODT, ODS, ODP → Standardized markdown format
Text & Data: Markdown, JSON, CSV, EPUB → Enhanced AI readability
Images: OCR text recognition → Searchable markdown content
Archives: Smart extraction → Organized document collections
🚀 Intelligent Performance
Smart Caching: Remembers processed files for instant re-access
Lazy Loading: Only loads needed components - 80% faster startup
Concurrent Processing: Handles multiple files simultaneously
Resource Optimization: Prevents system overload with smart limits
🔒 Security & Control
Directory Permissions: Restrict access to specific directories
Path Validation: Secure file access with absolute path requirements
File Size Limits: Prevent DoS with configurable size restrictions
Local-First: No data leaves your machine - complete privacy
Related MCP server: DocMistral MCP Server
Quick Start
Prerequisites
Python 3.11+
Installation
Option 1: One-Command Setup (Recommended)
# Clone and auto-configure
git clone https://github.com/freefish1218/mcp-local-reader.git
cd mcp-local-reader
chmod +x install.sh && ./install.shThe installer will guide you through three installation modes:
Minimal: PDF and basic text files only (smallest footprint)
Standard: Office documents support, no OCR (recommended)
Complete: All features including OCR and archive processing
Option 2: Manual Installation
# Install uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh
# Setup project
git clone https://github.com/freefish1218/mcp-local-reader.git
cd mcp-local-reader
uv sync
# Configure environment
cp env.example .env
# Edit .env with your settings
# Start server
./start_mcp.shConfiguration for Claude Desktop
Automatic Configuration
chmod +x configure_claude.sh && ./configure_claude.shManual Configuration
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or equivalent:
{
"mcpServers": {
"local-reader": {
"command": "/absolute/path/to/mcp-local-reader/start_mcp.sh",
"args": [],
"env": {
"LOCAL_FILE_ALLOWED_DIRECTORIES": "/Users/username/Documents,/Users/username/Downloads"
}
}
}
}Configuration for Claude Code
Add to .claude/claude_config.json:
{
"mcpServers": {
"local-reader": {
"command": "/absolute/path/to/mcp-local-reader/start_mcp.sh",
"args": [],
"env": {
"LOCAL_FILE_ALLOWED_DIRECTORIES": "/Users/username/Documents,/Users/username/Downloads"
}
}
}
}Usage
After setup, use these features directly in conversations:
📄 Read & Convert to AI-Ready Markdown
Transform any file into AI-optimized markdown format:
Read the content from /Users/username/Documents/report.pdf
→ Converts to clean markdown with tables, headings, and structure
Parse /Users/username/data.xlsx and show me the data structure
→ Extracts spreadsheet data as markdown tables
Extract text from /Users/username/presentation.pptx
→ Organizes slides into structured markdown sections🔄 Save as Markdown Files
Convert and save documents as AI-ready markdown files:
Convert /Users/username/contract.pdf to markdown format
→ Creates contract.pdf.md with structured content
Save /Users/username/analysis.xlsx as markdown in /Users/username/output/
→ Saves formatted tables and data as markdownConfiguration
Essential Settings (.env)
# File access control (REQUIRED)
LOCAL_FILE_ALLOWED_DIRECTORIES=/Users/username/Documents,/Users/username/Downloads
# Performance optimization
TOTAL_CACHE_SIZE_MB=500 # Unified cache limit
CACHE_EXPIRE_DAYS=30 # Cache retention
FILE_READER_MAX_FILE_SIZE_MB=20 # File size limit
# Logging
LOG_LEVEL=INFOOptional OCR Settings
For image text recognition:
# Vision model for OCR
LLM_VISION_BASE_URL=https://api.openai.com/v1
LLM_VISION_API_KEY=sk-your-api-key-here
LLM_VISION_MODEL=gpt-4o # or qwen-vl-plusEnvironment Variables
Variable | Required | Default | Description |
| ✅ |
| Comma-separated allowed directories |
| ❌ |
| Unified cache size limit |
| ❌ |
| Maximum file size |
| ❌ |
| Logging level |
| ❌ | - | OCR vision model API key |
MCP Tools
read_local_file
Extract content from local files and return as AI-optimized markdown.
Parameter | Type | Description |
| string | Absolute path to the file |
| number | File size limit in MB (optional) |
convert_local_file
Convert files to AI-ready markdown and save to filesystem.
Parameter | Type | Description |
| string | Absolute path to input file |
| string | Output path (optional, defaults to input+.md) |
| number | File size limit in MB (optional) |
| boolean | Overwrite existing files (default: false) |
Supported File Types
Document Formats
PDF:
.pdfMicrosoft Office:
.doc,.docx,.ppt,.pptx,.xls,.xlsxOpenDocument:
.odt,.ods,.odpText:
.txt,.md,.rtf,.csv,.json,.xml
Image Formats (with OCR)
Common:
.png,.jpg,.jpeg,.gif,.bmp,.tiffAdvanced:
.webp,.svg
Archive Formats
Compressed:
.zip,.tar,.tar.gz,.7zOffice:
.docx,.xlsx,.pptx(internally zip-based)
Special Formats
E-books:
.epubData:
.csv,.tsv,.json
Architecture
Core Components
FileReader (
src/file_reader/core.py): Main orchestrator for file content extractionMCP Server (
src/mcp_server.py): FastMCP-based server providing MCP toolsParser System (
src/file_reader/parsers/): Specialized parsers for different file typesCache Manager (
src/file_reader/cache_manager.py): Unified caching systemStorage Layer (
src/file_reader/storage/): Secure local file access
Performance Optimizations
Unified Caching: Single cache instance instead of multiple (reduced from ~6GB to 500MB default)
Lazy Loading: Parsers loaded on-demand, not at startup
Dependency Optimization: Optional dependencies for advanced features
Resource Limits: Configurable memory and file size limits
Development
Setup Development Environment
git clone https://github.com/freefish1218/mcp-local-reader.git
cd mcp-local-reader
uv sync
source .venv/bin/activate # On Unix/macOSRunning Tests
# Run all tests
uv run python tests/run_tests.py
# Specific test categories
uv run python tests/run_tests.py --models # Data models
uv run python tests/run_tests.py --parsers # File parsers
uv run python tests/run_tests.py --core # Core functionality
uv run python tests/run_tests.py --server # MCP server
# With coverage
uv run python tests/run_tests.py -c
# Alternative pytest usage
PYTHONPATH=src uv run pytest tests/ -vAdding New Parsers
Create parser in
src/file_reader/parsers/Inherit from
BaseParserRegister in
parser_loader.pyAdd tests in
tests/test_parsers.py
See CONTRIBUTING.md for detailed development guidelines.
Performance Characteristics
Smart Caching: Instantly access previously processed files without re-conversion
Efficient Memory Use: Optimized from 6GB+ to 500MB default cache size
Lightning Startup: 80% faster startup with on-demand component loading
Parallel Processing: Handle multiple document conversions simultaneously
System Requirements
Python: 3.11+
OS: macOS, Linux, Windows
Memory: 2GB+ recommended for large files
Optional: LibreOffice (legacy Office files), Pandoc (special conversions)
FAQ
Q: Files not reading correctly?
A: Ensure LOCAL_FILE_ALLOWED_DIRECTORIES includes your file's directory.
Q: OCR not working for images?
A: Configure LLM_VISION_API_KEY with a valid vision model API key (OpenAI GPT-4o or compatible).
Q: Want to improve processing speed?
A: The smart cache automatically remembers processed files. Clear cache directory if you want fresh processing of all files.
Q: Legacy Office files (.doc/.ppt) failing?
A: Install LibreOffice: brew install --cask libreoffice (macOS) or equivalent for your OS.
Q: What file formats are supported?
A: PDF, Word, Excel, PowerPoint, OpenDocument, images (with OCR), archives, text files, and more.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to contribute to this project.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links
Issues: Report Issues
Documentation: CLAUDE.md for detailed development guide
Model Context Protocol: Official MCP Documentation
Acknowledgments
Built with FastMCP
PDF parsing powered by PyMuPDF4LLM
Caching system using DiskCache
Available Tools
2 toolsconvert_local_fileA
将本地文件转换为markdown文件并保存到文件系统
| Name | Required | Description | Default |
|---|---|---|---|
| max_size | No | 单个文件大小限制(MB),默认20MB | |
| file_path | Yes | 本地文件绝对路径,必须使用完整的绝对路径(如/Users/user/document.pdf)。支持格式:PDF、Office文档(doc/docx/xls/xlsx/ppt/pptx)、OpenDocument(odt/ods/odp)。不支持图片 | |
| overwrite | No | 是否覆盖已存在的文件 | |
| output_path | No | 输出markdown文件路径,默认为原文件名+.md |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full transparency burden. It does disclose the key side effect (saving to the filesystem), but it does not mention overwrite behavior, size limits, or unsupported inputs; these are left to the schema rather than stated at tool level.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler: 'convert local file to markdown and save to filesystem' says what the tool does without waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that writes files, the description is minimally complete: it names the conversion and the save side effect, and the schema covers formats, limits, output path, and overwrite. However, it does not address sibling selection or any return/failure behavior, and there is no output schema to fill that gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the schema provides detailed parameter descriptions for file_path, max_size, overwrite, and output_path. The tool description adds no parameter-level meaning beyond that, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'convert', the resource ('local file'), and the outcome ('markdown file saved to filesystem'). It is not a tautology, and the action is distinct from the sibling read_local_file, though it does not explicitly call out that sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit guidance on when to choose this tool over read_local_file or what conditions make conversion appropriate. The intended use is implied by the verb 'convert', but no alternatives or exclusions are named.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_local_fileC
读取本地文件系统中的PDF、Office文档
| Name | Required | Description | Default |
|---|---|---|---|
| max_size | No | 单个文件大小限制(MB),默认20MB | |
| file_path | Yes | 本地文件绝对路径,必须使用完整的绝对路径(如/Users/user/document.pdf)。支持格式:PDF、Office文档(doc/docx/xls/xlsx/ppt/pptx)、OpenDocument(odt/ods/odp)。不支持图片 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It conveys that the operation is read-only, but it does not disclose what the tool returns, how size limits are enforced, what happens on unsupported files, or any error/access behavior. This is thin for a tool with no annotation safety net.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single efficient sentence that front-loads the core purpose. It earns its place, but it is slightly too sparse to fully compensate for the missing usage and behavior context.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter read tool, the description plus schema is close to minimally viable: the path format, supported formats, and size limit are present. However, with no output schema and no annotation, the absence of any statement about return type or behavior is a clear gap, though not a crippling one.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds no meaning about file_path or max_size beyond what the schema already documents, nor does it need to, since both parameters are well described in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('读取'/'read'), a clear resource (local file system documents), and lists the supported families (PDF, Office). It is distinguishable from the sibling convert_local_file by the read-vs-convert contrast, though it does not explicitly name the sibling or call out the differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given for when to use this tool versus convert_local_file or any other alternative. The schema's format restrictions indirectly imply the tool's input scope, but the description itself provides no selection guidance, exclusions, or alternative routing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.2.4- First observed
convert_local_file - First observed
read_local_file
TDQS
The two tools have clearly distinct purposes: one reads a local file's content, the other converts a local file to markdown. There is no overlap in their core actions.
Both tool names follow the consistent verb_noun pattern (read_local_file, convert_local_file), making the naming predictable and easy to understand.
With only two tools, the server feels thin for a general local file reader/converter. The count is borderline but not unreasonable given the narrow scope.
The core operations of reading and converting are covered, but the server lacks supporting operations like listing files or checking file metadata. Minor gaps exist but are not severe for the stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Convert files, URLs, and documents to clean, AI-ready Markdown via MCP.
Convert PDF, DOCX, HTML, and URLs to clean, LLM-ready markdown with tables preserved
Convert documents and web pages to clean Markdown: PDF, DOCX, XLSX, EPUB, scanned files, any URL.
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceConverts files (PDF, Word, images, etc.) to Markdown within Claude Desktop to reduce token usage.-
- AlicenseNot gradedqualityAmaintenanceConverts documents and images to Markdown using Mistral AI's OCR, enabling AI-powered document processing via MCP-compatible clients like Claude Desktop.2742MIT
- FlicenseAqualityCmaintenanceConverts files (PDF, DOCX, PPTX, XLSX, images via OCR) and URLs to Markdown, enabling AI clients to read them via a single MCP tool.1-
- AlicenseNot gradedqualityBmaintenanceConvert any file or URL to clean AI-ready Markdown directly from Claude, Claude Code, Cursor, or any MCP-compatible AI agent.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/freefish1218/mcp-local-reader'
If you have feedback or need assistance with the MCP directory API, please join our Discord server