Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Oracle · Agentic AI Foundations

MCP messages and transports

Agentic AI Foundations · Lesson 7 of 20 · 44:46

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Oracle Agentic AI Foundations Associate exam (1Z0-1157-26). In this lesson: JSON-RPC requests, responses, and notifications, the tools/list and tools/call methods, the stdio and Streamable HTTP transports, and the lifecycle of a connection, including what changed in the 2026-07-28 version of the protocol. Includes three original practice questions, with Fairhaven Furniture, a fictional furniture seller, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

What travels on the wire

When Fairhaven's agent discovers the tools of its orders server and calls one of them, messages go back and forth. Knowing their format, and how they travel, helps you debug a connection and choose where a server should run. And the exam asks about both.

JSON-RPC messages

Every MCP message uses JSON-RPC 2.0, a simple format for remote procedure calls, written in JSON. A request has an ID, a method, like tools/list, and parameters. A response carries the same ID, with either a result or an error. A notification has no ID, because it expects no answer. The ID is how a client matches each response to its request, even when several requests are waiting.

Tool methods

Two methods matter most for tools. With tools/list, the client asks the server for its tools, and gets each one's name, description, and input schema, written as JSON Schema. With tools/call, the client asks the server to run one tool, with its name and its arguments. The result comes back as content, for example text, and a tool that fails can say so in its result, so the model sees the error and can try something else. Resources and prompts follow the same pattern, with methods like resources/read and prompts/get.

Two transports

MCP messages travel over a transport, and the specification defines two. With standard input and output, stdio for short, the client launches the server as a local subprocess, and they exchange newline-delimited messages through the process's input and output; the server can write logs to standard error, but nothing else to its output. With Streamable HTTP, the server runs independently, often remotely, and the client sends each message as an HTTP POST; the server can answer with a single JSON response, or stream several messages. Streamable HTTP arrived in the March 2025 version of the protocol, and replaced the older transport based on HTTP with server-sent events. So: stdio for a local tool on the same machine, and Streamable HTTP for a shared or remote server.

The lifecycle

Before any tool call, the client and the server must agree on a protocol version, and on what each one supports. The course describes the classic lifecycle: an initialize handshake, then normal operation, then shutdown. That's the flow that many servers still use, so know it for the exam. But the newest version of MCP, from July 2026, removes the handshake: each request carries its version and capabilities, and a client can ask a server what it supports with a discover request. A client that also talks to older servers falls back to initialize when they need it.

Recap

Let's recap. MCP messages use JSON-RPC 2.0: requests with an ID, a method, and parameters, responses with the same ID, and notifications with no ID. tools/list returns each tool's name, description, and input schema, and tools/call runs a tool with its arguments. stdio launches a local server as a subprocess, and Streamable HTTP reaches an independent, often remote server. The classic lifecycle starts with an initialize handshake, and the newest version of MCP replaces it with version information on every request.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Fairhaven’s agent sends two requests to the orders server at the same time, and two responses come back. How does the client know which response answers which request?

    • By the order in which they arrive
    • By the ID, the same in both messages
    • By the method name in each response
    • By a notification sent after each one
    Show the answer

    By the ID, the same in both messages

    A response carries the same ID as its request, which is how the client matches them. “By the order in which they arrive” is not reliable, because responses can come back in any order. “By the method name in each response” is wrong: the method is in the request, while the response holds a result or an error. And “By a notification sent after each one” is not how it works: notifications have no ID, and expect no answer.

  2. Fairhaven’s warehouse team runs one MCP server that agents in three offices must share over the network. Which transport fits?

    • stdio, launched by each agent
    • stdio, with logs on standard error
    • JSON-RPC notifications only
    • Streamable HTTP, over the network
    Show the answer

    Streamable HTTP, over the network

    Streamable HTTP lets an independent, remote server receive messages as HTTP posts, from clients in any office. “stdio, launched by each agent” would start a separate local process for each agent, so there would be no shared server. “stdio, with logs on standard error” is about logging: standard error is where a stdio server can write its logs. And “JSON-RPC notifications only” is a kind of message, not a transport, and notifications expect no answer.

  3. In the classic MCP lifecycle, what happens before the client sends its first tool call to a server?

    • An initialize handshake
    • A shutdown of the last session
    • A notification from the model
    • A read of every resource
    Show the answer

    An initialize handshake

    In the classic lifecycle, the client and the server first exchange initialize messages, to agree on a protocol version and on capabilities. “A shutdown of the last session” would end a session, not start one. “A notification from the model” is not part of MCP: the model talks to the host, not to the server. And “A read of every resource” is not required, because resources are read only when the application needs them.