UniRate MCP
OfficialUniRate MCPサーバー
UniRate API 用の Model Context Protocol サーバーです。Claude、Cursor、Continue、その他MCP互換のAIアシスタントに、通貨換算と為替レートへのファーストクラスのアクセスを提供します。
🔄 170以上の通貨(法定通貨+主要暗号資産)間のリアルタイム換算
📈 1999年まで遡る履歴レート(Proプラン)
🆓 無料枠あり、クレジットカード不要 — unirateapi.com でキーを取得
🧩 4つのツール、完全な型定義(Zodスキーマ)、構造化された出力
🌐 Stdio + Streamable HTTP/SSEトランスポート — ローカル実行またはリモートMCPエンドポイントとしてホスト可能
⚡ 純粋なNode 18+、
@modelcontextprotocol/sdkへの単一依存
なぜこれが必要なのか
現在の「AIのための通貨」ワークフローのほとんどは、カスタムツールでの手書きのfetchラッパーや、モデルに生のJSONを渡す汎用的なHTTP MCPサーバーに依存しています。このサーバーは、モデルに対して厳密で型定義された、通貨を認識するツールインターフェースを提供します。モデルは「2020年3月15日の100米ドルはユーロでいくらでしたか?」と尋ねるだけで、フォーマットされた回答と、他のツール呼び出しにチェーンできる構造化されたペイロードを受け取ることができます。
Related MCP server: Currency Exchange MCP Server
クイックスタート
1. インストール
npm install -g @unirate/mcpまたは npx @unirate/mcp でオンデマンド実行(インストール不要)。
2. UniRate APIキーの取得
無料枠で convert、latest_rate、list_currencies が利用可能です。unirateapi.com でサインアップしてください(クレジットカード不要)。
3. MCPクライアントへの組み込み
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) または %APPDATA%\Claude\claude_desktop_config.json (Windows) を編集します:
{
"mcpServers": {
"unirate": {
"command": "npx",
"args": ["-y", "@unirate/mcp"],
"env": {
"UNIRATE_API_KEY": "your-api-key-here"
}
}
}
}Claude Desktopを再起動します。ツールピッカーに4つのUniRateツールが表示されます。
Cursor / Continue / Cline
MCP設定(.cursor/mcp.json、~/.continue/config.json など)に追加します:
{
"mcpServers": {
"unirate": {
"command": "npx",
"args": ["-y", "@unirate/mcp"],
"env": { "UNIRATE_API_KEY": "your-api-key-here" }
}
}
}ソースから実行
git clone https://github.com/UniRate-API/unirate-mcp.git
cd unirate-mcp
npm install && npm run build
UNIRATE_API_KEY=your-key node dist/index.js4. リモートエンドポイントとして実行(Streamable HTTP / SSE)
デフォルトでは、サーバーはClaude DesktopやほとんどのMCPクライアントが求める stdio を使用します。共有利用、マルチユーザーデプロイメント、またはブラウザベースのクライアントのためにリモートエンドポイントとしてホストする場合は、HTTPモードで起動します:
UNIRATE_API_KEY=your-key unirate-mcp --http 3001
# or via env:
UNIRATE_API_KEY=your-key UNIRATE_MCP_HTTP_PORT=3001 unirate-mcpこれにより以下が公開されます:
POST /mcp— Streamable HTTPエンドポイント(SSE対応)。ステートレス:リクエストごとに新しいサーバーが構築されるため、同じプロセスで多くの同時クライアントにサービスを提供できます。GET /healthz— JSON生存確認プローブ ({ "status": "ok", "server": "unirate-mcp", "version": "..." })。
Streamable-HTTP対応のMCPクライアント(リモートサーバーサポート付きのClaude Desktop、CursorリモートMCPなど)を http://your-host:3001/mcp に向けてください。本番環境ではリバースプロキシ + TLSの背後に配置してください。
プログラム的 / エッジランタイム(Cloudflare Workers, Deno, Bun)
パッケージは buildServer(client) をエクスポートしているため、ランタイムが好むトランスポートに接続できます。Workers / Deno / Bun の場合は、エクスポートされた buildServer インスタンスと共にSDKの webStandardStreamableHttp トランスポートを使用してください。
import { UnirateClient } from "@unirate/mcp/dist/client.js";
import { buildServer } from "@unirate/mcp";
// → connect to your runtime's preferred transportツール
convert
最新のレートで、ある通貨から別の通貨へ金額を換算します。
パラメータ | 型 | 必須 | 備考 |
| string | はい | ISO 4217コード (例: |
| string | はい | ISO 4217コード (例: |
| number | はい |
|
呼び出し例:
{ "name": "convert", "arguments": { "from": "USD", "to": "EUR", "amount": 100 } }レスポンス: 人間が読めるテキストと構造化された { from, to, amount, result }。
latest_rate
現在の為替レートを取得します。
パラメータ | 型 | 必須 | 備考 |
| string | はい | 基本通貨 |
| string | いいえ | 対象通貨。省略すると全通貨のレートを取得 |
historical_rate (Proプラン)
特定の日に有効だった為替レートを取得します。主要な法定通貨ペアについては 1999年1月4日 まで遡れます。
パラメータ | 型 | 必須 | 備考 |
| string | はい |
|
| string | はい | 元の通貨 |
| string | はい | 対象通貨 |
| number | いいえ | デフォルトは 1 |
無料枠のキーでPro機能を使用すると、unirateapi.com へのアップグレードを促す明確なエラーが返されます。
list_currencies
サポートされている通貨コードの配列(170以上)をパラメータなしで返します。オートコンプリートやユーザー入力コードの検証に便利です。
エラー
すべてのUniRate APIの失敗は、わかりやすいツールエラーにマッピングされます:
HTTP | エラークラス | モデルが見る内容 |
400 |
| "Invalid request parameters" |
401 |
| "Missing or invalid API key" |
403 |
| "…requires Pro… upgrade at https://unirateapi.com" |
404 |
| "Currency not found or no data available" |
429 |
| "Rate limit exceeded" |
503 |
| "Service unavailable" |
ネットワーク/タイムアウトエラーは UnirateError にラップされます。ツール呼び出しは、プロトコルレベルのエラーをスローするのではなく、常に isError: true を含むレスポンスオブジェクトを返すため、モデルは適切に復旧できます。
開発
npm install
npm run build # compile TypeScript to dist/
npm test # 24 mock tests
UNIRATE_LIVE=1 UNIRATE_API_KEY=... npm run test:live # +4 live free-tier tests関連プロジェクト
UniRateは9つの言語で公式クライアントライブラリを提供しています:
さらに n8nコミュニティノード もあります。
ライセンス
MIT — LICENSE を参照してください。
Available Tools
4 toolsconvertConvert currencyARead-only
Convert an amount from one currency to another using the latest exchange rate. Codes are ISO 4217 (e.g. USD, EUR, GBP). Supports 170+ fiat currencies and major cryptocurrencies.
Inputs: from (required), to (required), amount (required).
historical_rateGet historical exchange rate (Pro plan required)ARead-only
Fetch the exchange rate that was in effect on a specific date. Date format YYYY-MM-DD. Coverage goes back to 1999-01-04 for major fiat pairs. Requires UniRate Pro — free-tier keys will receive a clear upgrade-required error.
Inputs: date (required), from (required), to (required), amount.
latest_rateGet latest exchange rate(s)ARead-only
Fetch the latest exchange rate for a base currency. If 'to' is provided, returns a single rate; otherwise returns rates for all supported currencies relative to the base.
Inputs: from (required), to.
list_currenciesList supported currenciesARead-only
Return the list of currency codes supported by the UniRate API (170+ fiat plus major crypto).
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool serves a distinct purpose: converting amounts, fetching historical rates, getting latest rates, and listing supported currencies. No overlaps.
All tool names use consistent snake_case and follow a verb_noun or adjective_noun pattern, making them predictable.
4 tools is well-scoped for a currency conversion API, covering essential operations without unnecessary complexity.
The tool set covers conversion, latest rates, historical rates, and currency listing—no obvious gaps for the domain.
Maintenance
Related MCP Connectors
Live & historical FX rates and currency conversion for AI agents. No API keys.
Live & historical FX rates and currency conversion for AI agents. No API keys.
Currency rates, history from 1949, IMF PPP, and FX analytics for AI agents.
Free, keyless real-time currency conversion and exchange rates for any currency pair.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides real-time foreign-exchange rates, historical data, and multi-currency lookups to MCP-compatible AI coding assistants like Claude Code and Cursor.4MIT
- FlicenseNot gradedqualityDmaintenanceEnables real-time currency exchange rate retrieval and conversion for over 200 currencies. Supports operations like getting rates, converting amounts, and comparing currencies through natural language.-
- AlicenseAqualityCmaintenanceEnables AI coding tools to access real-time and historical currency exchange rates for 160+ currencies, sourced from Reuters/Refinitiv.451 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to retrieve live buy and sell exchange rates from 1,219 commercial banks across 124 countries, compare banks, check spreads against central bank official rates, and look up past daily rates.7179 npmMIT