Kamy
面向开发者的 PDF 生成 API。使用精美的默认设置发布发票、收据、合同和报告。
安装
# SDK — in your app
npm i @kamydev/sdk
# CLI — globally for scripts, CI, previews
npm i -g @kamydev/cliimport Kamy from "@kamydev/sdk";
const kamy = new Kamy({ apiKey: process.env.KAMY_API_KEY! });
const pdf = await kamy.render({
template: "invoice",
data: { invoiceNumber: "INV-001", total: 1500, currency: "USD" },
});
console.log(pdf.url); // signed URL, valid 1 hour新增功能
日期 | 变更 | ||
2026年4月 |
| ||
2026年4月 | SDK 现在提供由 OpenAPI 生成的类型 —— | ||
2026年4月 | 渲染时通过 Ajv 进行模板级 JSON Schema 验证(已启用格式)。此前仅检查 | ||
2026年4月 |
| ||
2026年4月 | OpenAPI 3.0.3 规范现在涵盖所有 19 个 | ||
2026年4月 |
| ||
2026年4月 |
| ||
2026年4月 | `options.pdfA: "1b" | "2b" | "3b"` —— 通过嵌入式 sRGB ICC OutputIntent + XMP 实现尽力而为的 PDF/A 归档标记。 |
2026年4月 |
| ||
2026年4月 |
|
每个版本的详细信息请参阅 CHANGELOG.md。
架构
Kamy 是一个包含以下内容的 Turborepo 单体仓库:
包 | 描述 |
| Next.js 15 应用 —— 落地页、仪表板、REST API |
| Cloudflare Worker —— 用于 AI 编码代理的 MCP 服务器 |
| Nextra 文档站点 |
|
|
|
|
|
|
|
|
|
|
先决条件
Node.js 22+
pnpm 10+
Supabase CLI (
brew install supabase/tap/supabase)Wrangler CLI (
pnpm add -g wrangler) —— 用于 MCP 服务器
本地开发
# 1. Install dependencies
pnpm install
# 2. Copy env file and fill in values
cp .env.example apps/web/.env.local
# 3. Start local Supabase (requires Docker)
supabase start
# 4. Apply database migrations
supabase db reset
# 5. Generate TypeScript types from schema
supabase gen types typescript --local > packages/shared/src/types/database.ts
# 6. Start all apps in dev mode
pnpm devWeb 应用运行在 https://kamy.dev
命令
pnpm dev # Start all apps with Turbopack (hot reload)
pnpm build # Production build all apps
pnpm typecheck # TypeScript check across all packages
pnpm lint # Biome lint + format check
pnpm lint:fix # Biome auto-fix
pnpm test # Run all tests (Vitest unit + Playwright E2E)
pnpm test:unit # Vitest unit tests only
pnpm test:e2e # Playwright E2E tests only
pnpm clean # Remove all build artifacts数据库
迁移文件位于 supabase/migrations/。它们按时间戳顺序应用。
# Reset and reseed local DB
supabase db reset
# Create a new migration
supabase migration new <name>
# Push to remote Supabase project
supabase db push部署
Web 应用:合并到
main分支时部署到 VercelMCP 服务器:通过
wrangler deploy部署到 Cloudflare Workers数据库:托管在 Supabase Cloud 上
环境变量
请参阅 .env.example 获取所有必需变量及其描述。
技术栈
框架:Next.js 15 (App Router, React Server Components, Turbopack)
语言:TypeScript 5.7+ 严格模式
数据库:Supabase (Postgres 16 + Auth + Storage)
样式:Tailwind CSS v4 (Oxide 引擎)
支付:Stripe (Meters API)
PDF 引擎:Browserless.io v2
电子邮件:Resend + React Email
可观测性:Sentry + PostHog + Axiom
测试:Vitest + Playwright + MSW
开放插件
此仓库提供了一个 Open Plugins 分发包,以便 AI 编码代理(Cursor、Claude Code 以及任何其他兼容 Open-Plugins 的工具)可以将 Kamy 安装为单个插件,并获得现成的 PDF 流水线。
该插件在仓库根目录捆绑了四个组件:
路径 | 组件 | 用途 |
| 清单 | 名称、版本、元数据、声明的组件 |
| 技能 | 教导代理何时以及如何渲染 PDF |
| 规则 |
|
| 子代理 | 专门的模板设计代理(Handlebars + 打印 CSS) |
| MCP 服务器 | 托管在 |
要在受支持的代理中安装插件,请将其指向此仓库 (https://github.com/rakanalalami/kamy) 并按照主机的插件安装流程操作。代理将自动读取清单并加载组件。
有关完整模式,请参阅 Open Plugins 规范。
This server cannot be deployed
Related MCP Connectors
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
MCP server for Api2Pdf — generate PDFs & images from HTML, URLs or office files; merge, barcodes.
Turn a description into a shareable, editable PDF — invoices, certificates, reports, resumes.
Hosted MCP server for Anvil — fill & generate PDFs and run Etch e-signature packets for AI agents.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables creative PDF generation with full design control including colors, shapes, emoji, and Unicode support. Supports everything from simple documents to artistic masterpieces using PDFKit's powerful API.51,421 npm2MIT