How nicomathieu/docscribe works
DocScribe turns DOCX templates into editable, formatting-aware ASTs, exposes document operations over MCP, and persists input/output files and ASTs. Its main workflow is template upload, AST inspection, LLM-directed edits, and validation. The README also documents optional RAG utilities for retrieval; their connection to the document-authoring workflow is not shown, so they are modeled separately. Relationships follow README statements and the shown server and utility excerpts; other source behavior was not inspected.
Main entry points: server.py Edit document · local.py Local document store · s3.py S3 document store · converter.py DOCX AST converter
Components 18
Document authoring
- DOCX AST converter
src/docscribe/ast/converter.py - Document AST models
src/docscribe/ast/models.py - Run formatter
src/docscribe/ast/run_formatter.py
MCP interface
- MCP tools
src/docscribe/mcp/server.py - Upload document
src/docscribe/mcp/server.py - Load document AST
src/docscribe/mcp/server.py - Edit document
src/docscribe/mcp/server.py - Validate state
src/docscribe/mcp/server.py
Document persistence
- Local document store
src/docscribe/storage/local.py - S3 document store
src/docscribe/storage/s3.py - Session registry
src/docscribe/storage/session.py
RAG utilities
- RAG utilities
src/docscribe/rag_utils.py - Embedding service
src/docscribe/rag_utils.py - OpenSearch retrieval
src/docscribe/rag_utils.py
Other components
- Document author
- Agno LLM agent
- LiteLLM endpoint
- OpenSearch service
Connections 30
- Document author → Agno LLM agent: provides content
README.md - Agno LLM agent → MCP tools: calls tools
README.md - MCP tools → Upload document: dispatches
README.md - MCP tools → Load document AST: dispatches
README.md - MCP tools → Edit document: dispatches
README.md - MCP tools → Validate state: dispatches
README.md - Upload document → DOCX AST converter: builds AST
README.md - Upload document → Local document store: stores files
src/docscribe/mcp/server.py - Upload document → S3 document store: stores files
src/docscribe/mcp/server.py - Upload document → Session registry: registers document
src/docscribe/mcp/server.py - Load document AST → Session registry: gets record
src/docscribe/mcp/server.py - Load document AST → Local document store: reads AST
src/docscribe/mcp/server.py - Load document AST → S3 document store: reads AST
src/docscribe/mcp/server.py - Edit document → Session registry: gets record
src/docscribe/mcp/server.py - Edit document → Local document store: reads and writes
src/docscribe/mcp/server.py - Edit document → S3 document store: reads and writes
src/docscribe/mcp/server.py - Edit document → Run formatter: creates runs
README.md - Edit document → DOCX AST converter: applies edits
README.md - Validate state → Session registry: gets and updates
src/docscribe/mcp/server.py - Validate state → Local document store: reads and stores AST
src/docscribe/mcp/server.py - Validate state → S3 document store: reads and stores AST
src/docscribe/mcp/server.py - Validate state → DOCX AST converter: rebuilds AST
src/docscribe/mcp/server.py - DOCX AST converter → Document AST models: creates elements
src/docscribe/ast/converter.py - Run formatter → Document AST models: returns text runs
src/docscribe/ast/run_formatter.py - Local document store → Document AST models: serializes AST
src/docscribe/storage/local.py - S3 document store → Document AST models: serializes AST
src/docscribe/storage/s3.py - RAG utilities → Embedding service: provides embeddings
src/docscribe/rag_utils.py - Embedding service → LiteLLM endpoint: requests vectors
src/docscribe/rag_utils.py - OpenSearch retrieval → Embedding service: embeds query
src/docscribe/rag_utils.py - OpenSearch retrieval → OpenSearch service: searches index
src/docscribe/rag_utils.py