Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AI Agents Meet the New MCP

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Zineb Bendhiba
November 04, 2026
32

AI Agents Meet the New MCP

The Model Context Protocol (MCP) quickly established itself as the open standard for connecting AI to enterprise systems. The 2026-07-28 specification introduces its largest revision. The protocol moves to a stateless core, removes sessions, and introduces new mechanisms for server-client interactions.

Quarkus MCP Server 2.0 fully embraces the new specification. In this talk, I will show how to build a Quarkus MCP server aligned with the latest protocol, and connect it to an AI agent powered by LangChain4j. Through live demos, you'll see an agent discover MCP tools at runtime, chain actions across enterprise systems, and act on the results. All through Quarkus.

Join me to explore how the new MCP, combined with Quarkus and LangChain4j, takes us from connecting AI to enterprise systems to building agents that act autonomously!

Zineb Bendhiba

November 04, 2026

Transcript

38 slides
  1. AI Agents Meet the New MCP MCP removed its sessions.

    Here is what that unlocks. Zineb Bendhiba — Devoxx Morocco, November 2026
  2. Zineb Bendhiba PRINCIPAL SOFTWARE ENGINEER @ IBM I build open

    source integration tools. Apache Camel PMC member Camel Quarkus and Quarkus Qdrant maintainer Camel AI and Camel LangChain4j zbendhiba @ZinebBendhiba @zinebbendhiba.com zbendhiba zineb.bendhiba zinebbendhiba.com
  3. One year ago One protocol. Many servers. One of them

    is yours. AI agent embeds an MCP client MCP GitHub MCP server Slack MCP server Postgres MCP server You install these. Files MCP server one protocol Drive MCP server Your business MCP server You write this one.
  4. The sessi o n wal l Streamable HTTP, 2025-11-25 and

    earlier 2. Mcp-Session-Id 3. every call, forever Instance 1 Client never 1. initialize Load balancer Instance 2 The session lives in one instance's heap. There was never a shared store to put it in. Your only option was session affinity, in your load balancer. Works fine with one instance. Fails intermittently under load. "Unknown session."
  5. The round tri p s, before Streamable HTTP, 2025-11-25 and

    earlier Client Server And after 2026-07-28 Client Server initialize server/discover InitializeResult + MCP-Session-Id, in an HTTP header supportedVersions, capabilities, serverInfo, ttlMs notifications/initialized optional, and cacheable tools/list + session header tools tools/call _meta: version, clientInfo, clientCapabilities tools/call + session header result + ttlMs + cacheScope result Client Client Server Server Three messages before any work. Then every call must carry the header back to that one instance. The client repeats itself on every request. The server publishes once, through server/discover , and lets you cache it.
  6. What actual l y travel s Before • • •

    // once, at the start { "method": "initialize", "params": { "protocolVersion": "2025-11-25", "capabilities": { "elicitation": {} }, "clientInfo": { "name": "agent" } } } And after No handshake at all • • • // optional, and cacheable { "method": "server/discover" } -> { "supportedVersions": [...], "capabilities": {...}, "ttlMs": 0, "cacheScope": "public" } <- Mcp-Session-Id: YzEyYzU5ZmMtODgx... • • • • // then, every call { "method": "tools/call", "params": { "name": "escalate" } } -> Mcp-Session-Id: YzEyYzU5ZmMtODgx... Who you are is said once. After that, a header stands in for it. • • // every call, self-contained { "method": "tools/call", "params": { "name": "escalate", "_meta": { ".../protocolVersion": "2026-07-28", ".../clientInfo": { "name": "agent" }, ".../clientCapabilities": { "elicitation": { "form": {} } } } } } Who you are travels every time, in _meta .
  7. What that buys Any client Load balancer Instance 1 Instance

    2 Instance 3 No shared state Any replica answers any request. Scale to zero. Restart mid-conversation. There is no session to lose.
  8. No sessi o n? Then cache. New in 2026-07-28, and

    not optional • • • { "tools": [ ... ], "ttlMs": 300000, "cacheScope": "public" } Every list and read result MUST now carry both. Without a session you re-ask for everything, so the spec had to say how long an answer is good for, and who may reuse it. public = any proxy, any user. private = same authorization context only.
  9. Quarkus MCP Server Quarkiverse extension. The 2.x line implements MCP

    2026-07-28. Extension Transport quarkus-mcp-server-http /mcp quarkus-mcp-server-stdio quarkus-mcp-server-websocket • • Streamable HTTP, /mcp/sse for old clients stdio, when a desktop client launches you WebSocket • // server/discover, one 2.0 server, one endpoint "supportedVersions": ["2026-07-28", "2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"] One endpoint, five protocol versions. The server works out per request whether this client wants a session.
  10. A tool is a method • • • public class

    BasicTools { } @Tool(description = "Converts the given text to lower case") String toLowerCase(@ToolArg(description = "The text to convert") String value) { return value.toLowerCase(); } No registration. No descriptor file. The class becomes a CDI bean, the method becomes a tool, and the JSON schema is generated from the signature.
  11. What the model actually reads • • • @Tool(description =

    "Lists the open support tickets owned by an employee id", annotations = @Tool.Annotations(readOnlyHint = true, destructiveHint = false)) String listOpenTickets(@ToolArg(description = "Employee id, e.g. E-1041") String employeeId) { ... } @Tool(description = "Escalates a support ticket to the on-call engineer", annotations = @Tool.Annotations(destructiveHint = true, idempotentHint = false)) String escalateTicket( @ToolArg(description = "Ticket id, e.g. T-8801") String ticketId, @ToolArg(description = "Why this ticket needs the on-call engineer") String reason) { ... } The descriptions are the API. They are all the model ever sees. And destructiveHint defaults to true: a tool is assumed destructive until you say otherwise.
  12. Demo 1 What is about to run server :8080 the

    same 5 tools MCP Inspector one URL Round robin no sticky sessions server :8083 the same 5 tools WHAT YOU WILL SEE Stateless: either replica answers. Restart one mid-conversation, nothing breaks. With a session: the other replica answers HTTP 404. The client starts over.
  13. What got removed Feature ping , initialize resources/subscribe SSE resumability,

    Last-Event-ID Sampling Roots Logging HTTP+SSE transport Elicitation Status Removed Removed Removed Deprecated Deprecated Deprecated Deprecated 2025-03-26 alive, and it grew Replaced by server/discover subscriptions/listen re-issue the request your LLM provider API tool parameters logLevel in _meta Streamable HTTP form mode + URL mode Deprecation is now a policy, not a vibe: Active, Deprecated, Removed, twelve-month floor. Asking the client did not die. Asking it for a model answer did.
  14. The server can no longer call And after you Also

    four messages. Before. Four messages. Client Client Server 1. tools/call Server 2. input_required + question 1. tools/call the server answers 2. elicitation/create 3. tools/call again + answer the server asks 4. tool result 3. the answer 4. tool result Client Client Server Server Message 2 is the server starting a conversation. Only possible while a connection stays open. Message 2 is the reply to message 1. The server never speaks first. So the client has to call again.
  15. The core got smal l e r Features moved out,

    into versioned extensions tools resources MCP core prompts moved out io.modelcontextprotocol/tasks moved out io.modelcontextprotocol/ui An agent that starts a ten-minute job needs Tasks. It is no longer in the core: it is an extension you declare, poll with tasks/get , and feed with tasks/update .
  16. Quarkus LangChai n 4j The other side. Now your app

    is the MCP client. WHAT YOU GET Your application Declarative clients @RegisterAiService CDI integration Observability (Otel, Prometheus) LangChain4j Guardrails the toolkit RAG building blocks Testability (mocks) The model local or remote MCP servers yours, and others Developer Joy
  17. The shape of an agent Two remote things. Your application

    is the only one talking to both. Your application @RegisterAiService THE RULE The model never calls a tool. LangChain4j the toolkit The model local or remote never It answers your application. Your application calls the tool. MCP servers yours, and others
  18. Codi n g the cl i e nt A URL

    in config. An annotation on an interface. That is the whole integration. 1. Point at the server • • 2. Ask for its tools • quarkus.langchain4j.mcp.helpdesk.transport-type=streamable-http quarkus.langchain4j.mcp.helpdesk.url=http://localhost:8080/mcp • • • @RegisterAiService public interface Assistant { } @McpToolBox("helpdesk") String chat(@UserMessage String q); helpdesk ties the two together. A name takes that one client. No name takes every configured one.
  19. What the agent actual l y does Quarkus LangChain4j, one

    question, four round trips You AI service Model MCP server "escalate her worst ticket" tools/list 5 tools + schemas loop [until the model stops asking] question + tools + results so far call this one tools/call result final answer one sentence You AI service You wrote @McpToolBox . Quarkus LangChain4j did all of that. Model MCP server
  20. Demo 2 What is about to run A web page

    HTML + JS Agent app MCP server LangChain4j @McpToolBox findEmployee listOpenTickets escalateTicket stateless asks A model running locally
  21. Behi n d the tool , i t i s

    j u st Java The tool is a door. It is not the room. • • • • @Singleton public class ClinicalTools { @Inject CardiacRisk risk; } @Tool(description = "Counts how many" + " well-known cardiac risk markers" + " appear in a list of conditions", annotations = @Tool.Annotations( readOnlyHint = true)) String countCardiacRiskFactors( @ToolArg(description = "The condition" + " text from listConditions") String conditions) { return risk.summarise(conditions); } • • @ApplicationScoped public class CardiacRisk { // your domain. no MCP, no AI, // no annotation from either. // as many classes as you need. } MCP stops at the method signature. Behind it, the application you already know how to write and already know how to test.
  22. Quarkus i s the runti m e Not just the

    AI parts. Best of breed libraries and standards, already integrated. the runtime 13 of several hundred extensions Hibernate PostgreSQL Kafka Keycloak Redis MongoDB Kubernetes OpenAPI OpenTelemetry Vert.x quarkus-langchain4j talks to the model quarkus-mcp-server exposes the tools Apache Camel talks to everything else Two extensions. Not the whole platform. A model is one more integration point. The same production concerns apply: observability, fault tolerance, security, transactions. And one of these is Camel.
  23. When i t i s i n tegrati o n,

    Camel 300+ components. The systems nobody wrote an MCP server for. the integration framework twenty years of retry logic THE PATTERNS Router Filter Splitter Aggregator Dead letter SAP Kafka RabbitMQ MQTT Cassandra Elasticsearch Splunk Jira Apache CXF FHIR content-based keep what matches one in, many out many in, one out when retries run out THE CONNECTORS integration framework where we are going Ten of 300+. The patterns come with all of them. Routing, transformation, retries, pagination, and a connector for the thing in the corner nobody wants to touch.
  24. What a Camel route i s A pipeline. One step

    per line. • • • from("ftp:partner/orders") .to("kafka:orders"); IN FTP a folder somewhere ANYTHING IN BETWEEN OUT Any steps Kafka transform, route, retry Something in. Something out. The middle is optional. a topic
  25. ACamelCamel route as an MCP tool 4.22. There is no

    tool class. Your application A Camel route from("ai-tool:...") Quarkus MCP server The route is the tool. No wrapper class. It shows up on tools/list by itself. its name, its description, its parameters
  26. Codi n g the tool One consumer URI. The route

    registers itself. • • • • from("ai-tool:listConditions" + "?tags=fhir" + "&description=Lists the active" + " medical conditions of one patient" + "&parameter.patientId=string" + "&readOnlyHint=true") // then the route you already had .to(SEARCH) .process(this::project); • • quarkus.camel.mcp-server.tags=fhir The route registers itself, with its name, its schema and its MCP hints. The bridge publishes everything tagged fhir , on the same endpoint as the plain @Tool methods.
  27. Now i t wri t es A guardrail protects the

    model. Not the data. • • • @RegisterAiService @InputGuardrails(PatternBasedPromptInjectionGuardrail.class) public interface WardAssistant { } @McpToolBox("fhir") String ask(@UserMessage String question); One annotation. OWASP LLM01 patterns, no model call. Prompt injection attempt detected , in 1 s. No chat model, no tool call, no write. Who can say no, and to what the question the arguments the write The agent proposes. It does not authorise. Two different jobs, in two different places. the agent, a guardrail the server, its schema the system that owns the data
  28. Demo 3 FHIR is how hospitals expose records. JSON over

    REST, one resource per fact. Agent app Tools app LangChain4j MCP client tools/list, tools/call asks A model local or remote 2 Camel routes 2 plain @Tool methods FHIR over REST HAPI FHIR
  29. MiYou gareratialreadyng,compatible step 1 • • • # nothing. no

    flag, no compatibility mode. # a 2.0 server speaks all five protocol versions on the same endpoint, at once. # a client that wants the old path just says so: quarkus.langchain4j.mcp.helpdesk.protocol-version=2025-11-25 Pinned to 2025-11-25 • • • connectionId=YjNkNGY1NDkt... transient=false Speaking 2026-07-28 • • • connectionId=transient/2 transient=true Same server. Same URL. Same minute. Upgrade the server first, then move clients one at a time.
  30. MiThe gdiffrating, step 2 • • • # the client

    transport - transport-type=http - url=http://srv:8080/mcp/sse + transport-type=streamable-http + url=http://srv:8080/mcp # your ingress - affinity: "cookie" - session-cookie-name: "MCP-SESSION" The build stops you on the first one. The second one is the whole point. • • • String escalate(String id, Elicitation e) { // PASS 2. The human answered. var got = e.inputResponses() .getElicitationResponse("confirm"); if (got != null) { return got.actionAccepted() ? "escalated to " + got.content().getString("team") : "cancelled by the user"; } // PASS 1. Hand the question back. throw e.inputRequired() .addElicitationRequest("confirm", e.requestBuilder() .setMessage("Page a human for " + id + "?") .build()) .setRequestState(id) .build(); } It runs twice, so it reads backwards. The throw is not an
  31. Also new. We did not get to these. Authorization OpenTelemetry

    subscriptions/listen x-mcp-header Structured output Icons More extensions What it is The server is an OAuth 2.1 Resource Server. RFC 9728 metadata is mandatory, so is the RFC 8707 resource parameter. Dynamic Client Registration is deprecated, use Client ID Metadata Documents. traceparent , tracestate and baggage travel in _meta . Your MCP calls join your existing traces. One long-lived request replaces resources/subscribe and the old GET stream. You filter what you want notified about. Mirror a tool argument into an Mcp-Param-* header, so a gateway can route or reject without parsing the body. inputSchema and outputSchema accept any JSON Schema 2020-12. structuredContent can be any JSON value. On tools, resources, prompts, and the server itself. MCP Apps ( io.modelcontextprotocol/ui ) and Skills over MCP. This revision is much bigger than "it went stateless".
  32. Precauti o ns Five, from building these demos. An MCP

    server on the open road. Put a gateway in front. One place that can say no. A server that calls back into the client. Sampling and roots are gone. Keep elicitation local. Autonomous writes. My app never asked who was writing. Every client gets every tool. Rights per tool. And read-only is not harmless. Arguments nobody verified. I handed it a fake id. FHIR said no, not my code.
  33. Thank you MCP removed its sessions so agents could scale.

    It removed half its server-to-client machinery too. Quarkus already ships all of it. Slides and code zinebbendhiba.com/talk/ai-agents-new-mcp github.com/zbendhiba/demo-ai-agents-new-mcp Zineb Bendhiba — Devoxx Morocco, November 2026
  34. Appendi x Links Demo code and the migration guide github.com/zbendhiba/demo-ai-agents-new-mcp

    MIGRATION.md, every step with its output The spec modelcontextprotocol.io/specification/2026-07-28/changelog modelcontextprotocol.io/specification/2026-07-28/deprecated Quarkus MCP Server github.com/quarkiverse/quarkus-mcp-server docs.quarkiverse.io/quarkus-mcp-server/2.0.x quarkus.io/blog/mcp-stateless The agent side docs.quarkiverse.io/quarkus-langchain4j/dev/mcp.html Camel routes as AI tools camel.apache.org/blog/2026/08/camel-ai-tools-mcp-422 camel.apache.org/components/4.22.x/ai-tool-component.html Guardrails, and what they do not cover docs.langchain4j.dev/tutorials/guardrails spiffe.io demo3/PRODUCTION-NOTES.md, in the demo repo Camel + FHIR