Weather & Location Server
БесплатноНе проверенProvides weather and air quality information for cities using OpenWeather API.
Описание
Provides weather and air quality information for cities using OpenWeather API.
README
A beginner-friendly MCP server built with TypeScript, Node.js, the MCP TypeScript SDK, OpenWeather API, dotenv, and zod.
Features
getCurrentWeather(city)getForecast(city)getAirQuality(city)- Sunrise and sunset information
- Environment variable support with
dotenv - Input validation with
zod - TypeScript response types for API data
- Helpful error handling
Tech Stack
- TypeScript
- Node.js
@modelcontextprotocol/sdk- OpenWeather API
dotenvzod
Project Structure
weather-location-mcp-server/
|- src/
| |- index.ts
| |- weatherApi.ts
| `- types.ts
|- .env.example
|- .gitignore
|- package.json
|- README.md
`- tsconfig.json
Setup
1. Install dependencies
npm install
2. Create your environment file
Create a .env file in the project root:
OPENWEATHER_API_KEY=your_api_key_here
You can copy from .env.example and replace the placeholder value with your real OpenWeather API key.
3. Build the project
npm run build
Run the Server
Development mode
npm run dev
Production build
npm run build
npm run start
The server runs over stdio, so it will wait quietly for an MCP client to connect.
Available Tools
getCurrentWeather
Input:
{
"city": "Delhi"
}
Returns:
- City name
- Country
- Weather condition and description
- Temperature
- Feels-like temperature
- Humidity
- Sunrise time
- Sunset time
getForecast
Input:
{
"city": "Delhi"
}
Returns:
- City name
- Country
- First 5 forecast entries
- Temperature
- Weather condition and description
getAirQuality
Input:
{
"city": "Delhi"
}
Returns:
- AQI value
- AQI label
- CO
- NO2
- O3
- PM2.5
- PM10
Using with Codex
If you want Codex to use this server as an MCP tool provider, add a project config file at .codex/config.toml:
[mcp_servers.weather_location]
command = "node"
args = ["dist/index.js"]
cwd = "D:\\My PC\\Coding\\web development\\Weather & Location MCP Server"
enabled = true
startup_timeout_sec = 20
tool_timeout_sec = 60
Then restart Codex or open a new thread in the project.
Notes
- Keep
.envout of GitHub because it contains your API key. - Keep
.codex/out of GitHub if it contains your personal local Codex setup. - This project uses Node.js native
fetch.
License
ISC
Установка Weather & Location Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/Sousam2002/weather-location-mcp-serverFAQ
Weather & Location Server MCP бесплатный?
Да, Weather & Location Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Weather & Location Server?
Нет, Weather & Location Server работает без API-ключей и переменных окружения.
Weather & Location Server — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Weather & Location Server в Claude Desktop, Claude Code или Cursor?
Открой Weather & Location Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Weather & Location Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
