Exchange Rate MCP Server
Provides current exchange rates for various currencies via the Model Context Protocol, allowing AI models to fetch real-time currency data.
README
Exchange Rate MCP Server (Python)
This is a Python implementation of a Model Context Protocol (MCP) server that provides current exchange rates from a reliable source.
Overview
This server implements the Model Context Protocol to provide real-time exchange rate data. It can be used by AI models to get up-to-date currency exchange information.
Features
- Provides current exchange rates for various currencies
- Configurable base currency (defaults to USD)
- Uses the exchangerate.host API as a data source
- Includes client examples and Ollama integration
Installation
# Clone the repository
git clone git@github.com:devshark/exchange-rate-mcp.git
cd exchange-rate-mcp
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy the example environment file and edit as needed
cp .env.example .env
Configuration
Edit the .env file to configure:
PORT: The port on which the server will run (default: 3000)EXCHANGE_API_KEY: Your API key for the exchange rate service (optional)
Note about API Keys:
- The server will work without an API key using free public APIs
- For testing purposes, you can leave the
EXCHANGE_API_KEYempty - If the API is unavailable, the server will fall back to mock data
Usage
Starting the Server
python server.py
The server will start on the port specified in your .env file (default: 3000).
Testing with the Client
python client.py
This will send a request to the MCP server and display the response.
Testing with Ollama Integration
First, make sure you have Ollama installed and the gemma3:27b model downloaded:
ollama pull gemma3:27b
Then run the Ollama client:
python ollama_client.py
This will:
- Fetch exchange rates from the MCP server
- Format them into a prompt
- Send the prompt to Ollama
- Display and save the response
API
The server exposes an MCP endpoint that accepts JSON-RPC 2.0 requests with the following methods:
listTools
Lists available tools on the server.
Example request:
{
"jsonrpc": "2.0",
"id": "1",
"method": "listTools",
"params": {}
}
callTool
Calls a specific tool with parameters.
Example request:
{
"jsonrpc": "2.0",
"id": "1",
"method": "callTool",
"params": {
"name": "exchange-rates",
"parameters": {
"base": "EUR",
"symbols": ["USD", "GBP", "JPY"]
}
}
}
Example response:
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"content": {
"base": "EUR",
"date": "2025-04-12",
"rates": {
"USD": 1.0923,
"GBP": 0.8578,
"JPY": 163.27
}
},
"metadata": {
"source": "exchange-rate-mcp",
"timestamp": "2025-04-12T12:25:30.123Z",
"baseCurrency": "EUR",
"symbols": "USD,GBP,JPY"
}
}
}
License
Author
© Anthony Lim
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.