From 8ebac95d0732aae8fe661ab71982a166a36ea75e Mon Sep 17 00:00:00 2001 From: geobelsky Date: Sat, 21 Mar 2026 10:28:27 +0000 Subject: [PATCH] docs: add MCP section to README Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index f802686..671e776 100644 --- a/README.md +++ b/README.md @@ -327,6 +327,40 @@ Map profile = client.getUserProfile( --- +## MCP (Model Context Protocol) + +The Java SDK includes a built-in MCP endpoint client for gateway-hosted MCP sessions. + +```java +// Initialize an MCP session +Map init = client.mcpInitialize(RequestOptions.defaults()); +System.out.println(init.get("serverInfo")); + +// List available tools +Map tools = client.mcpListTools(RequestOptions.defaults()); +List toolList = (List) tools.get("tools"); +for (Object tool : toolList) { + Map t = (Map) tool; + System.out.println(t.get("name")); +} + +// Call a tool +Map result = client.mcpCallTool( + "create_intent", + Map.of( + "intent_type", "order.fulfillment.v1", + "payload", Map.of("order_id", "ord_123"), + "owner_agent", "agent://fulfillment-service" + ), + RequestOptions.defaults() +); +System.out.println(result); +``` + +By default the SDK posts to `/mcp`. Override with `mcpEndpointPath` in client options. + +--- + ## Repository Structure ```