fix: upgrade MCP SDK 0.12.1 → 1.1.2, fix Copilot compatibility, rewrite docs#8
Open
TuxLux40 wants to merge 2 commits into
Open
fix: upgrade MCP SDK 0.12.1 → 1.1.2, fix Copilot compatibility, rewrite docs#8TuxLux40 wants to merge 2 commits into
TuxLux40 wants to merge 2 commits into
Conversation
…eference Also fixes startup protocol ordering: tools now registered at build time via .tools() on the server builder instead of addTool() calls in run(), preventing tool-list-changed notifications from arriving before initialize. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot sends `"elicitation"` in ClientCapabilities, which SDK 0.12.1 hard-failed on (unknown field, not marked ignorable). 1.1.2 handles unknown capabilities gracefully. Breaking API changes in 1.1.2 migrated: - StdioServerTransport → StdioServerTransportProvider (takes McpJsonMapper) - AsyncToolRegistration → AsyncToolSpecification - Tool/CallToolResult direct constructors → builders - Tool handler: Function<Map> → BiFunction<McpAsyncServerExchange, CallToolRequest> - Bump compiler target 19 → 21 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Upgrades the MCP Java integration to the newer 1.1.2 SDK, adapts the server/bootstrap code to the new APIs, and rewrites the README so this Steam MCP server is easier to install and use with current MCP clients.
Changes:
- Migrates MCP SDK usage from the old monolithic dependency/API surface to
mcp-core+ Jackson 3 JSON support and the newer transport/tool registration types. - Registers tools during server construction instead of at runtime to avoid protocol-ordering problems during initialization.
- Expands the README with setup, tool reference, architecture, and development instructions.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/net/experimentalworks/SteamGamesServer.java |
Updates server construction, JSON mapper usage, tool registration, and tool result builders for the new MCP SDK. |
src/main/java/net/experimentalworks/App.java |
Switches the entrypoint to the new stdio transport provider and mapper setup. |
README.md |
Rewrites end-user and contributor documentation with install, architecture, and usage guidance. |
pom.xml |
Raises the Java target to 21 and replaces the old MCP dependency with the split 1.1.2 artifacts. |
dependency-reduced-pom.xml |
Refreshes generated reduced POM metadata to reflect the new compiler release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| stdin/stdout (MCP JSON-RPC) | ||
| │ | ||
| ▼ | ||
| StdioServerTransport ← MCP Java SDK 0.7.0 |
| Steam Web API (HTTPS) | ||
| ``` | ||
|
|
||
| The server is fully reactive: it never blocks a thread while waiting for Steam API responses. Tools are registered at build time (not dynamically added at runtime), which ensures the MCP handshake completes cleanly before any tool notifications are sent. |
|
|
||
| | Class | Role | | ||
| |---|---| | ||
| | `App` | Entry point. Creates `StdioServerTransport` and calls `server.run().block()`. | |
Comment on lines
+212
to
+218
| # initialize | ||
| echo '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | \ | ||
| STEAM_API_KEY=<key> STEAM_ID=<id> java -jar target/mcp-steam-1.0-SNAPSHOT.jar | ||
|
|
||
| # list tools (after initialized notification) | ||
| {"jsonrpc":"2.0","method":"notifications/initialized"} | ||
| {"jsonrpc":"2.0","method":"tools/list","id":2,"params":{}} |
| ## Contributing | ||
| | Artifact | Version | Purpose | | ||
| |---|---|---| | ||
| | `io.modelcontextprotocol.sdk:mcp` | 0.7.0 | MCP protocol implementation | |
| | `org.json:json` | 20250107 | JSON serialization | | ||
|
|
||
| Contributions are welcome! Please feel free to submit a Pull Request. | ||
| Build tooling: Java 19+, Maven 3.x, maven-shade-plugin (fat JAR), Spotless (formatting). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MCP error -32603when a client sends"elicitation"inClientCapabilities(added in a recent MCP spec revision). SDK 1.1.2 handles unknown capability fields gracefully.StdioServerTransport→StdioServerTransportProvider(now takesMcpJsonMapper)mcpartifact split intomcp-core+mcp-json-jackson3AsyncToolRegistration→AsyncToolSpecificationBiFunction<McpAsyncServerExchange, CallToolRequest, Mono<CallToolResult>>instead ofFunction<Map, Mono<CallToolResult>>ToolandCallToolResultdirect constructors replaced with buildersaddTool()was called insiderun(), which triggerednotifications/tools/list_changedbefore the client sentinitialize. Tools are now registered at build time via.tools()on the server builder.Test plan
initializewith no crash when"elicitation"is in client capabilitiestools/listreturns bothget-gamesandget-recent-gamesafter handshakemvn package🤖 Generated with Claude Code