# Treasury Exchange Rates MCP

> U.S. Treasury Exchange Rates — Official Foreign Currency Data gives you access to rates sourced directly from the U.S. Department of the Treasury. It provides current official exchange rates for over 170 foreign currencies against the USD, as well as deep historical and fiscal datasets. Use it when your workflow requires government-certified financial benchmarks for accounting or analysis.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** exchange-rates, currency-conversion, foreign-exchange, historical-data, financial-reporting, global-finance

## Description

You wanna run numbers that matter? This server pulls rates straight from the U.S. Department of the Treasury—that means you're working with government-certified financial benchmarks, not some sketchy private bank feed. When your workflow needs official hard data for accounting or deep analysis, this is what you use.

**get_treasury_exchange_rates**: This tool lets you grab all the benchmark rates at once. It returns official exchange rates covering over 170 foreign currencies against the U.S. dollar. You run this when you're doing bulk financial reporting because it gives you a massive snapshot of the current market, using the exact rates federal agencies use for their own reports.

**get_exchange_rate_for_currency**: Need just one pair? This tool retrieves the latest Treasury rate for any single foreign currency or country pairing you specify. It updates quarterly and is perfect when you only need to check that specific current official exchange rate—say, finding out the exact USD rate for the Japanese Yen or Canadian Dollar without having to process a whole list of currencies.

**query_treasury_dataset**: This is where you go deep into the books. If rates aren't enough, this tool lets you query any specific fiscal dataset available on treasury.gov. You provide the exact API endpoint path for what you want—it could be debt metrics, specific accounting records, or time-series data tracking how a particular currency’s rate has shifted over months or years. This mechanism means you're not limited to just the current rates; you can target virtually any documented dataset the Treasury tracks.

Think about it: If your job requires knowing how many times a specific metric—like bond yield changes or historical debt reporting—has changed, you use this endpoint path. It’s designed for targeted data extraction, giving you access to the full spectrum of Treasury accounting and debt information through direct querying. You specify the resource path, and it pulls the raw data history you need.

It's all about precision. Whether you're tracking annual trends across multiple years or just needing that single rate update for a quarterly filing, these tools keep you tethered to the official source. You get bulk rates with `get_treasury_exchange_rates` for your main report; you check specific pairs quickly using `get_exchange_rate_for_currency`; and when you need to dive into historical context or complex fiscal records—like running a time-series analysis of a currency's rate shift over five years—you hit up the raw endpoint paths with `query_treasury_dataset`.

You won’t waste time compiling data from multiple, unrelated sources. You use your AI client to call these tools directly, pulling the exact numbers you need for everything from corporate treasury management to academic financial research. It's clean, it's official, and it's built around three distinct functions that cover every angle: current bulk benchmarks, specific pair lookups, and deep, targeted data history.

## Tools

### get_treasury_exchange_rates
Returns official exchange rates covering 170+ currencies against USD, suitable for bulk financial reporting.

### get_exchange_rate_for_currency
Retrieves the latest Treasury rate for a single specified foreign currency or country pair, updated quarterly.

### query_treasury_dataset
Allows querying any specific fiscal dataset on treasury.gov by providing the exact API endpoint path.

## Prompt Examples

**Prompt:** 
```
What is the official Treasury exchange rate for the Euro?
```

**Response:** 
```
📊 **Treasury Exchange Rates**

The EUR/USD rate for March 2026 is:
- 1 EUR = 1.085 USD
(Reported by the U.S. Treasury as 0.921 EUR per 1 USD)
```

**Prompt:** 
```
Show the historical exchange rate for Brazil over the last year
```

**Response:** 
```
📊 **Historical Rates: Brazil (Real)**

- Mar 2026: 4.95 BRL
- Dec 2025: 4.85 BRL
- Sep 2025: 5.02 BRL
- Jun 2025: 4.79 BRL
```

**Prompt:** 
```
What is the Treasury rate for Japanese Yen?
```

**Response:** 
```
📊 **Treasury Exchange Rates**

Official exchange rate for Japan (Yen) as of Mar 2026:
- 151.34 JPY per 1 USD
```

## Capabilities

### Retrieve benchmark exchange rates
Get the latest official rate for 170+ foreign currencies against the U.S. dollar.

### Look up single currency rates
Find the specific, current Treasury-backed exchange rate for any named currency pair.

### Access historical currency trends
Pull time-series data to track how a specified currency's rate has changed over years or months.

### Query specific fiscal datasets
Run targeted queries against the entire spectrum of Treasury accounting and debt reporting data using known API endpoints.

## Use Cases

### Comparing Foreign Debt Obligations
An auditor needs to calculate the USD value of a foreign bond portfolio. Instead of manually searching, they ask their agent to use `query_treasury_dataset` with the relevant endpoint path. The agent returns the required dataset alongside the necessary exchange rates from `get_treasury_exchange_rates`, completing the calculation in one step.

### Preparing a Multi-Currency Report
A finance manager needs to list current official conversion benchmarks for 20 different countries. They trigger `get_treasury_exchange_rates`. The agent immediately returns all rates against the USD, saving hours of manual lookups and ensuring consistency across the entire report.

### Checking a Single Target Market Rate
A trader needs to confirm the official rate for the Japanese Yen before executing a large transfer. They ask their agent to use `get_exchange_rate_for_currency` with 'Japan-Yen'. The result is immediate, providing the single, verifiable Treasury benchmark.

### Analyzing Historical Trends
A quantitative analyst wants to see how a currency's rate behaved over the last year. They prompt their agent for historical rates using the specified country/currency tool. The agent provides a time-series list, letting them plot and analyze trends instantly.

## Benefits

- Cross-Validate Data: Use `get_treasury_exchange_rates` to pull a bulk list of 170+ currency benchmarks, allowing you to compare multiple foreign exchange values against a single, reliable source instantly.
- Pinpoint Rates Fast: Need one specific rate? `get_exchange_rate_for_currency` lets your agent grab the official Treasury rate for 'Brazil-Real' or any other pair without needing complex parameters.
- Deep Fiscal Analysis: Go beyond rates. `query_treasury_dataset` provides access to specific accounting information, like debt metrics, letting you analyze underlying financial health indicators not available through standard currency lookups.
- Historical Context: Track how a rate has moved over time using the historical functions. This context is crucial for modeling risk and comparing current market positions against past federal standards.
- Eliminate Rate Drift Risk: By sourcing rates directly from the U.S. Department of the Treasury, your reports minimize the chance of relying on secondary or less authoritative exchange data.

## How It Works

The bottom line is that you get direct, verifiable numbers from the U.S. Department of the Treasury for your analysis.

1. Specify the required rate or dataset. For rates, input a currency name (e.g., 'Euro') or use `get_treasury_exchange_rates` for bulk data. If querying deep records, provide the exact endpoint path to the desired fiscal dataset.
2. The server calls the U.S. Treasury API, retrieving the official rate or structured JSON data based on your parameters (e.g., date range, currency code).
3. Your agent receives a clean, formatted result containing the government-verified exchange rates or the requested financial record.

## Frequently Asked Questions

**What is the difference between 'historical' rates and current rates when using get_treasury_exchange_rates?**
The tool provides both. You can query historical data to see how a rate changed over time, or you can request the latest official rate for benchmarking against today's figures. They serve different purposes in financial modeling.

**Can I use get_exchange_rate_for_currency if the currency is not listed?**
If the currency isn't recognized by the U.S. Treasury system, the tool won't return a rate. You must confirm the country code or name against the source documentation to ensure accuracy.

**How do I query non-currency data using query_treasury_dataset?**
You need the specific API endpoint path for that dataset, like a debt ratio. You pass this exact string into `query_treasury_dataset` so the agent knows exactly which information to pull from the treasury database.

**Are these rates real-time market rates?**
No. These are official benchmark rates provided by the U.S. Department of the Treasury, and they are updated quarterly. They represent established federal accounting figures, not volatile interbank trading data.

**When calling `get_treasury_exchange_rates`, do I need an API key or any form of authentication?**
No, you don't. The server operates with zero authorization requirements. This means your agent can access the official rate data without needing to manage credentials.

**What should I do if my input for `get_exchange_rate_for_currency` uses an incorrect format?**
The function requires specific formats, such as 'Country-Currency' (e.g., 'Japan-Yen'). If the input fails validation, it sends a detailed error message that explains exactly what structure is missing.

**How do I find all the API endpoints and fields supported by `query_treasury_dataset`?**
You must consult the official Treasury fiscaldata.treasury.gov documentation. This source provides a comprehensive list of every available dataset path, field, and required parameter for accurate querying.

**Are there rate limits or usage caps when I use `query_treasury_dataset`?**
The service does not publicly document specific call quotas. For high-volume data streams or repeated queries, always check the official Treasury API guidelines for best practice implementation.

**How many countries are supported?**
Over 170 currencies and countries are supported.

**Can we use this for FOREX trading?**
It is not recommended for algorithmic trading as these are accounting rates, not real-time spot market rates.