Add it to Claude Code
claude mcp add document-generator -- npx --yes --cache /tmp/.npx-cache document-generator-mcp@latestMake your agent remember this setup
document-generator's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- Generate professional Word (.docx) and PDF documents
- Auto-detect JSON blocks with syntax highlighting
- Smart pagination to prevent content cuts
- Markdown support including headings, lists, and code blocks
- Responsive A4 formatting with professional margins
Tools 2
gerar_documento_wordCreates Word documents, PDF, or bothgerar_documento_pdfCreates PDF documents onlyTry it
Original README from thiagotw10/document-generator-mcp
Document Generator MCP
An MCP (Model Context Protocol) server to generate professional Word (.docx) and PDF documents from any AI agent that supports MCP, including Claude Desktop, Amazon Q Developer, Cline, Continue, and others.
🚀 Features
- ✅ Generate Word documents (.docx)
- ✅ Generate PDF documents
- ✅ Auto-detect JSON blocks (no backticks needed!) 🆕
- ✅ Professional syntax highlighting (VS Code Dark theme)
- ✅ Smart pagination (no content cuts between pages)
- ✅ 100% responsive formatting (respects A4 margins)
- ✅ Markdown support (headings, lists, bold, italic, code blocks)
- ✅ Automatic professional formatting
- ✅ Metadata (author, creation date)
📦 Installation
Via NPX (Recommended)
npx document-generator-mcp@latest
Via NPM Global
npm install -g document-generator-mcp
⚙️ Configuration
Claude Desktop
Locate the configuration file:
- Linux:
~/.config/claude-desktop/claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
Add this configuration:
{
"mcpServers": {
"document-generator": {
"command": "npx",
"args": ["--yes", "--cache", "/tmp/.npx-cache", "document-generator-mcp@latest"]
}
}
}
- Restart Claude Desktop
Amazon Q Developer
- Open VS Code with Amazon Q extension
- Access Amazon Q settings
- Add the MCP server:
{
"mcpServers": {
"document-generator": {
"command": "npx",
"args": ["--yes", "--cache", "/tmp/.npx-cache", "document-generator-mcp@latest"]
}
}
}
Other MCP Agents (Cline, Continue, etc.)
For other agents that support MCP, add the server configuration:
{
"name": "document-generator",
"command": "npx",
"args": ["--yes", "--cache", "/tmp/.npx-cache", "document-generator-mcp@latest"]
}
Check your agent's specific documentation for configuration details.
🎯 How to Use
After configuration, you can use natural commands in any MCP agent:
Example Prompts
- "Create a Word document about sales analysis"
- "Generate a PDF report about the project"
- "Make a technical manual in Word and PDF"
- "Create API documentation in Word format"
- "Document this JavaScript code with examples"
Available Tools
gerar_documento_word: Creates Word documents, PDF, or bothgerar_documento_pdf: Creates PDF documents only
📝 Supported Formatting
The MCP automatically processes:
Markdown
# Heading 1→ Heading 1 (20pt)## Heading 2→ Heading 2 (16pt, blue)### Heading 3→ Heading 3 (14pt)#### Heading 4→ Heading 4 (12pt)- Item→ Bulleted list1. Item→ Numbered list**text**→ Bold text*text*→ Italic text***text***→ Bold + Italic`code`→ Inline code> quote→ Blockquote---→ Horizontal line
Code Blocks
```javascript
async function example() {
const data = await fetch('api.com');
return data.json();
}
```
Auto-Detected JSON (New in v1.0.9!)
JSON objects and arrays are automatically detected and formatted as code blocks:
{
"status": "success",
"data": {
"users": [
{"id": 1, "name": "John"}
]
}
}
No need for ``` backticks! Just paste your JSON and it will be automatically formatted with syntax highlighting.
Syntax Highlighting Colors (VS Code Dark theme):
- 🟣 Keywords:
async,function,const,await, etc. (#C586C0) - 🟠 Strings:
"text",'text'(#CE9178) - 🟢 Comments:
// comment,/* block */(#6A9955) - 🟢 Numbers:
42,3.14,0xFF(#B5CEA8) - 🟡 Functions:
fetch,console.log(#DCDCAA) - 🔵 Types/Classes:
Promise,Array(#4EC9B0)
🎨 Features Highlights
Professional Syntax Highlighting
- Dark background (#1E1E1E) for code blocks
- VS Code Dark theme colors
- Language indicator header
- Automatic line wrapping
Smart Pagination
- Code blocks never split between pages
- Headings kept with following content
- Automatic page breaks when needed
- Consistent spacing
Responsive Formatting
- All content respects A4 margins
- Automatic line breaks for long text
- Proper width control for all elements
- No content overflow
🧪 Testing
To test if it's working:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | npx document-generator-mcp@latest
Expected output: List of available tools (gerar_documento_word, gerar_documento_pdf)
🔧 Troubleshooting
Error "use strict: not found"
If you get this error, npm is using an old cached version. Solutions:
- Use this optimized configuration:
{
"mcpServers": {
"document-generator": {
"command": "npx",
"args": ["--yes", "--cache", "/tmp/.npx-cache", "document-generator-mcp@latest"]
}
}
}
- Or clear the cache:
npm cache clean --force
rm -rf ~/.npm/_npx