Doc MCP Server
# Doc MCP Server š
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://github.com/ceeyang-ai/doc-mcp-server)
[](https://github.com/ceeyang-ai/doc-mcp-server)
[](https://github.com/ceeyang-ai/doc-mcp-server)
A **Model Context Protocol (MCP)** server for document processing ā PDF generation with Markdown rendering, text extraction, merging, and web-to-PDF conversion.
> Built for AI agents. Works with **Hermes Agent**, **Claude Code**, **Cursor**, and any MCP-compatible client.
## ⨠Features
| Tool | Description |
|------|-------------|
| `markdown_to_pdf` | Render Markdown ā PDF with headings, lists, code blocks, HR |
| `generate_pdf` | Simple plain text ā PDF with custom font size |
| `url_to_pdf` | Fetch a URL via [Jina Reader](https://r.jina.ai) and save as PDF |
| `extract_pdf_text` | Extract text from any PDF (file, URL, or base64) |
| `pdf_metadata` | Read PDF metadata (title, author, pages, size) |
| `merge_pdfs` | Merge multiple PDFs into a single document |
| `convert_text` | Text format conversion & cleanup (case, whitespace) |
| `count_words` | Word, character, line, paragraph & reading time stats |
## š Quick Start
### Install
```bash
# From PyPI (coming soon)
pip install doc-mcp-server
# Or directly from GitHub
pip install git+https://github.com/ceeyang-ai/doc-mcp-server.git
```
### Run
```bash
# Start as MCP server (stdio mode)
doc-mcp-server
```
## š Usage with AI Agents
### Hermes Agent
Add to `~/.hermes/config.yaml`:
```yaml
mcp_servers:
doc:
command: "doc-mcp-server"
```
Restart ā use `mcp_doc_markdown_to_pdf`, `mcp_doc_extract_pdf_text`, etc.
### Claude Code / Cursor / Any MCP Client
Add to your MCP config:
```json
{
"mcpServers": {
"doc": {
"command": "doc-mcp-server"
}
}
}
```
## š Examples
### Markdown ā PDF
```python
# Via MCP tool call
result = markdown_to_pdf(
markdown="# My Report\n\n- Item 1\n- Item 2\n\n```python\nprint('hello')\n```",
title="Report",
filename="report.pdf"
)
```
### Merge PDFs
```python
result = merge_pdfs(
sources=[
"https://example.com/doc1.pdf",
"/path/to/local/file.pdf",
]
)
```
### URL ā PDF
```python
result = url_to_pdf(
url="https://en.wikipedia.org/wiki/Markdown",
filename="wiki-md.pdf"
)
```
## š Requirements
- Python 3.10+
- fpdf2 ā„ 2.8
- PyMuPDF ā„ 1.24
- mcp ā„ 1.0
## š¦ Project Structure
```
doc-mcp-server/
āāā doc_mcp_server/
ā āāā __init__.py # All tools + MarkdownPDF engine
āāā pyproject.toml # Build config (setuptools)
āāā README.md
āāā LICENSE (MIT)
```
## šØāš» Development
```bash
git clone https://github.com/ceeyang-ai/doc-mcp-server.git
cd doc-mcp-server
pip install -e .
python3 -c "from doc_mcp_server import markdown_to_pdf; print(markdown_to_pdf('# Hello', 'Test'))"
```
## š License
MIT ā free for personal and commercial use.
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: text conversion, word counting, PDF extraction, PDF generation (two variants), PDF merging, metadata reading, and URL-to-PDF conversion. No two tools have overlapping functionality.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., convert_text, extract_pdf_text, merge_pdfs). The naming is predictable and easy to understand.
With 8 tools covering text conversion, word counting, and various PDF operations (extraction, generation, merging, metadata, URL conversion), the count is well-scoped for a document processing server.
Missing some common operations like converting PDFs to other formats or editing PDF content, but the set is complete for core document tasks (create, read, merge, convert, and get metadata).