Connect to an MCP serverYou initialize one negotiated MCP session over the transport that fits your deployment. Streamable HTTP is the normal current choice for a remote server.javaacademyacademy/topics/mcp-lifecycle-transportswebsite/content-src/academy/course.mjsacademyConnect to an MCP server
You initialize one negotiated MCP session over the transport that fits your deployment. Streamable HTTP is the normal current choice for a remote server.
AxMCPClient8 focused minutesNot started
Unit example (nearest native match)
See the idea in context
AxMCPClient mcp = new AxMCPClient(new AxMCPStreamableHTTPTransport(endpoint), Map.of("namespace", "inventory"));
AxMCPClient.CatalogSnapshot catalog = mcp.inspectCatalog();
AxGen program = new AxGen(Ax.s("request:string -> answer:string"), Map.of("mcp", mcp));
mcp.close();
Create the transport
Streamable HTTP connects the client to the remote URL.
Create one client session
AxMCPClient owns negotiation and the protocol lifecycle.
Use a namespace
orders keeps discovered names clear when several servers are attached.