weather_mcp
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., "@weather_mcp what's the 7-day forecast for New York?"
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.
Прогноз погоды через MCP
Учебный проект: MCP-сервер ходит в публичный API Open-Meteo, консольный клиент спрашивает город (кириллицей или латиницей) и печатает прогноз на 7 дней.
Что такое MCP
MCP (Model Context Protocol) — открытый стандарт Anthropic (конец 2024). Коротко для собеседования: это «USB-C для ИИ». Один протокол, чтобы подключать к модели внешние системы (API, файлы, БД) без самописного плагина под каждый чат.
Три роли:
Host — приложение, в котором живёт модель (Cursor, Claude Desktop) или, как здесь, наше CLI.
Client — сторона, которая говорит с сервером по протоколу: handshake, список инструментов, вызов.
Server — процесс, который отдаёт инструменты. Он не чат и не модель, а розетка с функциями.
Три примитива протокола (в этом проекте только первый):
Tools — функции с JSON Schema аргументов. Методы
tools/listиtools/call. У нас этоget_forecast(city).Resources — данные «как файлы» по URI. Не используем.
Prompts — шаблоны промптов. Не используем.
Связь — JSON-RPC 2.0. Локально идёт по stdio: клиент запускает сервер как subprocess и пишет JSON-строки в его stdin. Поэтому сервер нельзя логировать через print() — это попадёт в тот же поток, что и протокол, и сломает его. Логи только в stderr (logging).
Чем этот проект отличается от Cursor
«Классический» хост — Cursor: модель сама решает, какой tool вызвать. Здесь хост — client.py: город вводит человек, клиент явно вызывает get_forecast. Протокол тот же, LLM нет. Так проще увидеть handshake, list_tools и call_tool без «магии модели».
«Зачем MCP, если есть REST?»
REST — как сервер разговаривает с Open-Meteo. MCP — как ИИ-приложение разговаривает с вашим сервером: единый каталог инструментов, схемы аргументов, один транспорт. Сервер пишете один раз — его могут вызвать Cursor, Claude Desktop или этот CLI.
Спецификация: modelcontextprotocol.io.
Related MCP server: Weather MCP Server
Как это устроено здесь
Вы запускаете клиент и вводите город (
МоскваилиMoscow).Клиент поднимает MCP-сервер по stdio и вызывает tool
get_forecast.Сервер ищет координаты в Geocoding API (кириллица →
language=ru, иначеen) и берёт 7 дней из Forecast API.Клиент печатает таблицу: дата, день недели, погода, мин/макс, осадки, ветер.
Ключ API не нужен.
Запуск
Нужны Python 3.10+ и uv.
cd Checking_weather_MCP
uv sync
uv run python -m weather_mcp.clientЕсли команда uv не находится, тот же CLI ставится через pip: py -m pip install uv, дальше py -m uv sync и py -m uv run python -m weather_mcp.client.
Появится приглашение Город:. После ввода — таблица на неделю.
Сервер отдельно обычно не запускают: без клиента он просто ждёт JSON-RPC на stdin. Если нужно вручную:
uv run python -m weather_mcp.serverAvailable Tools
1 toolget_forecastA
7-дневный прогноз по названию города (кириллица или латиница).
Inputs: city (required). Returns: city, days, country, latitude, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion or overlap. The single tool's purpose is clearly defined as a 7-day forecast by city name.
The tool name get_forecast follows a clear verb_noun convention that would be consistent with a broader weather toolset. However, with only one tool, the naming pattern is not fully demonstrable.
A single tool is far too few for a weather server, which typically requires current conditions, geocoding, unit preferences, and alerts. This feels like an extreme under-scoping of the domain.
The tool surface is severely incomplete for a weather service. It only provides a 7-day forecast, leaving out current weather, location search, weather alerts, and other common weather data operations.
Maintenance
Related MCP Connectors
Current weather and forecast lookup as an agent tool.
Global weather via Open-Meteo: forecast, historical, marine, air quality, geocoding, elevation.
Free, keyless real-time weather and 7-day forecasts for any city worldwide.
Weather forecast for any city, UV index, sunrise and sunset, pollen and air quality. Free, no key.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to fetch current weather conditions and forecasts for any city using the Open-Meteo API. Provides temperature, precipitation, and hourly forecast data through natural language queries.ISC
- AlicenseBqualityDmaintenanceEnables real-time weather queries for cities worldwide using Open-Meteo API. Provides 7-day forecasts with detailed information including temperature, wind, humidity, precipitation, and comfort level assessments in both Chinese and English.115 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides current weather and multi-day forecasts for any city using the Open-Meteo API, with natural language city names and optional forecast duration.-
- FlicenseNot gradedqualityDmaintenanceProvides weather forecast tools using Open-Meteo, enabling users to get current conditions, multi-day forecasts, and umbrella recommendations through natural language queries.-