UniRate API

io.github.UniRate-API由 GitHub 账号 UniRate-API 发布v0.2.2更新于 Nov 3, 2026

Currency conversion and exchange rates for AI. 170+ currencies, historical data back to 1999.

已验证STDIO仅桌面金融数据与分析

概览

AI 生成的概览

UniRate API MCP 服务器让助手进行 170 多种货币的汇率换算与查询,并可获取最早到 1999 年的历史汇率。

可以做什么
  • 按最新汇率在两种货币之间换算金额
  • 查询单一货币对或全部货币的当前汇率
  • 获取指定日期生效的历史汇率(需 Pro 套餐)
  • 列出支持的货币代码,用于校验或自动补全
适用场景
适合助手需要回答金额问题、换算价格或发票,或查询某个历史日期汇率的场景,无需自行编写 HTTP 封装。返回结果包含可读文本和结构化数据,便于继续串联其他工具调用。
运行要求
以 Node.js 18+ 本地进程运行,可通过 npx 或全局 npm 安装,也可使用 Docker 镜像,或托管为 HTTP/SSE 模式。需要在 UNIRATE_API_KEY 环境变量中提供 UniRate API 密钥,免费套餐密钥即可覆盖换算、最新汇率和货币列表。需要访问 UniRate API 的网络连接。
安装前请注意
API 密钥是敏感信息,通过环境变量传入,请勿写入共享配置或代码仓库。历史汇率查询需要付费 Pro 套餐,免费密钥会收到升级提示错误。以 HTTP 模式托管会暴露一个端点,应置于反向代理和 TLS 之后。存在速率限制,并以工具错误形式返回。

安装

在 SourceWeft 中

  1. 打开 控制台中的 UniRate API,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

UniRate MCP Server

[npm] [License]

A Model Context Protocol server for the UniRate API — give Claude, Cursor, Continue, and any MCP-compatible AI assistant first-class access to currency conversion and exchange rates.

  • 🔄 Real-time conversion between 170+ currencies (fiat + major crypto)
  • 📈 Historical rates back to 1999 (Pro plan)
  • 🆓 Free tier, no credit card required — get a key at unirateapi.com
  • 🧩 Four tools, fully-typed inputs (Zod schemas), structured outputs
  • 🌐 Stdio + Streamable HTTP/SSE transports — run locally or host as a remote MCP endpoint
  • ⚡ Pure Node 18+, single dependency on @modelcontextprotocol/sdk

Why this exists

Most "currency for AI" workflows today involve hand-rolled fetch wrappers in custom tools, or generic HTTP MCP servers that hand the model raw JSON. This server gives models a tight, typed, currency-aware tool surface — they ask "what was 100 USD in EUR on 2020-03-15?" and get back a formatted answer plus a structured payload they can chain into other tool calls.

Quick start

1. Install

bash
npm install -g @unirate/mcp

Or run on demand with npx @unirate/mcp (no install).

2. Get a UniRate API key

Free tier covers convert, latest_rate, and list_currencies. Sign up at unirateapi.com — no credit card required.

3. Wire it into your MCP client

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "unirate": {      "command": "npx",      "args": ["-y", "@unirate/mcp"],      "env": {        "UNIRATE_API_KEY": "your-api-key-here"      }    }  }}

Restart Claude Desktop. The four UniRate tools will appear in the tool picker.

Cursor / Continue / Cline

Add to your MCP config (.cursor/mcp.json, ~/.continue/config.json, etc.):

json
{  "mcpServers": {    "unirate": {      "command": "npx",      "args": ["-y", "@unirate/mcp"],      "env": { "UNIRATE_API_KEY": "your-api-key-here" }    }  }}
From source
bash
git clone https://github.com/UniRate-API/unirate-mcp.gitcd unirate-mcpnpm install && npm run buildUNIRATE_API_KEY=your-key node dist/index.js

4. Run as a remote endpoint (Streamable HTTP / SSE)

By default the server uses stdio, which is what Claude Desktop and most MCP clients want. To host it as a remote endpoint instead — for shared use, multi-user deployments, or browser-based clients — start it in HTTP mode:

bash
UNIRATE_API_KEY=your-key unirate-mcp --http 3001# or via env:UNIRATE_API_KEY=your-key UNIRATE_MCP_HTTP_PORT=3001 unirate-mcp

That exposes:

  • POST /mcp — Streamable HTTP endpoint (SSE-capable). Stateless: a fresh server is built per request, so the same process can serve many concurrent clients.
  • GET /healthz — JSON liveness probe ({ "status": "ok", "server": "unirate-mcp", "version": "..." }).

Point any Streamable-HTTP-capable MCP client (Claude Desktop with remote server support, Cursor remote MCP, etc.) at http://your-host:3001/mcp. Drop it behind a reverse proxy + TLS for production.

Docker

Multi-arch images (linux/amd64, linux/arm64) are published to both the GitHub Container Registry (ghcr.io/unirate-api/unirate-mcp) and Docker Hub (unirate/unirate-mcp) — use whichever you prefer:

bash
# stdio mode (for local AI clients — pipe stdin/stdout)docker run --rm -i -e UNIRATE_API_KEY="your-key" \  ghcr.io/unirate-api/unirate-mcp:latest# ...or from Docker Hub:#   docker run --rm -i -e UNIRATE_API_KEY="your-key" unirate/unirate-mcp:latest
# HTTP/SSE mode (hosted endpoint on :3001)docker run --rm -p 3001:3001 -e UNIRATE_API_KEY="your-key" \  ghcr.io/unirate-api/unirate-mcp:latest --http 3001

Point an MCP client at http://your-host:3001/mcp for the Streamable HTTP transport.

Programmatic / edge runtimes (Cloudflare Workers, Deno, Bun)

The package exports buildServer(client) so you can wire it to whatever transport your runtime prefers. For Workers / Deno / Bun, use the SDK's webStandardStreamableHttp transport with an exported buildServer instance.

ts
import { UnirateClient } from "@unirate/mcp/dist/client.js";import { buildServer } from "@unirate/mcp";// → connect to your runtime's preferred transport

Tools

convert

Convert an amount from one currency to another at the latest rate.

ParamTypeRequiredNotes
fromstringyesISO 4217 code (e.g. USD)
tostringyesISO 4217 code (e.g. EUR)
amountnumberyesPositive amount in from

Example call:

json
{ "name": "convert", "arguments": { "from": "USD", "to": "EUR", "amount": 100 } }

Response: human-readable text plus structured { from, to, amount, result }.

latest_rate

Get current exchange rate(s).

ParamTypeRequiredNotes
fromstringyesBase currency
tostringnoTarget. Omit to get rates for all currencies

historical_rate (Pro plan)

Get the exchange rate that was in effect on a specific date. Coverage back to 1999-01-04 for major fiat pairs.

ParamTypeRequiredNotes
datestringyesYYYY-MM-DD (e.g. 2020-03-15)
fromstringyesSource currency
tostringyesTarget currency
amountnumbernoDefaults to 1

Free-tier keys receive a clear error pointing to unirateapi.com for upgrade.

list_currencies

Returns the array of supported currency codes (170+) with no parameters. Useful for autocomplete or validating user-supplied codes.

Errors

All UniRate API failures are mapped to friendly tool errors:

HTTPError classWhat the model sees
400InvalidRequestError"Invalid request parameters"
401AuthenticationError"Missing or invalid API key"
403ProPlanRequiredError"…requires Pro… upgrade at https://unirateapi.com"
404InvalidCurrencyError"Currency not found or no data available"
429RateLimitError"Rate limit exceeded"
503APIError"Service unavailable"

Network/timeout errors are wrapped in UnirateError. Tool calls always return a response object with isError: true rather than throwing protocol-level errors, so the model can recover gracefully.

Development

bash
npm installnpm run build       # compile TypeScript to dist/npm test            # 24 mock testsUNIRATE_LIVE=1 UNIRATE_API_KEY=... npm run test:live  # +4 live free-tier tests

UniRate ecosystem

UniRate ships official integrations for 40+ ecosystems, all maintained under the UniRate-API org.

Core clients (9 languages) Python · Node.js / TypeScript · Go · Rust · Java · Ruby · PHP · .NET · Swift

JavaScript / TypeScript React · Next.js · Remix · SvelteKit · Vue · Angular · Nuxt · NestJS · tRPC

Static-site generators Astro · Eleventy · Hugo · Jekyll

CMS & e-commerce Wagtail · WordPress · WooCommerce · Drupal · Strapi · Medusa · Symfony · Laravel · Directus

Data, AI & backend LangChain (Python) · LangChain.js · FastAPI · Flask · Django REST Framework · Apache Airflow · dbt

Platform & tools MCP server · CLI · Cloudflare Workers · Home Assistant · n8n · Google Sheets · VS Code · Obsidian

Money library bridges money gem (Ruby) · NodaMoney (.NET)

Get a free API key at unirateapi.com.

License

MIT — see LICENSE.

来源:README.md,提交 59d3972

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分