Basic information
About 项目依赖 MCP Server
# 项目依赖
项目依赖 is a MCP server in the Other category listed in the AddMCP.net directory, published by AJobs-coding. Supported transport: stdio. Runtime: java. The repository has 1 GitHub stars. Source code is hosted on github.com.
项目依赖 MCP Server config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
项目依赖 MCP Server tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is 项目依赖?
项目依赖是一个基于 Spring AI 1.0.0-M7 的 MCP 服务器实现,针对 SSE 传输和会话管理提供了自定义增强。它解决了官方配置属性不生效、会话超时、内存泄漏以及客户端重启导致连接异常等问题,适用于需要长时间维持 SSE 连接的 MCP 服务场景。
How to use 项目依赖?
通过自定义代码重写 McpWebMvcSseServerTransportAutoConfiguration 和 WebMvcSseServerTransportProvider 类,并在配置中设置 sessionTimeOutSecond 属性(单位:秒)。客户端需在建立 SSE 连接时添加唯一标识(如 /sse?clientId=xxx),并实现轮询重连和优雅关闭 session 的机制。
Key features of 项目依赖
- 透传 SSE 的
sessionId到工具方法中 - 支持自定义 session 超时时间(单位:秒)
- 新增手动清除 session 的
MessageEnum消息类型 - 客户端唯一标识避免重启导致内存泄漏
- 服务端定时 ping 客户端以清理无效 session(默认关闭)
Use cases of 项目依赖
- 需要管理 MCP 客户端 SSE 会话生命周期的服务
- 解决 MCP 客户端重启后服务端内存泄漏问题
- 实现多机部署下 session 覆盖与清理
- 支持客户端优雅关闭 session 的 MCP 消息交互
Frequently asked questions
1 配置属性 `baseUrl` 和 `sseMessageEndpoint` 不生效怎么办?
重写 McpWebMvcSseServerTransportAutoConfiguration 和 WebMvcSseServerTransportProvider 类以手动处理这些配置。
2 如何实现 session 超时功能?
在 McpServerProperties 中新增 sessionTimeOutSecond 属性(单位:秒),并重写 WebMvcSseServerTransportProvider 的构造函数和 handleMessage 方法。
3 客户端重启后导致服务端内存泄漏如何解决?
客户端建立 SSE 连接时使用唯一标识(如 /sse?clientId=xxx),服务端据此覆盖旧 session。此外可启用定时 ping 任务(默认关闭)定期清理无效 session。
4 MCP 服务器重启后客户端应如何处理?
客户端需实现轮询重新构造 MCP 客户端对象,以应对 SSE 连接异常(如 404 或连接失败)。
5 如何让客户端优雅关闭 session?
客户端发送自定义 MCP 消息 sessionCloseGracefully(在 io.modelcontextprotocol.spec.McpSchema 中扩展),服务端收到后释放对应 session。
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In