Skip to main content
Glama

@rendoc/mcp-server

npm version License: MIT CI

rendoc MCP server 让 Claude Desktop、Cursor 以及任何其他兼容 MCP 的客户端能够按需生成专业的 PDF 文档。将你的 AI 连接到 rendoc,它就可以通过自然语言提示词,利用可复用的模板或内联 HTML/Handlebars 标记,创建发票、合同、报告、证书以及任何其他 PDF 文档。

只需几秒钟,即可将“为 Acme Corp 生成一份发票,包含 40 小时咨询服务,每小时 85 欧元”转化为 PDF 文档。

使用场景

使用场景

示例提示词

发票

“为客户 X 生成一份发票,包含以下明细……”

合同

“为 TechStart SL 起草一份自由职业合同,费用 18,000 欧元,预付 50%……”

证书

“为 María González 颁发一份课程结业证书……”

报告

“根据这些 KPI 创建一份 2026 年 3 月的销售报告……”

批量生成

“为 CSV 中的所有 50 名参会者生成证书”

自定义文档

任何你可以用 HTML + 数据描述的内容

查看 examples/ 中的详细操作指南。

Related MCP server: PDF Export for AI Agents

功能特性

  • 7 个工具:用于文档生成、模板管理和使用情况跟踪

  • 基于模板或内联:保存可复用的模板或即时传递标记

  • Handlebars 语法:在标记中使用 {{variables}}、{{#each}}、{{#if}}

  • 多种纸张尺寸:A4、Letter、Legal、A3、A5,支持纵向或横向

  • 模式验证:模板可以声明 JSON Schema,防止 AI 传递无效数据

  • 零配置:只需设置 RENDOC_API_KEY 即可使用

  • 轻量级:解压后约 35 KB,纯 TypeScript,仅 2 个运行时依赖

  • 经 Glama 验证:已通过安全性、质量和许可证检查

Claude Desktop 快速设置

将其添加到你的 Claude Desktop 配置文件 (claude_desktop_config.json) 中:

{
  "mcpServers": {
    "rendoc": {
      "command": "npx",
      "args": ["-y", "@rendoc/mcp-server"],
      "env": {
        "RENDOC_API_KEY": "your-api-key"
      }
    }
  }
}

重启 Claude Desktop。rendoc 工具将出现在 MCP 工具菜单中。

Claude Code 快速设置

将其添加到你的项目或全局设置 (.claude/settings.json) 中:

{
  "mcpServers": {
    "rendoc": {
      "command": "npx",
      "args": ["-y", "@rendoc/mcp-server"],
      "env": {
        "RENDOC_API_KEY": "your-api-key"
      }
    }
  }
}

Cursor 快速设置

添加到 ~/.cursor/mcp.json(或你项目的 .cursor/mcp.json):

{
  "mcpServers": {
    "rendoc": {
      "command": "npx",
      "args": ["-y", "@rendoc/mcp-server"],
      "env": {
        "RENDOC_API_KEY": "your-api-key"
      }
    }
  }
}

可用工具

工具

描述

关键参数

generate_document

从模板或内联标记生成 PDF

template_id 或 markup, data, paper_size?, orientation?, filename?

list_templates

列出可用的文档模板

category?

preview_template

查看模板的标记、样式和模式

template_id

create_template

创建新的可复用模板

name, slug, markup, schema, category?, styles?, sample_data?, paper_size?, orientation?, is_public?

delete_template

按 ID 删除模板

template_id

get_document

获取已生成文档的详细信息

document_id

get_usage

查看每月 API 使用统计

(无)

每个工具都会返回结构化的 JSON,包含下载链接、文档 ID 以及 AI 可以处理的元数据。

获取 API 密钥

  1. 在 rendoc.dev 注册

  2. 前往 API 密钥仪表板

  3. 创建一个新密钥并将其复制到你的 MCP 客户端配置中

环境变量

变量

必需

默认值

描述

RENDOC_API_KEY

是

—

用于身份验证的 rendoc API 密钥

RENDOC_API_URL

否

https://rendoc.dev

rendoc API 的基础 URL(适用于自托管实例)

示例

包含真实提示词和工具调用的详细操作指南:

工作原理

┌──────────────┐   MCP/stdio    ┌────────────────────┐   HTTPS   ┌─────────────┐
│ Claude Code  │ ─────────────▶ │ @rendoc/mcp-server │ ────────▶ │ rendoc API  │
│ / Desktop    │                │   (this package)    │           │  (PDF gen)  │
└──────────────┘ ◀───────────── └────────────────────┘ ◀──────── └─────────────┘
        ▲         tool results                        download URL
        │
        └── User prompt: "Generate an invoice for..."

MCP 服务器将来自 AI 助手的自然语言工具调用转换为经过身份验证的 rendoc API REST 请求,并返回包含 PDF 下载链接的结构化响应。

贡献

欢迎贡献代码。请参阅 CONTRIBUTING.md 了解开发设置和 PR 指南。

对于安全问题,请参阅 SECURITY.md 并发送电子邮件至 info@rendoc.dev — 请勿公开提交 Issue。

链接

许可证

MIT — 详见 LICENSE。

Available Tools

7 tools
create_templateA

Create a new reusable document template. Templates use HTML/Handlebars markup with a JSON schema defining the expected data fields. Once created, use the returned template ID with generate_document to produce PDFs.

Inputs: name (required), slug (required), markup (required), schema (required), +7 more.

delete_templateA

Delete a template by its ID. This action is irreversible. Only templates you own can be deleted.

Inputs: template_id (required).

generate_documentA

Generate a PDF document from a template and data. Returns a download URL for the generated PDF. Provide either template_id (to use a saved template) or markup (inline HTML/Handlebars template). The data object is injected into the template to produce the final document. Supports custom paper sizes, orientation, and filenames.

Inputs: data (required), template_id, markup, paper_size, +2 more.

get_documentA

Get details about a previously generated document by its ID. Returns the document status, download URL, file size, page count, and creation date.

Inputs: document_id (required).

get_usageA

Get current API usage statistics for this billing month. Returns your plan name, document count vs limit, page count, and remaining quota.

Inputs: no named parameters.

list_templatesA

List available document templates. Optionally filter by category. Returns template names, slugs, categories, descriptions, paper sizes, and IDs. Use the returned ID with generate_document or preview_template.

Inputs: category.

preview_templateA

Get the full markup, styles, and data schema of a template. Use this to inspect a template before generating a document. The schema shows which data fields the template expects. Sample data (if available) shows example values for each field.

Inputs: template_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: create_template, delete_template, list_templates, and preview_template handle template management; generate_document and get_document handle document generation and retrieval; get_usage provides API usage stats. The descriptions reinforce these boundaries, making tool selection unambiguous.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case naming (e.g., create_template, generate_document, get_usage). The verbs are clear and appropriate for their actions, and there are no deviations or mixed conventions throughout the set.

    Tool Count5/5

    With 7 tools, the server is well-scoped for document generation and template management. Each tool earns its place by covering essential operations like CRUD for templates, document generation, retrieval, and usage monitoring, without being too sparse or bloated.

    Completeness5/5

    The tool set provides complete coverage for the document generation domain: full CRUD for templates (create, delete, list, preview), document generation and retrieval, and usage monitoring. There are no obvious gaps, and the tools support core workflows from template creation to PDF output without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers