Skip to main content
Glama
TemplateFoxPDF

TemplateFox MCP Server

Official

TemplateFox MCP Server

MCP(Model Context Protocol)服务器,用于 TemplateFox PDF 生成 API。你可以通过 Claude、Cursor 和 Windsurf 等 AI 助手直接从模板生成 PDF。

安装

Claude Desktop

在 macOS 上,将以下内容添加到 Claude Desktop 的配置(~/Library/Application Support/Claude/claude_desktop_config.json)中:

{
  "mcpServers": {
    "templatefox": {
      "command": "npx",
      "args": ["-y", "@templatefox/mcp-server"],
      "env": {
        "TEMPLATEFOX_API_KEY": "sk_your_api_key_here"
      }
    }
  }
}

Claude Code

claude mcp add templatefox -- npx -y @templatefox/mcp-server

然后,在你的 shell 中设置环境变量 TEMPLATEFOX_API_KEY。

Cursor / Windsurf

在 MCP 服务器配置中使用相同的 npx -y @templatefox/mcp-server 命令,并将 TEMPLATEFOX_API_KEY 加入环境中。

全局安装(备选)

npm install -g @templatefox/mcp-server

然后使用 templatefox-mcp-server 作为命令,而不是 npx。

Related MCP server: mcp-server-pdfnoodle

配置

环境变量

必填

说明

TEMPLATEFOX_API_KEY

是

你的 API 密钥(以 sk_ 开头)。可在 app.templatefox.com/dashboard/api-keys 获取

TEMPLATEFOX_BASE_URL

否

覆盖 API 基础 URL(默认:https://api.templatefox.com)

可用工具

工具

说明

generate_pdf

使用模板和动态数据生成 PDF(1 积分)

generate_pdf_async

提交异步 PDF 生成任务,并可设置 webhook(1 积分)

get_pdf_job_status

检查异步 PDF 任务的状态

list_pdf_jobs

列出异步 PDF 生成任务

list_templates

列出所有可用模板

get_template_fields

获取模板的字段/变量

get_account_info

查看剩余积分和账户信息

list_transactions

查看积分交易记录

远程服务器(HTTP)

该 MCP 服务器还支持通过 Streamable HTTP 进行 HTTP 传输,适用于远程和云部署。

通过 URL 连接

https://mcp-server-599407781746.us-central1.run.app/mcp

MCP 客户端必须通过 HTTP 请求头传递 API 密钥:

Authorization: Bearer sk_your_api_key_here

或:

x-api-key: sk_your_api_key_here

自托管

通过设置 PORT 环境变量,以 HTTP 模式运行服务器:

PORT=8080 TEMPLATEFOX_API_KEY=sk_your_key node dist/index.js

或者使用 Docker:

docker build -t templatefox-mcp .
docker run -p 8080:8080 templatefox-mcp

MCP 端点为 http://localhost:8080/mcp,健康检查端点为 http://localhost:8080/health。

使用示例

配置完成后,你可以让 AI 助手执行:

“列出我的 PDF 模板,并使用“Invoice Template”模板生成一张发票,客户姓名为“John Doe”,金额为 150.00。”

该助手将:

  1. 调用 list_templates 查找可用的模板

  2. 调用 get_template_fields 获取必填字段

  3. 使用模板 ID 和数据调用 generate_pdf

  4. 返回 PDF 下载 URL

链接

许可证

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Connects AI assistants to DocuJSON for PDF generation, template management, and API operations via natural language. It enables tasks like creating invoices, managing templates, and viewing usage stats through MCP-compatible tools.
    3 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to generate PDF documents from templates or raw HTML using natural language, with tools for template creation, PDF generation, and utility operations.
    24 npm
    1
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    Enables AI assistants to perform PDF operations like merge, split, compress, convert, encrypt, OCR, and summarize using natural language.
    98
    8 npm
    MIT