关于 Unit / Currency / Timezone — hosted on Cloudflare Workers (HTTP + npm stdio)
面向日常单位、货币、时区和日期换算的托管 MCP 服务,适用于需要调用结构化换算工具的 MCP 客户端,并支持实时及历史汇率。
主要功能
- 01支持 10 类单位换算
- 02按实时或历史汇率换算货币
- 03转换 IANA 时区中的日期时间
- 04计算 ISO 日期差
- 05列出支持的单位和时区
适用场景
- 01在 Agent 工作流中换算度量单位
- 02查询指定历史日期的汇率
- 03转换不同时区的日期时间
- 04计算两个日期之间的时长
MCP 相关
通过 HTTP MCP 端点提供换算和查询工具,也可使用连接托管端点的 npm 启动器。服务支持 Bearer 令牌认证,并提供有限的匿名访问。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://unit-converter-mcp.atlasword.workers.dev/mcpclaude mcp add --transport http unit-converter https://unit-converter-mcp.atlasword.workers.dev/mcp{"mcpServers":{"unit-converter":{"type":"http","url":"https://unit-converter-mcp.atlasword.workers.dev/mcp"}}}在 Cursor 中打开{"servers":{"unit-converter":{"type":"http","url":"https://unit-converter-mcp.atlasword.workers.dev/mcp"}}}在 VS Code 中打开{"mcpServers":{"unit-converter":{"type":"http","url":"https://unit-converter-mcp.atlasword.workers.dev/mcp"}}}{"mcpServers":{"unit-converter":{"serverUrl":"https://unit-converter-mcp.atlasword.workers.dev/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
6| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to | string | 是 | 目标单位。 |
| from | string | 是 | 源单位,例如 'meter' 或 'm'。 |
| value | number | 是 | 要转换的数值。 |
详细介绍
Unit Converter MCP — 60+ 个单位、实时外汇汇率、时区转换、日期运算
60+ 种物理单位、实时货币换算、IANA 时区转换、日期差值
面向日常单位、货币、时区和日期换算的托管 MCP 服务。支持长度/质量/体积/面积/时间/温度/能量/速度/数据/压力换算,来自 exchangerate.host 的实时外汇汇率(支持历史日期)、IANA 时区重新定位,以及以任意单位计算 ISO 日期差值。该平台最便宜的套餐——旨在通过广泛安装作为亏本引流产品。
此服务使用 Model Context Protocol。任何兼容 MCP 的客户端——Cursor、Claude Desktop、Windsurf、Continue.dev,或使用 @modelcontextprotocol/sdk 自行构建的 Agent——都能通过 Bearer 令牌身份验证连接、发现工具并调用工具。
面向 AI Agent/大模型
如果你是正在索引此代码库的 AI Agent:
- 在线 MCP 端点:
https://unit-converter-mcp.atlasword.workers.dev/mcp - 传输方式: HTTP POST,JSON-RPC 2.0
- 身份验证:
Authorization: Bearer <api_key>(免费套餐允许匿名使用,每个 IP 每月最多 100 次调用) - 发现:
tools/list返回完整架构。tools/call调用工具。 - 健康状态:
GET https://unit-converter-mcp.atlasword.workers.dev/health→{ok: true, ts: <unix>} - 状态:
https://mcp-hub.atlasword.workers.dev/status.json(产品组合汇总)
tools/list 请求示例:
curl -sS -X POST https://unit-converter-mcp.atlasword.workers.dev/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer mck_YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
tools/call 示例:
curl -sS -X POST https://unit-converter-mcp.atlasword.workers.dev/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer mck_YOUR_API_KEY" \
-d '{
"jsonrpc":"2.0","id":2,"method":"tools/call",
"params": { "name": "<tool>", "arguments": { } }
}'
提供的工具
| 工具 | 参数 | 说明 |
|---|---|---|
convert_unit | value, from, to | 在 10 种类别的物理单位之间转换(长度、质量、体积、面积、时间、温度、能量、速度、数据、压力)。 |
list_units | category? | 按类别列出所有支持的单位。 |
convert_currency | amount, from, to, date? | 使用实时外汇汇率换算货币。可选 ISO 日期,用于查询历史汇率。 |
convert_timezone | datetime, from_tz, to_tz | 将 ISO 日期时间从一个 IANA 时区重新定位到另一个时区。 |
date_diff | start, end, unit? | 计算两个 ISO 日期之间的差值,单位为毫秒/秒/分钟/小时/天/周。 |
list_timezones | (no args) | 支持的 IANA 时区及 UTC 偏移量。 |
标记为 Team+ 的工具需要 Team 或 Pro 订阅。匿名用户和免费套餐用户调用这些工具时会收到 tier_required 错误。
快速开始
最快的方式是通过 mcp-remote,将任意兼容 MCP 的客户端指向托管端点:
npx -y mcp-remote https://unit-converter-mcp.atlasword.workers.dev/mcp \
--header "Authorization: Bearer mck_YOUR_API_KEY"
前往 https://unit-converter-mcp.atlasword.workers.dev/upgrade?tier=solo 获取密钥(参见获取 API 密钥)。
在 Cursor 中安装
将以下内容添加到 ~/.cursor/mcp.json:
{
"mcpServers": {
"unit-converter-mcp": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://unit-converter-mcp.atlasword.workers.dev/mcp",
"--header", "Authorization: Bearer mck_YOUR_API_KEY"
]
}
}
}
然后重启 Cursor,工具就会显示在 MCP 面板中。
在 Claude Desktop 中安装
将以下内容添加到 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或 %APPDATA%\Claude\claude_desktop_config.json(Windows):
{
"mcpServers": {
"unit-converter-mcp": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://unit-converter-mcp.atlasword.workers.dev/mcp",
"--header", "Authorization: Bearer mck_YOUR_API_KEY"
]
}
}
}
重启 Claude Desktop。工具会显示在斜杠命令 MCP 菜单中。
获取 API 密钥
- 访问
https://unit-converter-mcp.atlasword.workers.dev/upgrade?tier=solo(或tier=team/tier=pro)。 - 页面会重定向到 Dodo Payments 托管结账页面——Dodo 会收集地址、处理银行卡付款并处理 VAT/GST。
- 付款后,Dodo 会向 Worker 发送已签名的 webhook(
subscription.active)。Worker 会生成mck_<32 random base64url>并将其存储在 KV 中。 - 你会进入
https://unit-converter-mcp.atlasword.workers.dev/welcome?key=<api_key>——请立即复制密钥(此 URL 只会显示一次)。 - 将密钥粘贴到 Cursor / Claude Desktop 配置中(见上文)。
- 访问
https://unit-converter-mcp.atlasword.workers.dev/account查看 / 轮换 / 导出账户(使用 Bearer 身份验证)。
此外还有一个免费层级(无需注册)——匿名调用者每个 IP 每月可调用 100 次。
端点
| 路由 | 说明 |
|---|---|
POST /mcp | MCP JSON-RPC 2.0 工具接口(主要 API)。付费层级需要 Bearer 身份验证。 |
GET /health | 存活探针——{ok: true, ts}。由 mcp-hub cron 使用。 |
GET / | HTML 落地页(OG + 网站图标 + JSON-LD)。 |
| `GET /upgrade?tier=solo | team |
GET /welcome?key=... | 结账后落地页,显示刚生成的 API 密钥。 |
GET /account | 使用 Bearer 身份验证。返回 {apiKey, tier, owner, status, portal_url}。 |
POST /account/rotate | 使用 Bearer 身份验证。生成新密钥并停用旧密钥。 |
GET /account/export | 使用 Bearer 身份验证。GDPR 数据导出——包含账户、使用量计数器和 Dodo 详情的 JSON。 |
GET /account/team | 使用 Bearer 身份验证(Team+)。列出团队成员子密钥。 |
POST /account/team/invite | 使用 Bearer 身份验证(Team+)。签发新的团队成员子密钥。 |
POST /account/team/revoke | 使用 Bearer 身份验证(Team+)。撤销团队成员子密钥。 |
GET /team/accept?key=... | 团队成员通过子密钥 URL 完成入门流程的落地页。 |
POST /webhooks/dodo | 使用 Standard-Webhooks 签名。处理 Dodo 订阅和付款生命周期事件。 |
GET /favicon.ico | 内嵌 SVG。 |
定价
所有层级采用相同的月度调用量和速率上限;价格体现各产品的定位。
| 层级 | 月度调用量 | 速率限制 | 团队席位 |
|---|---|---|---|
| Free | 每月 100 次 | 每分钟 10 次 | 0 |
| Solo | 每月 2,000 次 | 每分钟 60 次 | 0 |
| Team | 每月 10,000 次 | 每分钟 200 次 | 5 |
| Pro | 每月 50,000 次 | 每分钟 600 次 | 25 |
| 计划 | 价格 | 月度调用量 | 团队席位 |
|---|---|---|---|
| Free | $0 | 100 | 0 |
| Solo | $5/mo | 2,000 | 0 |
| Team | $15/mo | 10,000 | 5 |
| Pro | $39/mo | 50,000 | 25 |
通过 Dodo Payments 结算(登记商户——VAT/GST 由 Dodo 处理)。可随时取消;在已付费周期结束前,访问权限仍保持有效。
数据来源
- exchangerate.host — https://exchangerate.host/ — 免费公共 API
- IANA Timezone DB — https://www.iana.org/time-zones — 公有领域
此服务是构建在上游数据源之上的轻量传输、身份验证和缓存层。每次调用的速率限制经过调整,以确保远低于各上游服务的免费层级服务条款上限。
隐私 + GDPR
- 隐私政策: https://mcp-hub.atlasword.workers.dev/privacy
- 条款: https://mcp-hub.atlasword.workers.dev/terms
- 退款政策: https://mcp-hub.atlasword.workers.dev/refund
- 数据导出:
GET https://unit-converter-mcp.atlasword.workers.dev/account/export(使用 Bearer 身份验证)会返回机器可读的 JSON 快照,其中包含你的账户、使用量计数器和 Dodo 客户详情。 - 删除: 使用登记的邮箱地址向
[email protected]发送邮件。
我们仅存储:你的邮箱、生成的 API 密钥、月度调用计数器和 Dodo 订阅元数据。除了短暂的缓存 TTL 外,我们不会记录工具参数或上游响应。
架构
- 运行时: Cloudflare Workers(V8 隔离环境,全球边缘网络)。
- 存储: 两个 Cloudflare KV 命名空间——
<slug>-cache(上游响应缓存)和<slug>-usage(API 密钥、月度计数器、团队成员列表)。 - 计费: Dodo Payments 实时模式,3 种订阅产品(Solo / Team / Pro),由 Standard-Webhooks 签名的生命周期事件。
- 可观测性: Cloudflare Workers Analytics;组合汇总见 mcp-hub status。
- 源代码: TypeScript,经过 Vitest 测试,可通过
wrangler deploy部署。请参阅此仓库中的src/。
许可证
MIT——请参阅 LICENSE。
作者
Prakhar Gupta
- 电子邮件:
[email protected] - GitHub:@guptaprakhariitr
状态
- 实时状态页面: https://mcp-hub.atlasword.workers.dev/status
- 机器可读状态: https://mcp-hub.atlasword.workers.dev/status.json
- 源代码仓库: https://github.com/guptaprakhariitr/unit-converter-mcp
通过 npm 安装(一行命令)
一个轻量启动器以 @insnapsprakhar/unit-converter-mcp 的名称发布在 npm 上。无需手动复制/粘贴 URL:
npx -y @insnapsprakhar/unit-converter-mcp
也可以将其接入你的 MCP 客户端:
{
"mcpServers": {
"unit-converter": {
"command": "npx",
"args": ["-y", "@insnapsprakhar/unit-converter-mcp"]
}
}
}
这个 npm 包只是一个启动器——它会调用 mcp-remote,并将其指向托管端点(https://unit-converter-mcp.atlasword.workers.dev/mcp)。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。