An incident-desk MCP server with a fixed resource, two resource templates, a prompt, a tool that borrows the client's model (sampling) and a tool that asks the operator to approve a restart (elicitation). Driven by a plain SDK client in JUnit and by raw curl, so the JSON-RPC for both server-to-client requests is committed. Also captured: a client that declared neither capability (a gated tool degrades, an ungated one returns an isError result), a slow client hitting the server request timeout, and protocol=STATELESS silently dropping every tool that takes McpSyncRequestContext (one WARN line, an empty tools/list). Negotiated protocol version is 2025-11-25; the 2026-07-28 spec is not implemented by SDK 2.1.0. No docs/ folder. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b5jAFLJrmUXmbo5EuV
22 lines
1.1 KiB
Markdown
22 lines
1.1 KiB
Markdown
# mcp-advanced
|
|
|
|
The half of MCP beyond tools: **resources**, **prompts**, **sampling** and **elicitation**, on Spring Boot 4.1.2, Spring AI 2.0.2 and MCP Java SDK 2.1.0 (Java 25). The server is an "incident desk"; the tests drive it with a plain MCP SDK client so the transcripts show what is on the wire.
|
|
|
|
| Piece | File |
|
|
|---|---|
|
|
| Resources + a template | `src/main/java/com/ankurm/mcpadvanced/IncidentResources.java` |
|
|
| Prompt | `.../IncidentPrompts.java` |
|
|
| Tools that call back into the client (sampling, elicitation) | `.../IncidentTools.java`, `.../RestartApproval.java` |
|
|
| Test client + transcript writer | `src/test/java/com/ankurm/mcpadvanced/` |
|
|
|
|
## Run
|
|
|
|
```bash
|
|
./scripts/run-all.sh # tests (they write output/01..09) + curl wire demo (output/10, 11)
|
|
mvn spring-boot:run # the server on :8089/mcp
|
|
```
|
|
|
|
`output/` holds the captured results the article quotes. Request and session ids in the two wire transcripts change on every run; the one timing line in `07` is indicative only.
|
|
|
|
There is deliberately no `docs/` folder: the explanation lives in the article, in collapsible sections next to the code it describes.
|