Skip to main content
Glama
UniRate-API

UniRate MCP

Official
by UniRate-API

UniRate MCPサーバー

npm License

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: FX Currency 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.js

4. リモートエンドポイントとして実行(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

最新のレートで、ある通貨から別の通貨へ金額を換算します。

パラメータ

型

必須

備考

from

string

はい

ISO 4217コード (例: USD)

to

string

はい

ISO 4217コード (例: EUR)

amount

number

はい

from の正の金額

呼び出し例:

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

レスポンス: 人間が読めるテキストと構造化された { from, to, amount, result }。

latest_rate

現在の為替レートを取得します。

パラメータ

型

必須

備考

from

string

はい

基本通貨

to

string

いいえ

対象通貨。省略すると全通貨のレートを取得

historical_rate (Proプラン)

特定の日に有効だった為替レートを取得します。主要な法定通貨ペアについては 1999年1月4日 まで遡れます。

パラメータ

型

必須

備考

date

string

はい

YYYY-MM-DD (例: 2020-03-15)

from

string

はい

元の通貨

to

string

はい

対象通貨

amount

number

いいえ

デフォルトは 1

無料枠のキーでPro機能を使用すると、unirateapi.com へのアップグレードを促す明確なエラーが返されます。

list_currencies

サポートされている通貨コードの配列(170以上)をパラメータなしで返します。オートコンプリートやユーザー入力コードの検証に便利です。

エラー

すべてのUniRate APIの失敗は、わかりやすいツールエラーにマッピングされます:

HTTP

エラークラス

モデルが見る内容

400

InvalidRequestError

"Invalid request parameters"

401

AuthenticationError

"Missing or invalid API key"

403

ProPlanRequiredError

"…requires Pro… upgrade at https://unirateapi.com"

404

InvalidCurrencyError

"Currency not found or no data available"

429

RateLimitError

"Rate limit exceeded"

503

APIError

"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 tools
convertConvert currencyA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
fromYesSource currency code, e.g. 'USD'
toYesTarget currency code, e.g. 'EUR'
amountYesAmount in the source currency

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint and openWorldHint. The description adds that it uses the latest exchange rate and supports 170+ fiat and crypto currencies with ISO 4217 codes, which is helpful context beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded, no redundant words. Every sentence adds value: first explains action, second defines scope and standard.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and lack of output schema, the description covers core function, supported currencies, and code standard. Could mention precision or source but not necessary for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all three parameters. The description does not add new information about individual parameters beyond the schema's examples and hints; baseline is 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'convert' and identifies resource as currency amount using latest rate. It clearly distinguishes from sibling tools like historical_rate and list_currencies by focusing on conversion rather than rate lookup or listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for converting amounts, but does not explicitly state when to use it versus alternatives like latest_rate (for rate only) or historical_rate. No when-not-to-use guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

historical_rateGet historical exchange rate (Pro plan required)A
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYesDate in YYYY-MM-DD format, e.g. '2020-03-15'
fromYesSource currency code
toYesTarget currency code
amountNoOptional amount to convert at the historical rate. Defaults to 1.

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide readOnlyHint and openWorldHint; description adds coverage start date (1999-01-04) and error behavior for free-tier keys. Does not disclose behavior for out-of-range dates or missing data, but key behavioral context is added beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences: first states purpose, second gives format, third adds coverage and requirement. No wasted words, front-loaded with action verb. Perfect structure for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks description of return value (e.g., what is returned if amount is provided). No output schema, so description should hint at response shape. Also, does not specify behavior for missing or invalid dates beyond coverage range. Completeness is adequate but has notable gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% coverage with clear descriptions. Description adds value by stating the coverage start date for the date parameter, which is not in schema. Also reinforces date format. Does not add to other parameters, but schema already sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it fetches the exchange rate for a specific date, using strong verb 'Fetch' and specific resource. Differentiates from siblings (convert, latest_rate, list_currencies) by focusing on historical data. Mentions date format and coverage range, solidifying purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly notes that the tool requires UniRate Pro, including that free-tier keys will receive an error. This is a critical usage condition. Also provides date format and coverage range, helping decide when to use. Does not need to list alternatives as purpose is self-evident.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

latest_rateGet latest exchange rate(s)A
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
fromYesBase currency code, e.g. 'USD'
toNoOptional target currency. Omit to get rates for all currencies.

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint and openWorldHint. Description adds scoping (base currency, single/all rates) but doesn't elaborate on data freshness, caching, or external dependencies. Adequate given annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loads the main action, no unnecessary words. Perfectly concise while conveying the two use cases.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given low complexity (2 params, no output schema), description is mostly complete. Could briefly mention return format (e.g., object with rates) but not essential. Agent can infer from typical usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema already describes both params clearly (100% coverage). Description adds value by explaining the behavioral switch when 'to' is omitted, which is not in the schema descriptions. Enhances understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Fetch the latest exchange rate' with distinct behaviors: single rate if 'to' provided, all rates if omitted. Differentiates from siblings through scope (latest vs. historical, conversion, currency list).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Describes when to provide 'to' vs omit, but does not explicitly compare to sibling tools like convert or historical_rate. Agent can infer from sibling names, but no direct usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_currenciesList supported currenciesA
Read-only

Return the list of currency codes supported by the UniRate API (170+ fiat plus major crypto).

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint and openWorldHint; the description adds the count and types of currencies, providing useful context beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is direct and front-loaded, with no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and no output schema, the description fully informs the agent about the tool's purpose and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so the schema covers 100%; baseline for zero parameters is 4, and the description omits irrelevant parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Return the list of currency codes' and specifies the scope '170+ fiat plus major crypto', distinguishing it from sibling tools for conversion and rates.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While no explicit when-to-use guidance is given, the simple nature and clear context make it obvious this tool is for obtaining supported currencies before using other tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.2.2
    • First observedconvert
    • First observedhistorical_rate
    • First observedlatest_rate
    • First observedlist_currencies

TDQS

A4.4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool serves a distinct purpose: converting amounts, fetching historical rates, getting latest rates, and listing supported currencies. No overlaps.

Naming Consistency5/5

All tool names use consistent snake_case and follow a verb_noun or adjective_noun pattern, making them predictable.

Tool Count5/5

4 tools is well-scoped for a currency conversion API, covering essential operations without unnecessary complexity.

Completeness5/5

The tool set covers conversion, latest rates, historical rates, and currency listing—no obvious gaps for the domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Provides access to currency exchange rates and conversion tools using the Frankfurter API, including latest rates, historical data, and time series from sources like the European Central Bank.
    5
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time and historical foreign exchange rates for 31+ currencies, enabling currency conversion, historical rate lookups, and time series analysis using data from the Frankfurter API.
    -
  • A
    license
    A
    quality
    B
    maintenance
    Provides real-time foreign-exchange rates, historical data, and multi-currency lookups to MCP-compatible AI coding assistants like Claude Code and Cursor.
    4
    130 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides real-time exchange rates for any currency pair using open.er-api.com, simplifying currency conversion with a single tool.
    148 npm
    MIT