Get the FREE Ultimate OpenClaw Setup Guide →

simple

示例,用极简代码,演示如何构建MCP Server。

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio guog-simple-mcp-server node build/index.js \
  --env GAODE_API_KEY="your_gaode_web_api_key" \
  --env DINGTALK_ACCESS_TOKEN="your_dingtalk_webhook_token"

How to use

This MCP server provides two integrated capabilities: a weather query service powered by the AMap (Gaode) Weather API, and a DingTalk group notification bridge. When used through an MCP-enabled client, the server can receive requests that include a location (e.g., a city or coordinates) and return current and forecast weather data, then pass relevant results back to the AI or client. Separately, the server can post formatted weather summaries or alerts to a configured DingTalk group via a webhook. The workflow illustrated in the project demonstrates an AI deciding to call the weather MCP, supplying the location details, retrieving the weather from Gaode, and returning a composed answer to the user, with the option to push messages to DingTalk when needed.

To use it in Cherry Studio or any MCP-enabled client, configure the MCP server with the provided command and environment variables, connect to the server, and ensure your chosen model supports Function Call features if you want the server to be invoked automatically by the AI for weather data or DingTalk updates.

How to install

Prerequisites:

  • Node.js 22+ installed on your system
  • pnpm package manager
  • Access to the internet to install dependencies

Steps:

  1. Clone the repository locally git clone https://github.com/your-organization/guog-simple-mcp-server.git cd guog-simple-mcp-server

  2. Install dependencies pnpm install

  3. Build the MCP server pnpm build

  4. Run or prepare for integration node build/index.js

Note: The README describes configuring Cherry Studio (or another MCP client) to run the server via the generated build/index.js path and to supply required environment variables.

Additional notes

Environment variables:

  • GAODE_API_KEY: Your Gaode Web API key (32-bit) for weather data retrieval.
  • DINGTALK_ACCESS_TOKEN: The 64-bit key portion from your DingTalk custom robot webhook.

Common issues and tips:

  • Ensure the Gaode API key is valid and has the Weather API enabled.
  • If the DingTalk webhook fails, double-check the token and that the custom robot is enabled in the target group.
  • When testing, use a model that supports Function Call to trigger MCP interactions automatically.
  • The MCP server expects requests that include location data (e.g., city name or coordinates) as part of the input payload; ensure the client sends the required fields.
  • If you modify the server path after build, update the Cherry Studio command path accordingly.

Related MCP Servers

Sponsor this space

Reach thousands of developers