weather-mcp-server-js
🌤️ Weather MCP Server (Node.js)
Node.js / Express 기반으로 구현된 원격 MCP(Model Context Protocol) 서버입니다.
Streamable HTTP transport를 통해 get_weather 도구를 노출하여, Claude Code 등 MCP 클라이언트가 어떤 도시의 현재 날씨를 실시간으로 조회할 수 있습니다.
날씨 데이터는 wttr.in에서 제공됩니다 — 무료, 회원가입 불필요, API key 불필요.
✨ 기능 특징
🛰️ 원격 MCP 서비스: 공식
@modelcontextprotocol/sdk기반으로 Streamable HTTP 전송을 구현하며, JSON 및 SSE 두 가지 응답 모드를 지원합니다.🌆 전 세계 도시 지원: 도시 이름(예:
Beijing,Tokyo,Paris)을 직접 전달하여 해당 지역의 날씨를 조회할 수 있습니다.🔌 완전한 세션 관리:
Mcp-Session-Id를 자동 생성/검증하며, 세션의 생성, 재사용, 종료(DELETE)를 지원합니다.🧩 단일 파일로 즉시 사용: 데이터베이스 불필요, 설정 파일 0개,
server.js하나로 시작할 수 있습니다.
Related MCP server: MCP Weather Server — Demo
📦 환경 요구 사항
Node.js ≥ 18(내장
fetch포함, 추가 의존성 불필요)
🚀 빠른 시작
# 1. 安装依赖
npm install
# 2. 启动服务(默认端口 3000)
npm start
# 后台运行(日志写入 logs/server.log)
npm run start:bg시작에 성공하면 서비스 주소는 다음과 같습니다:
http://localhost:3000/mcp자주 사용하는 스크립트
命令 | 说明 |
| 서비스를 포그라운드로 시작 |
| 백그라운드로 시작, 로그는 |
| 개발 모드, 파일 변경 시 자동 재시작 |
| 3000 포트 서비스 실행 여부 확인 |
| 로그 실시간 확인 |
| 서비스 중지 |
| 서비스 재시작 |
| 백그라운드로 재시작 |
🔌 MCP 클라이언트 구성
Claude Code 또는 Streamable HTTP를 지원하는 다른 MCP 클라이언트에서 서비스를 원격 MCP 서버로 등록합니다.
Claude Code
MCP 서버 목록을 통해 추가(/mcp → 추가 → HTTP):
{
"type": "http",
"url": "http://localhost:3000/mcp"
}JSON 설정 파일 방식
{
"mcpServers": {
"weather": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}🧰 제공되는 도구
get_weather
지정된 도시의 현재 날씨를 가져옵니다.
매개변수
参数 | 类型 | 必填 | 说明 |
| string | ✅ | 도시 이름, 예: |
반환 예시
当前 Beijing 的天气是晴(Sunny),温度 28°C(体感 30°C),湿度 45%,风速 12 km/h。⚙️ 구현 설명
세션 격리: 각 세션은 독립적인
Server+transport인스턴스를 보유하며(SDK의connect()는 하나의 transport만 지원),Mcp-Session-Id요청 헤더로 연결됩니다.새 세션 흐름:
Mcp-Session-Id가 없는 POST는 초기화 요청으로 간주되며, 서버가 세션 ID를 생성하여Mcp-Session-Id응답 헤더로 반환합니다(CORS의exposedHeaders를 통해 브라우저 클라이언트에 명시적으로 노출).호환성 처리: 세션 ID가 없는 GET SSE 프로브 요청은 404/400을 반환하는 대신 열린 SSE 스트림을 유지하여, Claude Code 등 클라이언트가 POST 초기화 흐름을 계속 진행할 수 있게 합니다.
안정적인 오류 반환: 날씨 API 호출 실패 시 전체 요청을 중단시키는 대신
isError: true결과를 반환합니다.
🗂️ 프로젝트 구조
.
├── server.js # 全部服务逻辑(单文件)
├── package.json # 项目配置与脚本
├── logs/ # 运行时日志(已被 .gitignore 忽略)
└── LICENSE # MIT 许可证📄 License
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
The official Model Context Protocol server for Ambee. It gives any MCP-compatible AI assistant — Claude, ChatGPT, Cursor, VS Code, Ollama, and more direct access to live air quality, pollen, and weather data. To get started, including information on signing up and obtaining your Ambee key, check out the Ambee documentation on https://docs.ambeedata.com
Related MCP Servers
- FlicenseBqualityDmaintenanceA simple MCP server that provides a tool to fetch current weather information for cities using the Open-Meteo API, communicating through stdin/stdout.12-
- AlicenseNot gradedqualityDmaintenanceDemo MCP server that provides weather data for cities, with tools to get weather and list available cities.2MIT
- AlicenseAqualityDmaintenanceMCP server that provides current weather for any city using Open-Meteo APIs. It exposes a single tool 'get_weather' returning temperature, humidity, wind, and other weather data.19 npmMIT
- AlicenseAqualityDmaintenanceA simple MCP server that exposes a get_weather tool to fetch real-time weather for any GPS coordinates using the Open-Meteo API, no API key required.112 npmISC