AI agents (like Claude and ChatGPT) are powerful, but they often lack access to real-time data. If you ask an AI "What's the USD to UAH rate?", it might hallucinate a number or give you outdated data.
In this quick tutorial, I'll show you how to connect a real-time Currency Exchange API to your AI agent using MCP (Model Context Protocol).
What is MCP?
MCP is a standard that lets AI agents call external tools. Instead of giving the AI a huge context window, you give it a "tool" it can use when needed.
The API
We'll use a free API I built: https://currency-exchange-api.boring-saas-infra.workers.dev/rate?from=USD&to=UAH
It returns JSON like this:
json
{"success":true,"from":"USD","to":"UAH","rate":45.09}
The MCP Server
I've published an MCP server for this API on Glama. You can find it here: Currency Exchange MCP.
How to use it (with Claude Desktop)
Open your Claude Desktop config file (claude_desktop_config.json).
Add this block:
{
"mcpServers": {
"currency-exchange": {
"command": "npx",
"args": ["-y", "currency-exchange-mcp"]
}
}
}
Restart Claude.
Ask Claude: "What is the exchange rate from USD to UAH?"
Claude will now call your MCP server, which calls the API, and returns the real rate.
Try it yourself
All the code is open-source on GitHub. If you build something cool with it, let me know!
Top comments (0)