内容
# 空白发票生成器 — MCP 服务器
一款 [MCP](https://modelcontextprotocol.io) 服务器,允许任何 AI 助手(Claude 和其他 MCP 客户端)使用 **[空白发票生成器](https://blankinvoicemaker.com)** — 免费、无需注册、无水印的发票生成器。
要求你的助手生成发票,它会返回一个链接,打开 **[blankinvoicemaker.com](https://blankinvoicemaker.com)**,发票已预先填写好,准备好审查和下载为 PDF。
> **隐私设计.** 发票数据在链接的 URL 片段 (`#invoice=…`) 中传输,并在浏览器中完全解码。没有任何数据被上传 — 这与空白发票生成器的无账户、无服务器存储模型一致。
## 工具
| 工具 | 功能 |
| --- | --- |
| `list_templates` | 列出 [blankinvoicemaker.com/templates](https://blankinvoicemaker.com/templates) 上可用的行业发票模板(slug、名称、描述、URL)。 |
| `create_invoice` | 根据您的详细信息生成发票,并返回一个预先填写好的 [blankinvoicemaker.com](https://blankinvoicemaker.com) 链接,供审查和下载。 |
### `create_invoice` 示例
> *"为 Globex LLC 生成发票,10 小时设计,90 美元/小时,1 个 120 美元主机设置,14 天付款期,英镑。*
助手调用 `create_invoice` 时:
```json
{
"business": { "name": "Acme Studio", "email": "hi@acme.studio" },
"client": { "name": "Globex LLC", "email": "ap@globex.com" },
"items": [
{ "description": "设计工作", "quantity": 10, "unitPrice": 90, "unit": "小时" },
{ "description": "主机设置", "quantity": 1, "unitPrice": 120 }
],
"currency": "GBP",
"paymentTerms": "Net 14"
}
```
… 并返回一个 `https://blankinvoicemaker.com/#invoice=…` 链接,打开编辑器预先填写。
## 安装
需要 Node.js 18+。
### Claude 桌面版
添加到你的 `claude_desktop_config.json`:
```json
{
"mcpServers": {
"blank-invoice-maker": {
"command": "npx",
"args": ["-y", "blank-invoice-maker-mcp"]
}
}
}
```
### 其他 MCP 客户端
通过 stdio 运行服务器:
```bash
npx -y blank-invoice-maker-mcp
```
## 工作原理
`create_invoice` 将您的输入映射到 [blankinvoicemaker.com](https://blankinvoicemaker.com) 使用的发票结构,使用 [`lz-string`](https://github.com/pieroxy/lz-string) 进行压缩,并将其附加到站点 URL 作为 `#invoice=` 片段。打开链接会在浏览器中激活编辑器 — 无需注册,无水印,无数据离开您的机器。
## 开发
```bash
npm install
npm run build # 编译 TypeScript 到 dist/
npm test # 构建 + 运行单元测试
npm start # 通过 stdio 运行服务器
```
### 保持模板同步
`src/templates-data.ts` 从空白发票生成器模板注册表生成:
```bash
BIM_APP_DIR=/path/to/blank-invoice-maker npm run generate:templates
```
## 链接
- **应用:** https://blankinvoicemaker.com
- **模板:** https://blankinvoicemaker.com/templates
- **模型上下文协议:** https://modelcontextprotocol.io
## 许可证
[MIT](./LICENSE) © [空白发票生成器](https://blankinvoicemaker.com)