天气
STDIO为Claude提供实时天气数据的MCP服务器
为Claude提供实时天气数据的MCP服务器
A ready-to-use implementation of the Model Context Protocol (MCP) that extends Claude with real-time weather data capabilities.
Model Context Protocol (MCP) is an open communication framework that allows AI models like Claude to interact with external tools. This enables Claude to access real-time data, process files, and interact with external services - capabilities not available to most LLMs out of the box.
Learn more about MCP:
This repository provides:
The MCP Weather Server implements two primary tools:
Once connected, Claude can:
Clone this repository:
git clone https://github.com/SterlingChin/mcp-weather-server.git cd mcp-weather-server
Install dependencies:
npm install
Build the project:
npm run build
Open your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%AppData%\Claude\claude_desktop_config.jsonAdd the following configuration (update the path to point to your repository):
{ "mcpServers": { "weather": { "command": "node", "args": [ "/absolute/path/to/your/mcp-weather-server/build/index.js" ] } } }
Restart Claude Desktop
Look for the hammer icon in Claude Desktop, indicating that MCP tools are available
Try asking Claude these questions:
├── src/
│   ├── index.ts           # Main server entry point
│   ├── tools/             # Tool implementations
│   │   ├── get-forecast.ts
│   │   └── get-alerts.ts
│   └── utils/             # Helper functions and API client
│       └── nws-api.ts
├── build/                 # Compiled JavaScript files
├── examples/              # Example code and usage patterns
├── docs/                  # Additional documentation
├── package.json
└── tsconfig.json
This repository can serve as a template for building your own MCP servers. Follow these steps:
src/tools directorysrc/index.tsFor detailed guidance, check out our step-by-step tutorial.
This server uses the National Weather Service API, which is free to use and doesn't require authentication. Other APIs you might consider integrating include:
When selecting APIs for your MCP server, consider:
~/Library/Logs/Claude/mcp*.logContributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ using the Model Context Protocol