An extensible Model Context Protocol (MCP) server that exposes a powerful suite of document processing, file transformation, data visualization, and sandboxed Python code execution tools to any MCP-compatible client (e.g., Claude Desktop, Cursor, LibreChat).
docAgent-MCPServer enables LLMs to perform heavy lifting on local files and documents directly from your MCP client interface. It provides standardized tools for text extraction, translation, summarization, file format conversions, archiving/compression, plotting, and secure containerized code execution.
| Tool | Description |
|---|---|
text_extractor |
Extracts raw text and structure from various document formats (PDF, DOCX, TXT, etc.). |
text_summarizer |
Generates concise, structured summaries of document contents using LLM backends. |
translator |
Translates document text across multiple languages while preserving contextual meaning. |
file_conversion |
Converts documents and media between different supported file formats. |
file_compression |
Optimizes and reduces file sizes across document and media types. |
archiver |
Creates and manages ZIP archives and bundled files. |
generate_plot |
Generates charts and visual data plots based on input data schemas. |
py_runtime |
Runs Python scripts inside an isolated, containerized Docker sandbox. |
fallback |
Handles graceful error recovery and input normalization across tools. |
.
├── app/
│ ├── core/
│ │ └── logging_config.py # Application logging setup
│ ├── dependencies/
│ │ └── llm.py # LLM provider clients & configs
│ ├── schemas/ # Pydantic validation models
│ │ ├── compression_schema.py
│ │ ├── extract_schema.py
│ │ ├── fallback_input.py
│ │ ├── file_conversion_schema.py
│ │ ├── file_zipper_schema.py
│ │ ├── plotter_schema.py
│ │ ├── py_runtime_schema.py
│ │ ├── summarize_schema.py
│ │ └── translation_schema.py
│ ├── tools/ # MCP Tool implementations
│ │ ├── archiver.py
│ │ ├── fallback.py
│ │ ├── file_compression.py
│ │ ├── file_conversion.py
│ │ ├── generate_plot.py
│ │ ├── py_runtime.py
│ │ ├── text_extractor.py
│ │ ├── text_summarizer.py
│ │ └── translator.py
│ └── utils/
│ └── Utils.py # Shared utility functions
├── python_runtime_container_setup/ # Sandboxed Docker runtime environment
│ ├── Dockerfile
│ ├── entrypoint.sh
│ ├── test_container.py
│ └── watcher.py
├── main.py # MCP server entry point
├── pyproject.toml # Project metadata and dependencies
└── uv.lock # Lockfile
- Python:
3.12+ - Package Manager:
uv(recommended) orpip - Docker: Required if using the
py_runtimecontainerized execution tool - API Keys: Required LLM provider API keys (e.g.,
OPENAI_API_KEY,ANTHROPIC_API_KEY, etc. depending on your configuration) - Google Cloud Credentials: JSON service account key files for Vision API, Document AI, and OCR services
git clone https://github.com/your-username/docAgent-MCPServer.git
cd docAgent-MCPServerUsing uv:
uv syncOr using standard pip:
python3.12 -m venv .venv
source .venv/bin/activate
pip install .Create a .env file in the root directory. refer to .env.example to produce required environment
Configure Google Service Account Credentials Document processing services (Document AI, Vision API, and OCR) require Google Cloud Service Account JSON credentials.
Create a credentials/ directory in the project root and place your downloaded JSON key files inside:
mkdir -p credentialsEnsure your JSON key files match the expected relative paths:
credentials/service-account.json(Google Cloud Vision API key)credentials/document_ai.json(Google Document AI key)credentials/doc-agent-ocr-key.json(Google Application / OCR credentials)
If you plan to use the py_runtime tool for sandboxed Python code execution:
docker build -t docagent-python-runtime ./python_runtime_container_setup# Using uv
uv run python main.py
# Using an activated virtual environment
python main.py- Add New Tools: Implement your tool function under
app/tools/and define its input/output model inapp/schemas/. - Register Tools: Import and attach tools to the server instance in
main.py. - Container Testing: Run
python python_runtime_container_setup/test_container.pyto verify the Docker execution environment.
This project is licensed under the MIT License.