Home Documentation Playground Pricing API Status Blog About FAQ Support

Add AllRatesToday to a Google ADK Agent with MCP

Reviewed by Madhushan, Fintech Developer — May 2026
AI agent connected to financial data tools

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 clean introduction to the Model Context Protocol — but Coinbase only covers crypto. The moment you want USD → EUR, INR → LKR, or any of the 150+ fiat pairs your users actually transact in, you need a different tool.

This guide walks through extending (not replacing) that lab agent with the @allratestoday/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.

What you'll build

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

Gemini picks the right tool based on the user's question. Crypto question → Coinbase. Fiat question → AllRatesToday. No code changes required to switch between them.

Prerequisites

Why extend with AllRatesToday?

Coinbase APIAllRatesToday
Crypto pairsYesNo
Fiat currenciesLimited (USD-quoted)150+, any base, any target
Historical dataSpot trades1d / 7d / 30d / 1y series
Data sourceCoinbase exchangeTier-1 financial providers
Update frequencyReal-time~60 seconds
AuthPublic for spotFree API key

For agents that handle invoices, travel budgets, e-commerce conversions, or any cross-border money flow, fiat coverage is non-negotiable. The two MCP servers compose cleanly — you don't have to pick one.

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 AllRatesToday MCP server

Open agent.py (the file the lab had you edit when adding the Coinbase tool). It looks 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 and tighten the instruction so Gemini knows which tool to pick:

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 AllRatesToday tools for fiat currency conversions, "
        "historical rates, and any non-crypto currency question. "
        "Always cite the rate value you used."
    ),
    tools=[
        # Crypto via Coinbase (kept from the original lab)
        MCPToolset(
            connection_params=StdioServerParameters(
                command="npx",
                args=["-y", "@coinbase/mcp"],
            ),
        ),
        # Fiat via AllRatesToday
        MCPToolset(
            connection_params=StdioServerParameters(
                command="npx",
                args=["-y", "@allratestoday/mcp-server"],
                env={
                    "ALLRATES_API_KEY": os.environ["ALLRATES_API_KEY"],
                },
            ),
        ),
    ],
)

Two things worth noting:

Step 3: Export your API key

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

export ALLRATES_API_KEY="art_live_your_key_here"

For Cloud Shell or persistent setups, add it to ~/.bashrc or a .env file in the agent directory (the ADK auto-loads .env).

Step 4: Run the agent

adk web

The first start downloads @allratestoday/mcp-server via npx. 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_rates_authenticatedsource, target (csv), optional time or groupMulti-target rates in one call with optional date / aggregation.
list_currenciesAll 150+ 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 is enough for testing. For production agents that make several tool calls per user turn, check the pricing page and 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 user experience.

3. Deploying to Vertex AI Agent Engine

Once you push your ADK agent to Vertex AI, the subprocess that runs npx @allratestoday/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 AllRatesToday (almost always an instruction wording issue).

What about calling the REST API directly?

You can skip MCP entirely and call our REST API 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

ALLRATES_API_KEY is required on startup

The MCP server refuses to start without a key. Check echo $ALLRATES_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 AllRatesToday and crypto questions hit Coinbase.
  4. Open an issue on the MCP repo if you hit anything unexpected.

Ship an ADK agent with real fiat currency data

150+ currencies, mid-market rates updated every 60 seconds. Free tier, no credit card.

Get your free API key

Related Articles