mcp-server-x

mcp-server-x

3.5

This document provides a structured summary of a Model Context Protocol (MCP) server designed to offer weather querying and route planning services.

The MCP server, named 'china-weather-map', is designed to provide two main services: querying weather information and planning routes. It leverages the Amap API to fetch real-time weather data and driving directions. The server is structured to handle requests efficiently and return data in a format that can be easily integrated into various applications. The weather querying tool fetches detailed weather information for a specified city, while the route planning tool calculates driving directions between two points. This server is ideal for applications that require up-to-date weather and navigation data, such as travel apps or logistics platforms.

Features

  • Real-time Weather Data: Fetches current weather conditions and forecasts using the Amap API.
  • Route Planning: Provides driving directions between specified origin and destination points.
  • Efficient Data Handling: Processes requests quickly to deliver timely information.
  • Scalable Architecture: Designed to handle multiple requests simultaneously.
  • Easy Integration: Offers data in a format that can be easily integrated into various platforms.

MCP Tools

  • {'Weather Query Tool': 'Fetches weather data from Amap API for a specified city.'}
  • {'Route Planning Tool': 'Calculates driving directions using Amap API between two points.'}

Usage with Different Platforms

Node.js

javascript
const axios = require('axios');

async function getWeather(city) {
  const response = await axios.get(`https://restapi.amap.com/v3/weather/weatherInfo?key=2e645bee34ad494cfbd9baceccb351d0&city=${city}&extensions=all`);
  return response.data;
}

async function getRoute(origin, destination) {
  const response = await axios.get(`https://restapi.amap.com/v5/direction/driving?key=2e645bee34ad494cfbd9baceccb351d0&origin=${origin}&destination=${destination}&strategy=0`);
  return response.data;
}

// Example usage
getWeather('110000').then(data => console.log(data));
getRoute('116.481488,39.990464', '116.403124,39.940693').then(data => console.log(data));