spring-demo-mcp-server-sse
A Spring Boot demo project for implementing Server-Sent Events (SSE) with an MCP (Message Control Protocol) server. Explore real-time data streaming and event-driven architecture in Java using this hands-on example.
Install / Use
claude mcp add kaifcoder -- npx -y github:kaifcoder/spring-demo-mcp-server-sseIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Tags
Our assessment of spring-demo-mcp-server-sse
spring-demo-mcp-server-sse scores 68/100 on our quality scale, 623rd of 690 AI & Machine Learning skills we index.
Its MCP Server is 4.7 KB long, well organised into 19 sections with 10 code examples: a solid amount of guidance for an agent.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 15 months ago. Expect some instructions to reference tool versions or APIs that have since changed.
- Our last check on 2026-09-12 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 68/100, with 3 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-25. Automated pattern scan on 2026-09-25. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
spring-demo-mcp-server-sse compared with similar skills
All 4 of these similar skills score higher than spring-demo-mcp-server-sse; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| spring-demo-mcp-server-sse (this skill)by kaifcoder | 68 | 3 | 15mo ago | MCP Server |
| claude-memby thedotmack | 100 | 94.7k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 85.5k | 10d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 84.2k | 14d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 73.8k | today | CLAUDE.md |
Frequently asked questions
- How do I install spring-demo-mcp-server-sse?
- Run
claude mcp add kaifcoder -- npx -y github:kaifcoder/spring-demo-mcp-server-sse. The install tabs above show the steps for each supported agent. - Which AI agents does spring-demo-mcp-server-sse work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is spring-demo-mcp-server-sse safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 68/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is spring-demo-mcp-server-sse still maintained?
- The repository was last updated about 15 months ago. Expect some instructions to reference tool versions or APIs that have since changed.
Skill content
View source on GitHubMCP Spring Boot Example with User Service
This project demonstrates how to build a simple Spring Boot API and expose it as both REST endpoints and Model Context Protocol (MCP) tools using Spring Boot and Spring AI MCP Server. The app now includes a UserService that is exposed as an MCP tool.
Table of Contents
- Features
- Requirements
- Setup
- Running the Application
- REST API Usage
- MCP Server Usage (SSE + JSON-RPC)
- Testing
- Development Notes
- Troubleshooting
Features
- UserService tool: get user details by user ID (REST and MCP)
- REST API endpoint for user details
- MCP server exposes user service as AI tool (usable by VS Code Copilot, etc.)
- Full test coverage with integration tests
Requirements
- Java 17+
- Maven 3.8+
- VS Code (optional, for MCP client testing)
- REST Client extension (optional, for
.httpfiles)
Setup
- Clone the repository:
git clone <your-repo-url> cd mcpdemo - Configure Git (optional):
git config user.name "<your-username>" git config user.email "<your-email>" - Build the project:
./mvnw clean install
Running the Application
Start the Spring Boot application:
./mvnw spring-boot:run
The server will start on http://localhost:8080.
REST API Usage
You can test the user endpoint using curl, Postman, or the provided .http file.
UserService Example request:
- Get user details:
Response:GET http://localhost:8080/api/users/123"User: 123, Name: John Doe"
MCP Server Usage (SSE + JSON-RPC)
The MCP server uses Server-Sent Events (SSE) for session-based communication and JSON-RPC over HTTP for sending messages. This allows you to receive asynchronous responses in a browser or SSE client while sending requests via POST.
1. Create a session using the SSE endpoint
Open your browser and navigate to:
http://localhost:8080/mcp/sse
A new session will be created and you will receive a response like:
id:8a09a074-ad2d-434d-a768-8e30f25a186b
event:endpoint
data:/mcp/messages?sessionId=8a09a074-ad2d-434d-a768-8e30f25a186b
- The
idis your session ID. - The
datafield gives you the correct messages endpoint for this session.
2. Send JSON-RPC messages using the messages endpoint
Use a tool like Bruno, Postman, or curl to send POST requests to:
http://localhost:8080/mcp/messages?sessionId=<your-session-id>
with a JSON body. For example, to initialize:
{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "warp",
"version": "1.0.0"
}
}
}
Then send:
{
"jsonrpc": "2.0",
"method": "notifications/initialized"
}
You can now send tool/list or tool/invoke requests as shown below. All responses will appear in the browser window (SSE session) you opened in step 1.
Example: List available tools
{
"jsonrpc": "2.0",
"id": "2",
"method": "tools/list",
"params": {}
}
Example: Invoke a tool
{
"jsonrpc": "2.0",
"id": "3",
"method": "tools/call",
"params": {
"name": "getUserDetailsMcp",
"arguments": {
"userId": "123"
}
}
}
Example response (will appear in SSE session)
{
"jsonrpc": "2.0",
"id": "3",
"result": "User: 123, Name: John Doe"
}
VS Code Integration
- Open VS Code and install an MCP-compatible extension (e.g., Copilot Chat).
- Set the MCP server URL to
http://localhost:8080/mcp/ssein the extension settings. - Use the extension's chat or tool features to call your user tool.
Testing
Run all tests with:
./mvnw test
All endpoints and MCP tools are covered by integration tests.
Development Notes
- User logic is in
UserService. - REST endpoint is in
UserController. - MCP tool registration is in
McpConfig. - MCP server configuration is in
src/main/resources/application.yaml.
Troubleshooting
- SessionId error: Always include a
sessionIdin MCP tool/completion requests. - Tool not visible in VS Code: Ensure the MCP server is running and the extension is pointed to the correct URL.
- Port conflicts: Change the port in
application.yamlif needed. - Logs: Enable TRACE logging in
application.yamlfor detailed MCP server logs.
License
Related Skills
claude-mem
94.7kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
85.5kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
84.2kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
73.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
