weather_mcp_server
1
Weather MCP Server is a weather query server implemented in TypeScript using the Model Context Protocol SDK. It features server creation, tool registration, and standardized response formats.
Weather MCP Server
基于@modelcontextprotocol/sdk实现的一个纯TS实现的天气查询MCP server
基本思路
- 使用 McpServer 类创建服务器实例
- 通过 server.tool() 注册工具
- 使用 zod 进行参数验证
- 返回标准化的响应格式
quick start
安装依赖
- npm run build
- npx @modelcontextprotocol/inspector node dist/index.js