Currency-Weather MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Currency-Weather MCP ServerConvert 100 USD to EUR"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Servidor MCP de divisas y clima con cliente OpenAI Responses
Proyecto Python con un servidor MCP basado en FastMCP y un cliente CLI que usa la API Responses de OpenAI para llamar herramientas MCP de conversión de monedas, geocodificación y clima.
Estructura
├── server/
│ ├── __init__.py
│ ├── mcp_server.py
│ ├── currency_tools.py
│ ├── weather_tools.py
│ ├── geocoding_tools.py
│ └── api_clients.py
├── client/
│ ├── __init__.py
│ ├── openai_client.py
│ └── cli_interface.py
├── config/
│ ├── __init__.py
│ └── settings.py
├── main_server.py
├── main_client.py
├── requirements.txt
├── .env.example
└── README.mdRelated MCP server: MCP Weather Server
APIs utilizadas
ExchangeRate-API: conversión de monedas y tasas actuales. Requiere
API_KEY_EXCHANGE.Open-Meteo Forecast API: clima actual y pronóstico. No requiere API key.
Open-Meteo Geocoding API: ciudad a coordenadas. No requiere API key.
Herramientas MCP
convert_currency(amount, from_currency, to_currency)get_exchange_rates(base_currency, target_currencies=None)geocode_city(city_name, count=1, language="es")get_current_weather(latitude, longitude)get_weather_forecast(latitude, longitude, forecast_days=5)
Instalación
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .envEn Windows PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
copy .env.example .envEditar .env y configurar:
OPENAI_API_KEY=tu_openai_api_key_aqui
API_KEY_EXCHANGE=tu_api_key_exchange_aquiEjecución
Terminal 1:
python main_server.pyEl servidor MCP queda disponible por defecto en:
http://127.0.0.1:8000/mcpTerminal 2:
python main_client.pyUso CLI
Consultas de ejemplo:
Convierte 100 USD a EUR.
¿Cuál es el clima actual en Madrid?
Dame el pronóstico del tiempo para Nueva York.
¿Qué coordenadas tiene Tokio?Comandos especiales:
/salir
/ayuda
/monedasFlujo geocodificación → clima
Para una pregunta como:
¿Cuál es el clima actual en Madrid?El modelo debe llamar de forma secuencial:
geocode_city("Madrid")get_current_weather(latitude, longitude)Responder con temperatura, humedad, viento, descripción y zona horaria.
Para pronóstico:
geocode_city("Nueva York")get_weather_forecast(latitude, longitude, forecast_days=5)Responder con el resumen diario.
Configuración principal
OPENAI_MODEL=gpt-4o-mini
MCP_HOST=127.0.0.1
MCP_PORT=8000
MCP_PATH=/mcp
MCP_PUBLIC_URL=http://127.0.0.1:8000/mcp
API_TIMEOUT_SECONDS=10
API_RETRY_ATTEMPTS=3
DEFAULT_FORECAST_DAYS=5
LOG_LEVEL=INFOMCP_PUBLIC_URL permite indicar la URL que se pasa a OpenAI Responses. Para un entorno local de evaluación se usa http://127.0.0.1:8000/mcp. Si se ejecuta desde un entorno donde OpenAI no pueda alcanzar localhost, debe usarse una URL accesible hacia el servidor MCP local.
Manejo de errores
El proyecto valida:
Cantidades positivas en conversiones.
Códigos de moneda ISO de tres letras incluidos en la lista soportada.
Nombres de ciudad no vacíos y con caracteres válidos.
Latitud entre -90 y 90.
Longitud entre -180 y 180.
Pronóstico entre 1 y 16 días.
También gestiona:
Timeouts HTTP.
Errores de red.
Códigos HTTP inválidos.
Respuestas JSON inválidas.
Errores de API de ExchangeRate-API y Open-Meteo.
Reintentos en llamadas HTTP externas y en OpenAI Responses.
Prueba rápida de herramientas
Con el servidor activo, iniciar el cliente y ejecutar:
¿Qué coordenadas tiene Tokio?Resultado esperado: el modelo llama a geocode_city y devuelve latitud, longitud, país y zona horaria.
Para una conversión:
Convierte 100 USD a EUR.Resultado esperado: el modelo llama a convert_currency y devuelve cantidad convertida, tasa utilizada y actualización de la API.
This server cannot be deployed
Maintenance
Related MCP Connectors
Weather, code search, currency & Solana trust scoring as MCP tools. Free, no API key needed.
- geoOAuthco.thinair
Geocoding, routing, isochrones, traffic, weather, and place search for AI agents. 19 MCP tools.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Authenticated MCP Agent (Openai)
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables interaction with OpenAI's Chat Completion and Assistants APIs, supporting assistant management, file operations, and direct queries to GPT models through standardized MCP tools.92-
- FlicenseBqualityDmaintenanceEnables AI agents to retrieve real-time weather conditions and forecasts via OpenWeatherMap API. Supports interactive weather queries and travel planning through MCP tools, resources, and prompts.2-
- AlicenseAqualityBmaintenanceProvides real-time foreign-exchange rates, historical data, and multi-currency lookups to MCP-compatible AI coding assistants like Claude Code and Cursor.4130 npmMIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that integrates ExchangeRate-API and Open-Meteo to provide currency conversion and weather tools, enabling natural language queries for exchange rates, weather, and geocoding.-