MCP.so
ログイン
サーバー

MCP 天气预报服务器

@Le-dawn

An MCP server for China weather queries based on the 高德 API.

概要

What is MCP 天气预报服务器?

MCP 天气预报服务器 is a Model Context Protocol (MCP) server built with TypeScript that provides weather information for Chinese cities via the Amap (Gaode Maps) API. It is designed for AI assistants and applications that need real-time weather data or multi-day forecasts.

How to use MCP 天气预报服务器?

Install dependencies (npm install), build the project (npm run build), and start the server (npm start or npm run dev). Set the environment variable AMAP_API_KEY with a valid Amap Web Service API key. The server exposes a single tool get-weather-forecast which accepts cityName, date, and forecastType parameters. Configure your MCP client to point to the built index.js file and pass the API key in the environment.

Key features of MCP 天气预报服务器

  • Real-time weather query for any Chinese city
  • Multi-day weather forecast (up to several days)
  • Intelligent city name to code conversion (supports standard Chinese municipal names)
  • Optional timezone parameter for forecast dates
  • Detailed weather data: temperature, humidity, wind direction, wind force
  • Comprehensive error handling and user-friendly output formatting

Use cases of MCP 天气预报服务器

  • An AI travel assistant providing current weather conditions for a user's destination city
  • A schedule planner that checks the forecast for an upcoming event date
  • A smart home system that adjusts settings based on local weather predictions
  • A chatbot that answers "What's the weather like in Shanghai today?"

FAQ from MCP 天气预报服务器

What are the system requirements for MCP 天气预报服务器?

Node.js 16.0 or higher and TypeScript 5.0 or higher are required.

How do I obtain an Amap API key?

Register an account on the Amap Open Platform (https://lbs.amap.com/), go to Console → Application Management → My Applications, create a new application selecting "Web service" type, and get the API key.

Does the server have any API call limits?

Yes. Amap's free developer account has a daily limit of 5,000 API calls.

What city name format should I use?

Use standard Chinese municipal names such as "北京市" (Beijing city). Avoid abbreviations.

How is the API key secured?

The API key is read from the environment variable AMAP_API_KEY and is never passed in the tool call, keeping it out of logs and client code.

タグ

「メディアとデザイン」の他のコンテンツ