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.
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.
httpUrl property in .gemini/settings.json.list_currencies, get_rate, convert, get_range, search_docs, and a human-confirmed start_checkout tool.EXCHANGERATE_API_KEY through environment expansion when you need a regular quota.--yolo for an untrusted project or MCP server.Install Gemini CLI
Follow the official Gemini CLI installation guide. 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.
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:
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.
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.
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.
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.
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 hub for the API-side tool contract and quota behavior, and the official Gemini CLI MCP documentation for current settings, remote-server, environment-expansion, and confirmation behavior.