Skip to content
Back to Agent systems and standards

Agent systems and standards · Chapter 1 of 8

MCP: tools from a server

How an agent finds and calls tools on an MCP server, and how the 2026-07-28 protocol asks a person before a risky call.

25 minutes0 of 4 goals done

Goals

  • Run the scenario until the refund is issued.To do
  • Answer the helpdesk's confirmation yourself.To do
  • Tamper with a message and see the real SDK reject it.To do
  • Pass the check.To do

Step 1 of 4: The read

Hosts, clients and servers

The Model Context Protocol (MCP) is an open standard for connecting AI applications to tools and data. The application, called the host, runs one MCP client per server it uses. A server offers tools (actions the model can call), resources (data the application can read) and prompts (templates a person can choose). Messages are JSON-RPC 2.0, over HTTP or over a local process's standard input and output (stdio).

In the agent from the previous path, tools were functions in your code. With MCP they live in a server that someone else can write and run, and any MCP host can use them.

What 2026-07-28 changed

This chapter uses protocol version 2026-07-28 with the official TypeScript SDK v2. You will see three changes on the wire.

Discovery: the client calls server/discover to learn the server's versions and capabilities. Servers on the 2025 versions answer initialize instead, and the SDK falls back to it.

A version on every request: each request carries its protocol version in _meta, so the server keeps no session, and any instance of it can answer any request.

Input required: when a tool needs a person's answer, the server ends the request with input_required, the question, and a signed requestState. The client asks the person, then calls the tool again with the answer and the same requestState. The server checks the signature, so the retry must match what the person saw.

Tools are a contract

The model sees only a tool's name, description and JSON Schema. Annotations such as readOnlyHint and destructiveHint are hints from the server: a client trusts them only as far as it trusts that server. The refund in this lab is safe because the server itself asks for a confirmation and checks it, not because the model behaves.

What you do here

Halden's support agent, a LangChain agent with the SDK's client, and Halden's helpdesk, the SDK's server, both run in this page. Run the scenario and answer the refund question yourself. Then turn on Intercept, hold a message and tamper with it: the real SDK code rejects it.

Step 2 of 4: Try it: The wire: an agent and an MCP helpdesk

The wire: an agent and an MCP helpdesk

Four steps, one action each, and an optional fifth. The diagram under the steps has one column per party and one row per message, in the order it is sent, from the top down.

Loading the visual…

Mode:RealSimulatedReal: the official MCP TypeScript SDK (v2, protocol 2026-07-28), client and server, runs in this page. Simulated: the agent's decisions are scripted unless you connect a model, and Halden's data is fictional.

Step 3 of 4: Check

Check

Question 1 of 4In MCP, who runs the client?

Next: Question 2 of 4

Question 2 of 4The helpdesk needs the support lead's OK before a refund. What does a 2026-07-28 server send?
Question 3 of 4On the retry, you raise the refund amount. Why does the server reject it?
Question 4 of 4A server marks a tool readOnlyHint: true. What should the client do?

Step 4 of 4: What you can do now

What you can do now

  • Describe an MCP host, client and server, and the three things a server offers.
  • Follow the 2026-07-28 flow: server/discover, tools/list, tools/call, input_required and the retry.
  • Explain why a signed requestState keeps a confirmation bound to what the person saw.
  • Treat tool annotations as hints, not guarantees.