Document Generator MCP

Document Generator MCP

Enables AI agents to generate professional Word and PDF documents with support for Markdown, syntax highlighting, and smart pagination. It features automatic JSON detection and responsive A4 formatting for creating high-quality technical reports and manuals.

Category
Visit Server

README

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

  1. 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
  2. Add this configuration:

{
  "mcpServers": {
    "document-generator": {
      "command": "npx",
      "args": ["--yes", "--cache", "/tmp/.npx-cache", "document-generator-mcp@latest"]
    }
  }
}
  1. Restart Claude Desktop

Amazon Q Developer

  1. Open VS Code with Amazon Q extension
  2. Access Amazon Q settings
  3. 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 both
  • gerar_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 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)

๐Ÿ”ง Troubleshooting

Error "use strict: not found"

If you get this error, npm is using an old cached version. Solutions:

  1. Use this optimized configuration:
{
  "mcpServers": {
    "document-generator": {
      "command": "npx",
      "args": ["--yes", "--cache", "/tmp/.npx-cache", "document-generator-mcp@latest"]
    }
  }
}
  1. Or clear the cache:
npm cache clean --force
rm -rf ~/.npm/_npx

Documents not generating

  • Check if generated_documents/ folder exists
  • Verify Node.js version (18+ required)
  • Check MCP server logs in your agent

๐Ÿ“ 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

  • 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

โš ๏ธ Requirements

  • Node.js: 18+ required
  • Platforms: Linux, macOS, Windows
  • MCP Support: Any agent implementing Model Context Protocol

๐Ÿ“Š 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!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured