Skip to content

Chore/mcp restlet transport#308

Merged
eskenazit merged 4 commits intomainfrom
chore/mcp-restlet-transport
Apr 14, 2026
Merged

Chore/mcp restlet transport#308
eskenazit merged 4 commits intomainfrom
chore/mcp-restlet-transport

Conversation

@jlouvel
Copy link
Copy Markdown
Contributor

@jlouvel jlouvel commented Apr 11, 2026

What does this PR do?

Migrates the MCP server adapter HTTP transport from raw Jetty Handler.Abstract to the Restlet ServerResource pattern, unifying all exposes adapters (REST, Skill, MCP) on the same transport layer.

Key changes:

  • McpServerResource — new Restlet ServerResource implementing POST (JSON-RPC dispatch), DELETE (session termination), and GET (405 rejection)
  • McpServerAdapterinitHttpTransport() now uses org.restlet.Server + Router instead of Jetty Server + ServerConnector
  • ServerAdapter — factored the common Restlet Server lifecycle (initServer, getServer, start, stop) into the base class, removing duplication across REST, Skill, and MCP adapters
  • Removed JettyStreamableHandler, JettyStreamableHandlerTest, and jetty-server / jetty-http2-common dependencies from pom.xml

No protocol changes — ProtocolDispatcher, ToolHandler, ResourceHandler, PromptHandler, and StdioJsonRpcHandler are untouched.


Tests

  • McpServerResourceTest (new, 8 tests) — GET returns 405, empty body returns parse error, malformed JSON returns parse error, initialize returns Mcp-Session-Id header, notifications/initialized returns 202, DELETE with session returns 200, DELETE without session returns 200, unknown RPC method returns -32601, bad JSON-RPC version returns -32600
  • All 85 MCP-related tests pass (integration + unit)
  • Full suite: 465 tests pass, 0 failures, 0 errors

Checklist

  • CI is green (build, tests, schema validation, security scans)
  • Rebased on latest main
  • Small and focused — one concern per PR
  • Commit messages follow Conventional Commits

Agent Context (optional)

agent_name: GitHub Copilot
llm: Claude Opus 4.6
tool: VS Code Chat
confidence: high
source_event: blueprints/mcp-restlet-transport.md
discovery_method: code_review
review_focus: McpServerResource.java, McpServerAdapter.java, ServerAdapter.java

@jlouvel jlouvel requested a review from eskenazit April 11, 2026 20:26
@jlouvel jlouvel self-assigned this Apr 11, 2026
@jlouvel jlouvel added the enhancement New feature or request label Apr 11, 2026
Copy link
Copy Markdown
Contributor

@eskenazit eskenazit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor thing : if the branch is chore, all commits are expected to be chores, otherwise the branch should be a feat/ or fix/ ;)

@jlouvel
Copy link
Copy Markdown
Contributor Author

jlouvel commented Apr 13, 2026

@eskenazit Coud you review again?

Would you consider this PR a feature? I saw it as a refactoring, not adding any functional value, setting the technical stage for the other PR

@jlouvel jlouvel force-pushed the chore/mcp-restlet-transport branch from 22e64b2 to 9fdee47 Compare April 13, 2026 18:04
@eskenazit
Copy link
Copy Markdown
Contributor

Definitely a chore in my book, so all commits messages should be chore =)

jlouvel added 4 commits April 14, 2026 09:55
Migrate the MCP server adapter from raw Jetty Handler.Abstract to the
Restlet ServerResource pattern, unifying all exposes adapters on the
same HTTP transport layer.

- Create McpServerResource (Restlet ServerResource for MCP Streamable HTTP)
- Rewrite McpServerAdapter.initHttpTransport to use Restlet Server/Router
- Pull shared Server lifecycle into ServerAdapter base class (initServer,
  getServer, start, stop) and simplify REST, Skill, and MCP adapters
- Remove JettyStreamableHandler and its test
- Add McpServerResourceTest with 8 focused tests (GET 405, empty body,
  malformed JSON, initialize session, notifications 202, DELETE with/without
  session, unknown RPC method, bad JSON-RPC version)
- Remove jetty-server and jetty-http2-common dependencies from pom.xml
@eskenazit eskenazit force-pushed the chore/mcp-restlet-transport branch from 9fdee47 to ba484fe Compare April 14, 2026 07:55
Copy link
Copy Markdown
Contributor

@eskenazit eskenazit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eskenazit eskenazit merged commit f1005ab into main Apr 14, 2026
3 checks passed
@eskenazit eskenazit deleted the chore/mcp-restlet-transport branch April 14, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants