docmcp

docmcp

An MCP server that generates real .docx and .xlsx files from structured data, with support for headings, tables, RTL, and frozen panes. It offers local (stdio) and hosted HTTP modes with API key quotas.

Category
访问服务器

README

docmcp

Live: https://docmcp.fly.dev — free key at POST /keys/free, 10 docs/month. Paid: $10/mo for 100, $30/mo for 500. Quotas live in PLANS in src/store.ts.

A paid MCP server that turns structured data into real .docx and .xlsx files. Agents are good at prose and bad at file formats — they emit Markdown and hope. This gives them a tool that returns a Word or Excel file with actual headings, tables, bold headers, frozen panes and RTL support.

Returns a short-lived download URL rather than a base64 blob: a 200KB docx inlined into a tool result costs the caller ~70k tokens.

Two modes, one codebase:

  • --stdio — local client (Claude Desktop / Code). No auth, no quota, no expiry; files are written to OUT_DIR and the tool returns the path.
  • default — hosted HTTP at /mcp. API key required, quota metered, files served as URLs that expire after 24h. This is the product.

Local

npm install

Already registered in Claude Desktop as docmcp (output → ~/Documents/docmcp). To register elsewhere:

{
  "mcpServers": {
    "docmcp": {
      "command": "/usr/local/bin/node",
      "args": ["<repo>/node_modules/tsx/dist/cli.mjs", "<repo>/src/index.ts", "--stdio"],
      "env": { "DATABASE_URL": "postgres://…", "OUT_DIR": "<somewhere>" }
    }
  }
}

Absolute paths matter — the client launches with a minimal PATH.

Hosted

npm start          # http://localhost:8787/mcp
curl -X POST localhost:8787/keys/free
{
  "mcpServers": {
    "docmcp": {
      "type": "http",
      "url": "https://your-host/mcp",
      "headers": { "Authorization": "Bearer dk_..." }
    }
  }
}

Tools

Tool Does
create_docx headings, paragraphs, bullet/numbered lists, tables, page breaks, rtl for Hebrew/Arabic
create_xlsx multi-sheet, bold + frozen header, auto-filter, sized columns, numbers stay numbers
usage calls used / quota this month

Env

Var Default Notes
PORT 8787
BASE_URL http://localhost:$PORT Must be the public URL — it goes in download links
DATABASE_URL — Required. Any Postgres (Koyeb, Neon, Supabase)
OUT_DIR out Generated files, swept hourly, 24h TTL
STRIPE_SECRET_KEY — Omit to run without billing
STRIPE_WEBHOOK_SECRET — For /stripe/webhook
STRIPE_PRICE_STARTER, STRIPE_PRICE_PRO — Price IDs behind /buy/:plan

Plans and quotas live in PLANS in src/store.ts.

Deploy

Any Docker host with a Postgres URL. There is no persistent disk requirement: generated files live on the container filesystem and expire in 24h anyway, so a restart only breaks links that were about to die. Everything that must survive — keys, quotas, the IP salt — is in Postgres.

Currently Render (web service, free tier) + Neon (Postgres, free, no expiry). Deliberately two providers: state lives somewhere that isn't tied to whoever is hosting the container this month. Render builds the Dockerfile straight from GitHub.

BASE_URL must be the public URL — it is baked into every download link handed to a client, so getting it wrong produces links to a host that does not exist. You only learn the URL after the first deploy, so set it then and redeploy.

Render's free tier sleeps after 15 minutes idle and takes 30–50s to wake. That is the cost of not having a card on file; fix it by upgrading once a customer pays.

Billing flow

/buy/starter → Stripe Checkout → webhook checkout.session.completed → key issued → customer lands on /success and sees the key there. No email provider needed. customer.subscription.deleted deactivates it. There are no user accounts: the key is the account.

Test

npm test

Covers both generators (including a ragged table row and a / in a sheet name — both things an LLM will send eventually), number preservation through an xlsx round-trip, and that quota stops exactly at the plan limit.

Known gaps

  • No PDF. Good PDF output needs headless Chrome or LibreOffice, which triples the deploy. Word and Excel are the actual gap — everyone already ships Markdown→PDF. Add it when a paying user asks.
  • A lost key cannot be recovered. It is shown once on /success. Add email delivery or a "resend by email" route when the first customer asks.
  • Files are on the container filesystem. Deliberate — see Deploy. Move to object storage only if 24h links breaking on restart ever actually bothers someone.
  • Free keys are rate limited, not abuse-proof. One per IP per 24h plus a global daily ceiling (FREE_KEYS_PER_DAY, default 200). Rotating VPNs still defeats it — nothing stops that, and no free tier anywhere survives a determined attacker. The limits exist to bound the worst case, not to eliminate it.
  • /admin needs ADMIN_TOKEN. Unset, the route 404s, so an unconfigured deploy never exposes it. Visit /admin?token=….

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选