Provides Git integration for project setup, allowing users to clone the MCP server repository using Git commands.
Supports JavaScript clients through browser-side integration examples, demonstrating how to establish SSE connections and invoke MCP tools from client-side JavaScript.
Enables MCP client-server communication with Node.js, providing examples for creating Node.js clients that can interact with the MCP server tools and receive real-time messages.
Integrates with npm for package management, dependency installation, and running scripts to start, develop, and test the MCP server.
MCP工具
一个使用HTTP SSE(Server-Sent Events)连接的MCP(Model Context Protocol)服务器实现。
🚀 特性
- ✅ 完整的MCP协议支持
- 🔄 实时SSE连接
- 🛠️ 内置实用工具(回显、时间、计算器、天气查询)
- 🌐 RESTful API接口
- 📊 健康检查端点
- 🔧 易于扩展的架构
- 🌤️ 支持真实天气API和模拟数据
📦 安装
🏃♂️ 运行
启动服务器
服务器将在 http://localhost:3000
启动。
运行测试
📡 API端点
基础信息
GET /
- 服务器信息GET /health
- 健康检查
MCP协议
POST /mcp
- MCP消息处理GET /sse
- SSE连接端点
🛠️ 内置工具
1. echo - 回显工具
2. get_current_time - 获取当前时间
3. calculate - 数学计算
4. get_weather - 天气查询
🔌 SSE连接
连接到SSE端点以接收实时消息:
📝 使用示例
Node.js客户端
浏览器客户端
🔧 扩展开发
添加新工具
- 在
src/server.js
的工具列表中添加新工具定义 - 在
CallToolRequestSchema
处理器中添加对应的处理逻辑
⚙️ 配置
天气API配置
要使用真实的天气数据,请配置 config/weather.json
:
- 访问 OpenWeatherMap 申请免费API key
- 编辑
config/weather.json
:
如果未配置真实API,系统将使用预设的模拟数据。
🌍 环境变量
PORT
- 服务器端口(默认: 3000)
📄 许可证
MIT
🤝 贡献
欢迎提交Issue和Pull Request!
📞 支持
如有问题,请创建Issue或联系维护者。
This server cannot be installed
An MCP (Model Context Protocol) server implementation using HTTP SSE (Server-Sent Events) connections with built-in utility tools including echo, time, calculator, and weather query functionality.
Related MCP Servers
- -securityFlicense-qualityThis SSE-based MCP server allows users to connect and interact with National Weather Service APIs to retrieve weather alerts and forecasts.Last updated -90Python
- -security-license-qualityA Model Context Protocol (MCP) server that interacts with system APIs, allowing users to check connections, search employees, register breakfast, and update chemical information by shifts.Last updated -2
- AsecurityAlicenseAqualityModel Context Protocol (MCP) server that provides weather forecast, warnings, water level associated with flood, and earthquake reports from Malaysia Government's Open API.Last updated -4PythonMIT License
- AsecurityFlicenseAqualityAn implementation of the Model Context Protocol (MCP) server using Server-Sent Events (SSE) for real-time communication, providing tools for calculations and dynamic resource templates.Last updated -1JavaScript