MCP (Model Context Protocol) Document Reader - A powerful MCP tool for reading documents in multiple formats, enabling AI agents to truly "read" your documents.
GitHub Repository: https://github.com/xt765/mcp_documents_reader Gitee Repository: https://gitee.com/xt765/mcp_documents_reader PyPI: https://pypi.org/project/mcp-documents-reader/ Official Registry: View on MCP Registry
- Multi-format Support: Supports 4 mainstream document formats: Excel (XLSX/XLS), DOCX, PDF, and TXT
- MCP Protocol: Compliant with MCP standards, can be used as a tool for AI assistants like Trae IDE
- Easy Integration: Simple configuration for immediate use
- Reliable Performance: Successfully tested and running in Trae IDE
- File System Support: Reads documents directly from the file system
| Format | Extensions | MIME Type | Features |
|---|---|---|---|
| Excel | .xlsx, .xls | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Sheet and cell data extraction |
| DOCX | .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Text and structure extraction |
| application/pdf | Text extraction | ||
| Text | .txt | text/plain | Plain text reading |
- Python 3.8 or higher
- MCP-enabled AI tool such as Trae IDE
pip install mcp-documents-reader# Clone the repository
git clone https://github.com/xt765/mcp_documents_reader.git
# or use Gitee
# git clone https://gitee.com/xt765/mcp_documents_reader.git
cd mcp_documents_reader
# Install dependencies
pip install -e .Add the following to your Trae IDE's MCP configuration:
{
"mcpServers": {
"mcp-document-reader": {
"command": "uvx",
"args": [
"mcp-documents-reader"
]
}
}
}{
"mcpServers": {
"mcp-document-reader": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/xt765/mcp_documents_reader",
"mcp_documents_reader"
]
}
}
}{
"mcpServers": {
"mcp-document-reader": {
"command": "uvx",
"args": [
"--from",
"git+https://gitee.com/xt765/mcp_documents_reader",
"mcp_documents_reader"
]
}
}
}DOCUMENT_DIRECTORY- Directory where documents are stored (default: "./documents")
After configuration, AI assistants can directly call the following tool:
Read any supported document type with a unified interface.
read_document(filename="example.docx")
read_document(filename="example.pdf")
read_document(filename="example.xlsx")
read_document(filename="example.txt")
Read any supported document type.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| filename | string | ✅ | Document file path, supports absolute or relative paths |
MIT