If you finished the Google Skills lab Add Currency Tools to an Agent using MCP, you built a Google ADK agent that calls Coinbase for crypto prices. That's a great introduction to the Model Context Protocol — but Coinbase only covers crypto. The moment you want USD → EUR, INR → LKR, or any of the 160+ fiat pairs your users actually transact in, you need a different tool.

This guide walks through replacing (or extending) the lab's Coinbase MCP tool with the @exchangerateapi/mcp-server. By the end, your ADK agent will answer "what is 1,250 GBP in Singapore dollars right now?" with a live mid-market rate, sourced from Reuters/Refinitiv interbank feeds.

What you'll build

An ADK agent (Agent Development Kit) with two MCP tool sources wired in:

The agent picks the right tool based on the user's question. Ask about Bitcoin → Coinbase. Ask about euros → Exchange Rate API. No code changes required to switch.

Prerequisites

Why swap Coinbase for Exchange Rate API?

Coinbase APIExchange Rate API
Crypto pairsYesNo
Fiat currenciesLimited (USD-quoted only)160+ pairs, any base
Historical dataSpot trades1d / 7d / 30d / 1y series
Data sourceCoinbase exchangeReuters / Refinitiv mid-market
Update frequencyReal-time~60 seconds
AuthPublic for spotFree API key (higher limits)

For agents that handle invoices, travel budgets, e-commerce conversions, or any cross-border money flow, fiat coverage is non-negotiable. Coinbase can stay for the crypto use case — the two MCP servers compose cleanly.

Step 1: Verify the lab agent runs

Open the project from the Google Skills lab and confirm it still works:

cd ~/currency-agent
adk web

The ADK web UI opens at http://localhost:8000. Ask "What's the price of Bitcoin?" — it should call the Coinbase MCP and return a number. Stop the server (Ctrl+C) before continuing.

Step 2: Add the Exchange Rate API MCP server

Open agent.py (the file the lab had you edit when adding the Coinbase tool). It will look roughly like this:

from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioServerParameters

root_agent = LlmAgent(
    model="gemini-2.0-flash",
    name="currency_agent",
    description="Agent that answers questions about currency prices.",
    instruction="Use the tools available to look up prices and exchange rates.",
    tools=[
        MCPToolset(
            connection_params=StdioServerParameters(
                command="npx",
                args=["-y", "@coinbase/mcp"],
            ),
        ),
    ],
)

Add a second MCPToolset entry for Exchange Rate API. The full file becomes:

import os
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioServerParameters

root_agent = LlmAgent(
    model="gemini-2.0-flash",
    name="currency_agent",
    description="Agent that answers questions about crypto and fiat currency prices.",
    instruction=(
        "Use the Coinbase tool for cryptocurrency prices (BTC, ETH, etc.). "
        "Use the Exchange Rate API tools for fiat currency conversions, "
        "historical rates, and any non-crypto currency question. "
        "Always cite the rate value you used."
    ),
    tools=[
        # Crypto via Coinbase (from the original lab)
        MCPToolset(
            connection_params=StdioServerParameters(
                command="npx",
                args=["-y", "@coinbase/mcp"],
            ),
        ),
        # Fiat via Exchange Rate API
        MCPToolset(
            connection_params=StdioServerParameters(
                command="npx",
                args=["-y", "@exchangerateapi/mcp-server"],
                env={
                    "EXCHANGE_RATE_API_KEY": os.environ["EXCHANGE_RATE_API_KEY"],
                },
            ),
        ),
    ],
)

Two things to note:

Step 3: Export your API key

In the same shell where you'll run adk web:

export EXCHANGE_RATE_API_KEY="era_live_your_key_here"

For Cloud Shell or persistent setups, add it to ~/.bashrc or your project's .env file (the ADK auto-loads .env from the agent directory).

Step 4: Run the agent

adk web

The first time the agent starts, npx downloads @exchangerateapi/mcp-server. Subsequent starts are instant. In the ADK web UI, the left panel should now show two MCP tool sources, with a combined total of 5–6 tools.

Try these prompts:

The four tools you just gained

ToolInputsWhat it returns
get_exchange_ratesource, targetLive mid-market rate between two ISO 4217 codes.
get_historical_ratessource, target, periodTime series: 1d (hourly), 7d, 30d (daily), 1y (weekly).
get_ratessource, target (csv), time, from, to, groupMulti-target rates with date ranges and aggregation.
list_currenciesAll 160+ supported currencies with metadata.

Production considerations

A few things to think about before shipping the agent past the demo stage.

1. Rate limits

The free tier gives you 300 requests/month, which is enough for testing. For production agents that make several tool calls per user turn, the paid plans start at €4.99/month for 5,000 requests. Set quota alerts in your dashboard.

2. Caching

Rates update every 60 seconds upstream. Wrapping your agent in a thin cache (e.g. Redis with 30–60 second TTL keyed on the currency pair) cuts API calls by an order of magnitude without changing the user experience.

3. Deploying to Vertex AI Agent Engine

Once you push your ADK agent to Vertex AI, the subprocess that runs npx @exchangerateapi/mcp-server still needs Node.js in the container. The base ADK image includes it. If you use a custom image, install Node 18+ in your Dockerfile.

4. Logging tool calls

Enable ADK's built-in tracing (adk web --trace) to see exactly which tool each user turn invoked, with arguments and returned values. Useful when debugging why the agent picked Coinbase instead of Exchange Rate API (almost always an instruction wording issue).

What about deploying without MCP?

You can skip MCP entirely and call our REST API directly from a custom function tool. The trade-off:

For most agents, MCP wins on reusability — the same server you wired into ADK can power your IDE assistant tomorrow.

Common errors

EXCHANGE_RATE_API_KEY is required on startup

The MCP server refuses to start without a key. Check echo $EXCHANGE_RATE_API_KEY in the same shell where you ran adk web. If empty, re-export it.

Gemini calls Coinbase for "EUR to USD"

Tighten the instruction field to make the routing explicit (the snippet above already does this). You can also rename the toolsets to give Gemini a clearer hint.

command not found: npx

Node.js isn't installed (or isn't on PATH). Run node --version; if missing, install Node 18+ from nodejs.org.

Next steps

  1. Get your free API key — takes 30 seconds.
  2. Drop the MCPToolset block above into your lab agent.
  3. Try the example prompts. Confirm fiat questions hit Exchange Rate API and crypto questions hit Coinbase.
  4. Open an issue on the MCP repo if you hit anything unexpected.

Add to your ADK agent in one line

npx -y @exchangerateapi/mcp-server

Ship an ADK agent with real fiat currency data

160+ currencies, mid-market rates from Reuters, free tier with no credit card.

Get Your Free API Key →

Related Articles