weather
mcp-weather-ts
TypeScript MCP-сервер, который предоставляет погоду в США из National Weather Service API таким хостам, как Cursor.
Хост запускает node build/index.js и общается по JSON-RPC через stdio. Модель никогда не вызывает NWS сама; она вызывает инструменты этого сервера (а также может читать ресурс или использовать промпт).
Как работает MCP (инструменты, ресурсы, промпты, транспорт): docs/create-mcp.readme.md.
Требования
Node.js 22+ (в этом репозитории используются ESM и
fetch)npm
Сетевой доступ к
https://api.weather.gov(только для локаций в США)
Related MCP server: weather
Настройка
npm install
npm run buildtsc записывает JavaScript в build/. Cursor должен запускать скомпилированный файл, а не src/index.ts.
Скрипты
Команда | Что делает |
| Компилирует |
| Смоук-тест NWS: |
Подключение в Cursor
Соберите проект (
npm run build).Добавьте
.cursor/mcp.jsonв этот проект:
{
"mcpServers": {
"weather": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/build/index.js"]
}
}
}Для всех проектов Cursor используйте %USERPROFILE%\.cursor\mcp.json и полный путь к build\index.js вместо ${workspaceFolder}.
Откройте Customize → MCP (или Cursor Settings → MCP) и включите weather.
После изменения
src/снова запуститеnpm run buildи выключите/включите сервер, чтобы Cursor перезапустил процесс.
Не используйте console.log после подключения сервера: stdout — это канал MCP. Для логов используйте console.error.
Что можно вызывать
Инструменты
Модель (или вы, через запрос в чате агента) вызывает их с помощью tools/call.
Имя | Входные данные | Что делает |
|
| Активные предупреждения для этого штата |
|
| Прогноз на 12 часов (NWS |
|
| Практика: |
Пример чата:
«Есть ли предупреждения о погоде для CA?»
«Прогноз для 39.7456, -97.0892»
Пример аргументов:
{ "state": "CA" }{ "latitude": 39.7456, "longitude": -97.0892 }Ресурс
Имя | URI | Что делает |
|
| Краткая статическая заметка об инструментах и процессе обращения к NWS |
Попросите агента прочитать weather://nws-guide или используйте resources/read в клиенте.
Промпт
Имя | Аргументы | Что делает |
|
| Шаблон пользовательского сообщения, который указывает модели использовать |
В Cursor выберите промпт Check weather и заполните place.
Структура проекта
src/index.ts Create McpServer, register, connect stdio
src/tools.ts get_alerts, get_forecast, test_tool
src/resources.ts weather://nws-guide
src/prompts.ts check_weather
src/weather-api-call.ts NWS fetch + types + alert formatting
src/createTransport.ts StdioServerTransport + connect
tests/weather-api-call.test.ts
docs/create-mcp.readme.md How to design MCP serversПорядок запуска в src/index.ts:
new McpServer({ name: "weather", version: "1.0.0" })registerWeatherTools/registerWeatherResources/registerWeatherPromptsconnectStdioTransport(server)
Заметки по NWS
Прогнозы находятся не по адресу
/points/{lat},{lon}/forecast. Загрузите/points/{lat},{lon}(четыре знака после запятой), затем перейдите поproperties.forecastилиproperties.forecastHourly.NWS требует заголовок
User-Agent(задан вweather-api-call.ts).Покрытие — США (и некоторые территории). Другие координаты часто не работают.
Устранение неполадок
Симптом | Что попробовать |
Сервер красный / нет инструментов | Пересоберите, убедитесь, что |
Не удаётся рукопожатие | Убедитесь, что вы подключаете ( |
Пустой или неудачный прогноз | Только координаты США; проверьте MCP Logs |
| Сбой сети / сбой NWS |
Cursor: Output → MCP Logs.
Лицензия
ISC
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceExposes tools for retrieving weather forecasts and alerts using the National Weather Service API.
- FlicenseCqualityCmaintenanceExposes US weather data as MCP tools, resources, and prompts via the National Weather Service API, enabling clients like Claude Desktop to get alerts, forecasts, and weather briefings.21
- FlicenseNot gradedqualityCmaintenanceThis MCP server provides tools to get current weather, forecasts, and weather alerts from the US National Weather Service via REST APIs, enabling AI agents to query live weather data.1
- FlicenseNot gradedqualityCmaintenanceEnables natural-language weather queries for U.S. states and coordinates, returning real-time alerts and forecasts from the National Weather Service API via MCP tools.
Related MCP Connectors
US weather, alerts, earthquakes and elevation for AI agents, from NWS/NOAA and USGS. No API keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Get US weather forecasts, active alerts, and current observations.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kingshuknandy2016/weather-mcp-ts'
If you have feedback or need assistance with the MCP directory API, please join our Discord server