Provides the HTTP server foundation for the MCP server, handling SSE connections and health check endpoints.
Manages the package dependencies for the MCP server with optimized installation and execution commands.
Enables type-safe development of the MCP server with features for ensuring data integrity across API interactions.
Handles runtime data validation for API requests and responses, ensuring data conforms to expected schemas.
Custom Context MCP Server
基于FastMCP框架的MCP服务器,支持SSE实时事件流和工具调用。
功能特性
- ✅ 基于FastMCP框架
- ✅ SSE实时事件流
- ✅ HTTP健康检查端点
- ✅ 支持mcp-inspector调试
- ✅ TypeScript类型安全
- ✅ 热重载开发模式
快速开始
安装依赖
开发模式
生产模式
调试指南
使用mcp-inspector调试
- 启动服务器:
- 访问mcp-inspector:
- 服务器启动后会自动打开mcp-inspector界面
- 或者手动访问:http://localhost:6274
- 测试工具:
- 在mcp-inspector中选择工具
- 输入参数并执行
- 查看实时结果
服务器端点
- SSE端点:
http://localhost:3005/sse
- 健康检查:
http://localhost:3005/health
- mcp-inspector:
http://localhost:6274
测试工具
group-text-by-json
text-to-json
项目结构
工具功能
1. group-text-by-json
根据JSON模板生成文本分组提示词,帮助AI将文本按模板结构分组。
2. text-to-json
将分组文本转换为JSON格式,基于原始模板结构。
开发指南
添加新工具
- 在
src/common/types.ts
中定义工具schema - 在
src/common/tools.ts
中实现工具逻辑 - 在
src/common/constants.ts
中添加工具名称 - 在
src/index.ts
中注册工具
调试技巧
- 查看日志: 服务器会输出详细的日志信息
- SSE连接: 可以通过浏览器访问SSE端点查看实时事件
- 健康检查: 访问健康检查端点确认服务器状态
- 热重载: 开发模式下支持代码热重载
常见问题
端口被占用
构建错误
依赖问题
技术栈
- FastMCP: MCP协议实现框架
- Express: HTTP服务器和中间件
- TypeScript: 类型安全
- SSE: 服务器发送事件
- Zod: 数据验证
许可证
ISC
This server cannot be installed
A FastMCP-based server that supports SSE real-time event streaming and tool calling, with features for text-to-JSON conversion and grouping text by JSON templates.
Related MCP Servers
- -securityAlicense-qualityA server that provides MySQL database operations through SSE (Server-Sent Events) based on the MCP (Model-Controller-Provider) framework, enabling real-time data transmission from MySQL databases.Last updated -67PythonMIT 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
- -securityFlicense-qualityA server for Model Context Protocol (MCP) that uses Server-Sent Events (SSE) for streaming communication, enabling tools like the HackerNews API to be accessed through a secure HTTP+SSE transport.Last updated -23TypeScript
- -securityFlicense-qualityA FastAPI server that implements the Model Context Protocol (MCP) using Server-Sent Events (SSE) transport to provide random cat facts on demand or as a continuous stream.Last updated -Python