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.
- β Generate Word documents (.docx)
- β Generate PDF documents
- β 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)
npx document-generator-mcp@latest
npm install -g document-generator-mcp
-
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
- 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"]
}
}
}
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.
After configuration, you can use natural commands in any MCP agent:
- "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"
gerar_documento_word
: Creates Word documents, PDF, or bothgerar_documento_pdf
: Creates PDF documents only
The MCP automatically processes:
# 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
```javascript
async function example() {
const data = await fetch('api.com');
return data.json();
}
```
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)
- Dark background (#1E1E1E) for code blocks
- VS Code Dark theme colors
- Language indicator header
- Automatic line wrapping
- Code blocks never split between pages
- Headings kept with following content
- Automatic page breaks when needed
- Consistent spacing
- All content respects A4 margins
- Automatic line breaks for long text
- Proper width control for all elements
- No content overflow
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
)
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
- Check if
generated_documents/
folder exists - Verify Node.js version (18+ required)
- Check MCP server logs in your agent
Documents are saved in ./generated_documents/
with unique timestamps.
Example: api_documentation_1759715959772.docx
This MCP works with any agent that implements the Model Context Protocol:
- β Claude Desktop - Full native support
- β Amazon Q Developer - Support via VS Code
- β Cline (VS Code) - VS Code extension
- β Continue - Code assistant with MCP
- β Other MCP agents - Any compatible implementation
Contributions are welcome! Open issues or pull requests on GitHub.
git clone https://github.com/thiagotw10/document-generator-mcp.git
cd document-generator-mcp
npm install
npm run build
MIT License - see LICENSE file for details.
- NPM Package: https://www.npmjs.com/package/document-generator-mcp
- GitHub Repository: https://github.com/thiagotw10/document-generator-mcp
- MCP Documentation: https://modelcontextprotocol.io
- Amazon Q MCP Guide: https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/qdev-mcp.html
- Node.js: 18+ required
- Platforms: Linux, macOS, Windows
- MCP Support: Any agent implementing Model Context Protocol
- β Professional syntax highlighting in PDF (VS Code Dark theme)
- β 100% responsive formatting (respects A4 margins)
- β Smart pagination (no content cuts)
- β Improved spacing after code blocks
- β Visual parity between Word and PDF
Made with β€οΈ by Thiago Oliveira
Transform natural language into professional documents with AI!