JVM Provides the Foundation for High-Throughput MCP Servers

▶ Watch (2:07)

Independent benchmarks rank the Java SDK first in latency and throughput among MCP servers. The JVM’s statically typed bytecode, JIT compilation, and garbage collection optimise hot paths. Java is used by 30% of engineers per Stack Overflow and by 90% of Fortune 500 companies. The SDK was contributed in late 2024 and is maintained by the Spring team.

Type Safety Prevents Erroneous States Without Conditional Logic

▶ Watch (7:42)

The team rejected an SPI approach because it required adding a library for a quick start. Instead, they built dedicated transport abstractions with strong type safety. Each transport produces a builder that exposes only valid operations. A stateless server builder, for example, does not allow client-side elicitation calls. Users cannot enter erroneous states, and implementation has no conditional logic. API breakages were accepted under a 0.x versioning scheme.

Transport Abstractions Evolve From Sessions to Stateless HTTP

▶ Watch (6:00)

MCP transports moved from stdio to SSE to streamable HTTP with sessions, and now to stateless HTTP. Stateless transports remove persistent connections, letting servers scale without session overhead. The SDK introduced stateless transport from the start, anticipating the spec shift. The team used dedicated implementations instead of adding features to a single abstraction, preventing implementation errors and erroneous client states.

Concurrency and Streaming Require Pragmatic Choices Across Java Versions

▶ Watch (12:24)

JSON RPC is inherently asynchronous, requiring request-response mapping across channels. Java threads were OS-backed until virtual threads (Project Loom) arrived in Java 21. The SDK targets Java 17 as the baseline because frameworks like Spring require it. Thread pinning fixed in Java 24, but the SDK must support older versions. For streaming, Java lacks high-level object channels; the SDK wraps a reactive core with synchronous APIs.

Extension Points Enable Framework Integration Without Duplicating Security

▶ Watch (16:34)

The SDK omits authorization and HTTP server abstractions to avoid CVE risks. Server-side context extractors pull headers from servlet requests into the MCP transport context. Client-side request customizers attach headers (e.g., authorization) to JDK HTTP client requests. JSON parsing is pluggable: core depends only on Jackson annotations; a separate module provides the actual parser, and frameworks like Micronaut can substitute their own.

Q&A

How can retry or circuit breakers be implemented in the MCP ecosystem? Depends on the stack; reactive operators for async, language constructs for sync, and library dependencies like Resilience4j for Spring require case-by-case configuration. ▶ Watch (23:11)

What’s keeping the Java SDK from being a tier one SDK? It still lags behind the latest spec from November; the plan is to implement new features and clean up JSON parsing. Tier 2 requirements are met within 6 months. ▶ Watch (25:26)

Does the SDK pass all conformance tests? It fully meets the November spec requirements but has a backlog for the latest spec. ▶ Watch (26:02)

Notable Quotes

Java is the the the the best uh performance uh ratio in terms of uh latency throughput while at the cost of some memory. Dariusz Jędrzejczyk · ▶ Watch (2:20)

that saves us from implementation errors and the best part of all is that users are unable to enter those erroneous states. Dariusz Jędrzejczyk · ▶ Watch (9:34)

I think it’s useful for other SDK designers as well to try to protect the users and the implementation by making undesired states impossible via type safety. Dariusz Jędrzejczyk · ▶ Watch (22:33)

Key Takeaways

  • Type-safe builders prevent erroneous states by exposing only valid operations per transport.
  • The SDK targets Java 17 baseline, using reactive core for streaming with sync wrappers.
  • Hooks for authorization and pluggable JSON parsing enable framework integration without duplicating security.

About the Speaker(s)

Dariusz Jędrzejczyk is a member of the Spring team, MCP Java SDK maintainer, and maintainer of Project Reactor. He contributes to Spring portfolio projects and has commercial experience in platform engineering, distributed systems, concurrency, system design, and networking.