DocFill Agent MCP Server
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., "@DocFill Agent MCP ServerFill the CSR template with the patient data from the CSV file."
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.
DocScribe
An LLM agent that reads, understands, and authors DOCX documents — extracting structure, filling fields, and preserving formatting.
Built on Agno + FastMCP + python-docx.
What it does
Paste meeting notes, clinical study data, or any structured content into the agent. It:
Parses the DOCX template into a structured AST (headings, paragraphs, table cells — each with a stable
element_idand run-level formatting)Exposes 5 MCP tools the agent can call:
upload_document,get_session_documents,load_document_ast,edit_document,validate_document_stateThe LLM reads the AST, matches fields to content, and calls
edit_documentwith the rightelement_idA run-level formatter re-applies the template's bold/italic labels around the new plain-text values — automatically
No HTML conversion. No regex scraping. Pure AST surgery.
Related MCP server: Zileo Docs
Architecture
┌─────────────────────────────────────────────────────────┐
│ Agno Agent (LiteLLM / Claude) │
│ instructions: 5-step workflow │
│ tool calls ──────────────────────────────────────┐ │
└────────────────────────────────────────────────────│────┘
│ HTTP/MCP
┌────────────────────────────────────────────────────▼────┐
│ FastMCP Server (:8000) │
│ │
│ upload_document ──► converter.build_ast() │
│ load_document_ast ─► DocumentStore.get_ast() │
│ edit_document ─────► converter.apply_cell_edit() │
│ + run_formatter.create_runs() │
│ validate_document_state ──► build_ast() comparison │
└─────────────────────────────────────────────────────────┘
│ python-docx read/write
┌────────▼────────────────────────────────────┐
│ Storage backend (local FS or S3) │
│ DOCX files + AST JSON per file_id │
└─────────────────────────────────────────────┘Run-level formatting preservation
The core algorithmic challenge: the template has cells like
[bold] "Study Title: " [/bold][plain] "" [/plain]The LLM produces "A Phase III randomised trial of Zetaribumab".
The formatter:
Finds the longest common prefix between the new text and the original template text
Maps that prefix to template runs (preserving bold)
For remaining text, scans for known bold-label fragments and applies their formatting
LLM-generated values always end up plain — no false bold
Quick start
# 1. Install
pip install -e ".[dev]"
# 2. Configure
cp .env.example .env
# → edit .env: set LITELLM_HOST, LITELLM_API_KEY, MODEL_ID
# 3. Create the CSR template
python examples/csr_demo/create_template.py
# 4. Start the MCP server
uvicorn docscribe.mcp.server:app --port 8000
# 5. Run the demo notebook
jupyter notebook examples/csr_demo/csr_fill_demo.ipynbProject structure
docscribe/
├── src/
│ └── docscribe/
│ ├── ast/
│ │ ├── models.py # DocumentAST, TextRun, TableCellElement, …
│ │ ├── converter.py # build_ast(), apply_cell_edit(), apply_heading_edit()
│ │ └── run_formatter.py # create_runs_from_template() — the formatting engine
│ ├── storage/
│ │ ├── local.py # LocalDocumentStore (filesystem-backed)
│ │ ├── s3.py # S3DocumentStore (boto3, same interface)
│ │ └── session.py # SessionRegistry (in-memory)
│ └── mcp/
│ └── server.py # FastMCP server — 5 tools
├── examples/
│ └── csr_demo/
│ ├── create_template.py # Generates the fictional CSR DOCX template
│ ├── csr_fill_demo.ipynb # End-to-end demo notebook
│ └── templates/ # csr_template.docx (generated)
├── pyproject.toml
├── .env.example
└── README.mdMCP tools
Tool | Args | Description |
|
| Parse DOCX → AST, register in session |
|
| List uploaded documents |
|
| Return full element list with |
|
| Apply cell/heading edits with formatting preservation |
|
| Verify AST integrity, bump version |
edit_document edit format:
[
{
"type": "table_cell",
"element_id": "cell-t0-r1-c1",
"changes": { "text": "A Phase III randomised trial of Zetaribumab 150 mg SC Q4W" }
}
]LLM provider
The agent uses Agno's model abstraction. Default is LiteLLM (any OpenAI-compatible proxy):
from agno.models.litellm import LiteLLMOpenAI
model = LiteLLMOpenAI(id="bedrock-claude-4-sonnet", api_key="...", base_url="https://your-proxy/")To switch to direct Anthropic or OpenAI:
from agno.models.anthropic import Claude
model = Claude(id="claude-sonnet-5")
from agno.models.openai import OpenAIChat
model = OpenAIChat(id="gpt-4o")Storage backends
Set STORE_BACKEND in .env:
Value | Config | Description |
|
| Local filesystem |
|
| S3-backed store, same interface |
# Start with S3
AWS_PROFILE=my-profile uvicorn docscribe.mcp.server:app --port 8000Install boto3 for S3 support: pip install ".[s3]"
Limitations & known gaps
apply_cell_editrebuilds paragraphs from scratch — complex nested tables with merged cells may lose merge state. Works for standard clinical templates.The formatter heuristic works well for
Label: valuepatterns. Multi-column mixed formatting may need manual tuning.The MCP server is single-process;
SessionRegistryis in-memory and not shared across workers.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
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
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
DocBase MCP server for AI agents
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for agentverse documentation, generated by doc2mcp.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server for reading, editing, and validating Microsoft Word documents with specialized support for track changes, comments, and footnotes. It enables structural auditing, heading extraction, and precise OOXML-level document manipulation through natural language tools.10043MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for indexing, semantic search, and generation of multi-format documents. Exposes 13 tools over JSON-RPC 2.0 so an LLM can search your local PDF, Excel, and Word files, and create or edit Excel and Word documents.AGPL 3.0
- AlicenseAqualityDmaintenanceMCP server for Word document (.docx) creation and manipulation — the production-grade document automation tool for AI agents.963MIT
- FlicenseAqualityCmaintenanceA local AI document assistant MCP server that enables listing, reading, and editing documents via tools, resources, and prompts, allowing LLMs to manage document workflows through natural language.3-
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/nicomathieu/docscribe'
If you have feedback or need assistance with the MCP directory API, please join our Discord server