loading…
Search for a command to run...
loading…
Provides current exchange rates for various currencies via the Model Context Protocol, allowing AI models to fetch real-time currency data.
Provides current exchange rates for various currencies via the Model Context Protocol, allowing AI models to fetch real-time currency data.
This is a Python implementation of a Model Context Protocol (MCP) server that provides current exchange rates from a reliable source.
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.
# Clone the repository
git clone [email protected]: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
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:
EXCHANGE_API_KEY emptypython server.py
The server will start on the port specified in your .env file (default: 3000).
python client.py
This will send a request to the MCP server and display the response.
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:
The server exposes an MCP endpoint that accepts JSON-RPC 2.0 requests with the following methods:
Lists available tools on the server.
Example request:
{
"jsonrpc": "2.0",
"id": "1",
"method": "listTools",
"params": {}
}
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"
}
}
}
© Anthony Lim
Выполни в терминале:
claude mcp add exchange-rate-mcp-server -- npx Web content fetching and conversion for efficient LLM usage.
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolProvides auto-configuration for setting up an MCP server in Spring Boot applications.
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai