DipanBartaula/Currency-Exchange-MCP-Server
3.1
If you are the rightful owner of Currency-Exchange-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A currency exchange service that provides real-time exchange rates and lists supported currencies.
Currency Exchange Service
A currency exchange service that provides real-time exchange rates and lists supported currencies.
Features
- Get current exchange rates between any two supported currencies
- List all supported currencies
- Docker support for easy deployment
- SSE (Server-Sent Events) based communication
Prerequisites
- Python 3.11 or higher
- Docker (optional, for containerized deployment)
- Git
- Exchange Rate API key (get it from https://www.exchangerate-api.com/)
Installation
Using Docker (Recommended)
- Clone the repository:
git clone <repository-url>
cd <repository-name>
- Create a
.env
file as instructed in.env.example
in the project root:
# Get your API key from https://www.exchangerate-api.com/
- `EXCHANGE_RATE_API_KEY`: Your Exchange Rate API key
- `GROQ_API_KEY`: Your GROQ API key
- Build and start the Docker container:
docker compose up -d
Using Python directly
- Clone the repository:
git clone <repository-url>
cd <repository-name>
- Create a
.env
file in the project root:
# Get your API key from https://www.exchangerate-api.com/
EXCHANGE_RATE_API_KEY=your_api_key_here
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r mcpserver/requirements.txt
Usage
Using the Python Client
Run the client script to interact with the service:
python mcpserver/client-sse.py
This will:
- List all available tools
- Show an example exchange rate (INR to USD)
- Display a list of supported currencies
API Documentation
The service provides two main tools:
-
get_exchange_rate(from_currency, to_currency)
- Returns the current exchange rate between two currencies
- Example: Get USD to EUR rate
-
list_supported_currencies()
- Returns a list of all supported currencies
- Includes currency codes and names
Development
To modify the service:
- Make changes to
mcpserver/server.py
- Test using the client script
- Rebuild the Docker container if using Docker:
docker compose build --no-cache
docker compose up -d
Getting an API Key
- Visit https://www.exchangerate-api.com/
- Sign up for a free account
- Get your API key from the dashboard
- Add it to your
.env
file as shown in the installation steps