Skip to main content
Glama

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)

Related MCP server: Spire.Doc MCP Server

πŸ“¦ Installation

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.

⚠️ 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!

Available Tools

2 tools
gerar_documento_pdfC

Cria um arquivo PDF

ParametersJSON Schema
NameRequiredDescriptionDefault
nome_arquivoYesNome do arquivo sem extensΓ£o
titulo_documentoYesTΓ­tulo do documento
conteudo_principalYesConteΓΊdo principal
autorNoAutor do documento

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Cria' implies a write operation, but it doesn't cover permissions, file storage location, overwrite behavior, error conditions, or output format details. This is a significant gap for a tool that creates files.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, though its brevity contributes to gaps in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a PDF generation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., file path, binary data, success status) or behavioral aspects like error handling, making it inadequate for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning about parameters beyond what's in the schema, such as format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Cria um arquivo PDF' states the basic action (creates a PDF file) but is vague about what kind of document it creates or how it differs from its sibling 'gerar_documento_word'. It doesn't specify if it's a simple text document, formatted report, or something else, making it minimally adequate but with clear gaps in specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus its sibling 'gerar_documento_word'. The description doesn't mention alternatives, prerequisites, or specific contexts for PDF creation, leaving the agent without direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

gerar_documento_wordC

Cria um arquivo Microsoft Word (.docx)

ParametersJSON Schema
NameRequiredDescriptionDefault
nome_arquivoYesNome do arquivo sem extensΓ£o
titulo_documentoYesTΓ­tulo do documento
conteudo_principalYesConteΓΊdo principal
autorNoAutor do documento
formatoNoFormato do documento (word, pdf ou ambos)
templateNoTemplate do documento: professional (linha azul, formal e elegante), minimalist (margens grandes, design clean), corporate (tΓ­tulo em caixa alta, empresarial), default (padrΓ£o simples)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it creates a Word file but doesn't mention where the file is saved, permissions required, whether it overwrites existing files, or any rate limits. This leaves significant gaps for a file creation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that creates files with 6 parameters and no annotations or output schema, the description is insufficient. It doesn't explain the output (e.g., file location, success indicators) or provide behavioral context needed for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, so all parameters are documented in the schema. The description adds no additional parameter information beyond what's in the schema, resulting in the baseline score of 3 for adequate but no extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Cria' (creates) and the resource 'arquivo Microsoft Word (.docx)', making the purpose evident. However, it doesn't explicitly differentiate from its sibling 'gerar_documento_pdf', which likely creates PDF files instead of Word documents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention the sibling tool 'gerar_documento_pdf' or explain scenarios where one format might be preferred over the other, leaving usage context unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv1.0.9
    • First observedgerar_documento_pdf
    • First observedgerar_documento_word

TDQS

B3/5.0
Disambiguation5/5

The two tools have perfectly distinct purposes: one creates PDF files and the other creates Word documents. There is no overlap in functionality or ambiguity about which tool to use for each file type.

Naming Consistency5/5

Both tools follow an identical naming pattern: 'gerar_documento_' followed by the file format. This consistent verb_noun structure in Portuguese makes the tool names predictable and easy to understand.

Tool Count2/5

With only two tools, the server feels thin for a 'Document Generator' domain. While it covers two common formats, there are obvious gaps for other document types (e.g., HTML, plain text) and operations like editing or converting existing documents.

Completeness2/5

The tool surface is severely incomplete for document generation. It lacks support for multiple document formats beyond PDF and Word, and provides no operations for document manipulation, conversion, or template management that would be expected in this domain.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thiagotw10/document-generator-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server