---
title: "Use live exchange rates from Gemini CLI with MCP"
description: "Connect Gemini CLI to exchangerate.dev over Streamable HTTP, discover its tools, and ask for current USD/JPY or USD/KRW rates without writing a REST client."
canonical: "https://exchangerate.dev/learn/gemini-cli-exchange-rates"
---

> Index of every exchangerate.dev page and doc for AI readers: [llms.txt](https://exchangerate.dev/llms.txt)

# Use live exchange rates from Gemini CLI with MCP

Connect Gemini CLI to exchangerate.dev over Streamable HTTP, discover its tools, and ask for current USD/JPY or USD/KRW rates without writing a REST client.

By the Exchangerate team · Updated 5 Sep 2026 · 6 min read

Gemini CLI can call an MCP server during a session. This guide connects it to exchangerate.dev, starts anonymously so you can verify the tool surface, and then shows the optional API-key configuration for regular use. Rates are indicative and for reference or analytics, not settlement or trading.

- Install Gemini CLI using the current instructions at geminicli.com; do not paste an API key into a prompt or commit it to settings.
- Gemini CLI accepts a remote MCP server with the `httpUrl` property in `.gemini/settings.json`.
- The server exposes `list_currencies`, `get_rate`, `convert`, `get_range`, `search_docs`, and a human-confirmed `start_checkout` tool.
- Start with no key to test anonymous access. Add `EXCHANGERATE_API_KEY` through environment expansion when you need a regular quota.
- Keep Gemini CLI confirmation prompts enabled. Never use `--yolo` for an untrusted project or MCP server.

## Install Gemini CLI

Follow the [official Gemini CLI installation guide](https://geminicli.com/docs/get-started/installation/). The command and supported package manager can change, so use the current instructions there rather than an old global-install snippet. Start `gemini` in a project directory you trust and follow its sign-in prompts. Gemini CLI authentication and usage limits are separate from the exchangerate.dev API key and quota.

## Add the anonymous MCP server first

Gemini CLI reads project settings from `.gemini/settings.json`. Create that file and add the server below. `httpUrl` is Gemini CLI’s remote Streamable HTTP configuration field; the MCP endpoint is not a page you open in a browser.

```geminisettingsjsonanonymous title=".gemini/settings.json · anonymous"
{
  "mcpServers": {
    "exchangerate": {
      "httpUrl": "https://api.exchangerate.dev/v1/mcp/"
    }
  }
}
```

This uses the same live data without an API key, subject to anonymous IP limits. It lets you confirm that Gemini CLI can connect before you add credentials.

## Add a key through an environment variable

For repeated work, keep the key outside the file and prompt. Gemini CLI supports environment-variable expansion in MCP settings. Export the variable in your shell or load it from your normal secret manager, then use `$EXCHANGERATE_API_KEY` in the header value:

```geminisettingsjsonkeyed title=".gemini/settings.json · keyed"
{
  "mcpServers": {
    "exchangerate": {
      "httpUrl": "https://api.exchangerate.dev/v1/mcp/",
      "headers": {
        "Authorization": "Bearer $EXCHANGERATE_API_KEY"
      }
    }
  }
}
```

Set `EXCHANGERATE_API_KEY` in your shell before launching Gemini CLI. Do not replace the placeholder with a real key in a tutorial, chat transcript, repository, or shared settings file.

## Check the connection and discover tools

Start Gemini CLI in the project where you saved the settings, then run `/mcp list` (or `gemini mcp list` from the shell) to inspect the configured server and tools. If the server shows Disabled because the folder is untrusted, review Gemini CLI’s normal workspace-trust prompt for your own project; keep the trust checks enabled. The exchangerate.dev server provides `list_currencies`, `get_rate`, `convert`, `get_range`, and `search_docs`; `start_checkout` opens a billing handoff only after explicit human confirmation.

```geminiclipromptdiscovery title="Gemini CLI prompt · discovery"
Use the exchangerate MCP server's list_currencies tool.
Tell me whether JPY and KRW are supported, then stop.
Do not call any billing or checkout tool.
```

## Ask for USD/JPY and USD/KRW

Use prompts that name the pair, direction, and observation requirement. Ask Gemini CLI to show the returned timestamp and freshness fields so a reader can distinguish an indicative reference value from an executable quote.

```geminiclipromptslatestandconversion title="Gemini CLI prompts · latest and conversion"
Use get_rate with base USD and quote JPY.
Report the rate, timestamp, source, and market_session.
Call it an indicative reference rate, not a trading quote.

Use convert to calculate 2500 USD in KRW.
Show the amount, pair, returned rate, timestamp, source, and market_session.
Do not invent a rate if the tool returns an error.
```

## Fetch history without guessing

For a chart or comparison, use `get_range` with an explicit base, symbol, and ISO date range. The result is a daily series and may include forward-filled non-trading days. Preserve the response metadata when you export or explain it.

```geminicliprompthistoricalseries title="Gemini CLI prompt · historical series"
Use get_range for base USD and symbols JPY,KRW
from 2026-01-01 through 2026-03-31.
Summarize the first and last available observations for both pairs.
Report only metadata fields returned by the tool, and mention when a requested field is absent. Identify any is_forward_filled rows.
Do not treat indicative rates as settlement prices.
```

## Handle errors and keep approvals on

If the server is disconnected, inspect `/mcp` and the CLI diagnostic output, then check the URL and JSON syntax. A 401 or 403 indicates an authentication or access configuration problem; a 429 means the anonymous or keyed limit was reached. Do not ask the model to retry indefinitely or make up a value. MCP tool calls consume the API quota; initialization and tool discovery do not.

**Keep confirmation prompts enabled**

Review Gemini CLI’s confirmation prompt before tool calls, especially billing actions. Keep the default approval flow enabled.

## Do not confuse Gemini CLI with Gemini consumer chat

This setup is for Google’s terminal agent, Gemini CLI. It is not a configuration for the Gemini consumer web or mobile application. The CLI loads MCP servers from its settings and invokes their tools during a session.

## Read the contracts

See the [exchangerate.dev MCP setup guide](https://exchangerate.dev/docs/mcp) for the API-side tool contract and quota behavior, and the [official Gemini CLI MCP documentation](https://geminicli.com/docs/tools/mcp-server/) for current settings, remote-server, environment-expansion, and confirmation behavior.

## Questions

### Does Gemini CLI support a remote exchangerate.dev MCP server?

Yes. Configure the Streamable HTTP endpoint with Gemini CLI’s `httpUrl` MCP setting. Start without a key to test anonymous access, then add an environment-expanded Bearer token for regular use.

### Which exchange-rate tools are available?

`list_currencies`, `get_rate`, `convert`, `get_range`, `search_docs`, and the human-confirmed `start_checkout` tool.

### Are these rates suitable for settlement?

No. They are indicative rates for reference and analytics. Preserve source, market_session, and timestamp fields when presenting a result.

## Keep reading

- [Give your LLM agent live FX rates over MCP](https://exchangerate.dev/learn/fx-rates-mcp-server-llm-agents)
- [Google Sheets exchange-rate tutorial](https://exchangerate.dev/learn/google-sheets-exchange-rates)
- [USD/JPY exchange rate](https://exchangerate.dev/exchange-rates/usd-jpy)
- [Build a Currency Converter in React](https://exchangerate.dev/react-currency-converter-api)
- [Exchange Rate API for Ruby on Rails](https://exchangerate.dev/ruby-on-rails-exchange-rate-api)
- [Currency Conversion API for Shopify](https://exchangerate.dev/shopify-currency-conversion-api)

Source: https://exchangerate.dev/learn/gemini-cli-exchange-rates
