Weather MCP Server
날씨 MCP 서버
OpenAPI를 지원하는 날씨 데이터용 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 OpenWeatherMap API에서 날씨 정보를 제공하며 MCP를 통해 LLM 에이전트가 사용할 수 있습니다.
기능
LLM 에이전트 통합을 위한 MCP stdio 전송
OpenAPI 3.0 사양을 갖춘 HTTP REST API
4가지 날씨 도구:
도시별 현재 날씨 가져오기
좌표별 현재 날씨 가져오기
날씨 예보 가져오기 (5일, 3시간 간격)
기온 범위 요약 가져오기
API 키 없이 테스트할 수 있는 모의 데이터 지원
완전한 타입 안전성을 갖춘 TypeScript 구현
Related MCP server: mcp-openweather
설치
cd weather-mcp-server
npm install
npm run build사용법
1. MCP 서버 (stdio 전송)
LLM 에이전트를 위해 MCP 서버를 실행합니다:
npm start또는 개발 모드에서 실행:
npm run dev2. OpenAPI를 포함한 HTTP 서버
REST API와 함께 HTTP 서버를 실행합니다:
npm run dev:http서버는 http://localhost:3000에서 시작되며 다음을 제공합니다:
/health- 상태 확인 엔드포인트/openapi- OpenAPI 사양/api/v1/weather/current/{city}- 도시별 현재 날씨/api/v1/weather/current/coordinates- 좌표별 현재 날씨/api/v1/weather/forecast/{city}- 날씨 예보
3. 구성
OpenWeatherMap API 키를 설정합니다 (선택 사항 - 제공되지 않으면 모의 데이터가 사용됨):
export OPENWEATHER_API_KEY=your_api_key_here또는 .env 파일을 생성합니다:
OPENWEATHER_API_KEY=your_api_key_hereMCP 도구
서버는 다음과 같은 MCP 도구를 제공합니다:
도구 이름 | 설명 | 매개변수 |
| 도시별 현재 날씨 가져오기 |
|
| 좌표별 현재 날씨 가져오기 |
|
| 날씨 예보 가져오기 |
|
| 기온 범위 요약 가져오기 |
|
API 엔드포인트
HTTP REST API
모든 엔드포인트는 다음 구조의 JSON을 반환합니다:
{
"success": true,
"data": { ... }
}1. 도시별 현재 날씨
GET /api/v1/weather/current/{city}예시:
curl http://localhost:3000/api/v1/weather/current/London2. 좌표별 현재 날씨
GET /api/v1/weather/current/coordinates?lat={latitude}&lon={longitude}예시:
curl "http://localhost:3000/api/v1/weather/current/coordinates?lat=51.5074&lon=-0.1276"3. 날씨 예보
GET /api/v1/weather/forecast/{city}?days={days}예시:
curl "http://localhost:3000/api/v1/weather/forecast/New%20York?days=3"테스트
테스트 모음을 실행합니다:
npm test디버깅을 위해 MCP 인스펙터를 실행합니다:
npm run inspect프로젝트 구조
weather-mcp-server/
├── src/
│ ├── index.ts # MCP stdio server
│ ├── http-server.ts # HTTP server with OpenAPI
│ ├── types/
│ │ └── weather.ts # TypeScript types and Zod schemas
│ ├── utils/
│ │ └── weather-client.ts # OpenWeatherMap API client
│ └── tools/
│ └── weather-tools.ts # MCP tool definitions
├── dist/ # Compiled JavaScript
├── test/
│ └── test.js # Test suite
├── package.json
├── tsconfig.json
└── README.md의존성
@modelcontextprotocol/sdk- TypeScript용 MCP SDKexpress- HTTP 서버 프레임워크axios- API 호출용 HTTP 클라이언트zod- 스키마 유효성 검사typescript- TypeScript 컴파일러
라이선스
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
Weather, code search, currency & Solana trust scoring as MCP tools. Free, no API key needed.
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
OpenWeather data for AI agents: list feeds, sign up, check balance, get a top-up link, fetch data.
Related MCP Servers
- 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-
- AlicenseNot gradedqualityCmaintenanceWraps the OpenWeatherMap API to provide weather data through MCP, enabling AI agents to query current conditions, forecasts, and other weather information via natural language.5 npmMIT
- AlicenseNot gradedqualityCmaintenanceProvides weather data from WeatherAPI.com through MCP, enabling AI agents to query current conditions and forecasts via natural language.5 npmMIT
- FlicenseBqualityDmaintenanceProvides real-time weather information for cities worldwide using the OpenWeatherMap API, accessible through natural language queries via the MCP protocol.1-