Labsco
thiagotw10 logo

document-generator-mcp

β˜… 7

from thiagotw10

generate pdf and word

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

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)

πŸ“ 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 list
  • 1. 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)

πŸ“ Generated Files

Documents are saved in ./generated_documents/ with unique timestamps.

Example: api_documentation_1759715959772.docx

πŸ€– Compatible Agents

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

🀝 Contributing

Contributions are welcome! Open issues or pull requests on GitHub.

Development Setup

git clone https://github.com/thiagotw10/document-generator-mcp.git
cd document-generator-mcp
npm install
npm run build

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ”— Links

πŸ“Š Changelog

v1.0.9 (Latest)

  • βœ… Auto-detect JSON blocks - No need for ``` backticks around JSON
  • βœ… Automatically formats JSON objects and arrays as code blocks
  • βœ… Validates JSON syntax before formatting
  • βœ… Applies syntax highlighting to detected JSON
  • βœ… Works in both Word and PDF documents

v1.0.8

  • βœ… English documentation for international audience
  • βœ… Improved README structure

v1.0.7

  • βœ… 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!