An MCP Server for Your Service|INEMA.CLUB-PRO

In this lesson you will

  1. 1Host, client, transport, and server: who calls whom
  2. 2A tool is an action the model chooses; a resource is data the client reads; a prompt is a template the person chooses
  3. 3The current protocol revision is 2026-07-28, and what changed in it
  4. 4List the kit server's pieces in one command

Goal: tell a tool, a resource, and a prompt apart, and say who is the host, client, server, and transport in your service.

01From the app to your service

Click each block.

Click each block in the diagram to see what it does.

Split of control according to the official v2 SDK documentation (Tools, Resources, and Prompts pages), read on 10/19/2026.

02The three things a server offers

In the kit, a fictional course class service.

1. Tool

A function the model decides to call based on its name, description, and input schema. It can only read, or it can change something in the world.

In the kit: buscar_turmas (read-only) and reservar_vaga (has consequences).

Question that leads the model to call itIs there an MCP class with an open seat?

03Revision 2026-07-28: what changed on one screen

The current protocol version is 2026-07-28 (MCP versioning page, read on 10/19/2026). The previous one was 2025-11-25.

What changes the most for anyone coming from 2025: there is no more initialize handshake or session (Mcp-Session-Id); each request carries the version and capabilities in _meta; the client discovers the server with server/discover; and a server that needs to ask the user something returns input_required instead of opening its own request. Roots, Sampling, and Logging were deprecated.

The official SDK that implements this is the v2 line (@modelcontextprotocol/server and @modelcontextprotocol/client, 2.3.1, from 10/05/2026). The old @modelcontextprotocol/sdk package (1.32.1) still speaks 2025-11-25: it's what you'll find in most tutorials.

04List the pieces of the kit's server

You need the kit installed (lesson 2, first block). The client talks to the server in the same process, with no port.

Terminal · list
cd ~/projetos/formacao-webmcp-mcp-v72/kit
node listar.mjs; echo "saída: $?"
File · kit/listar.mjs
// listar.mjs — connects an MCP client to the classes server, in the same process (no port),
// and shows the anatomy: protocol era, tools, resources, and prompts.
import { Client, StreamableHTTPClientTransport } from '@modelcontextprotocol/client';
import { createMcpHandler } from '@modelcontextprotocol/server';
import { createServer } from './servidor.mjs';

const handler = createMcpHandler(createServer);
const transporte = new StreamableHTTPClientTransport(new URL('http://teste.local/mcp'), {
  fetch: (url, init) => handler.fetch(new Request(url, init))
});
// mode 'auto': asks server/discover; if the server is old, falls back to initialize.
const cliente = new Client({ name: 'listar', version: '1.0.0' }, { versionNegotiation: { mode: 'auto' } });
await cliente.connect(transporte);

const { tools } = await cliente.listTools();
const { resources } = await cliente.listResources();
const { prompts } = await cliente.listPrompts();
console.log(`era: ${cliente.getProtocolEra()}`);
for (const t of tools) console.log(`ferramenta: ${t.name} · readOnlyHint=${t.annotations?.readOnlyHint}`);
for (const r of resources) console.log(`recurso: ${r.uri}`);
for (const p of prompts) console.log(`prompt: ${p.name}`);
console.log(`${tools.length} ferramentas · ${resources.length} recurso · ${prompts.length} prompt`);

await cliente.close();
await handler.close();
Example from the repository
era: modern
ferramenta: buscar_turmas · readOnlyHint=true
ferramenta: reservar_vaga · readOnlyHint=false
recurso: turmas://catalogo
prompt: convite_turma
2 ferramentas · 1 recurso · 1 prompt
saída: 0

era: modern means the client and server agreed on revision 2026-07-28. With mode: 'legacy' (the v2 client's default) they would fall back to the 2025 initialize.

05Practice

Rehearsal in the kit and the map of your service.

E1 · See the pieces

5 min

Run the listar block after installing the kit (lesson 2, first block).

Done when: node listar.mjs → 2 ferramentas · 1 recurso · 1 prompt, with era: modern and saída: 0.

E2 · Your service in three columns

15 min

In a file named mapa-mcp.md, list what your service would expose as a tool, as a resource, and as a prompt. Mark each tool as read or consequence.

Done when: grep -c -E "leitura|consequência" mapa-mcp.md → at least 3.

06Lesson quiz

Question 1 of 4

Who decides to call an MCP tool?skill

07In three sentences

PiecesA host with a model, a client inside it, a transport, and your server.
PrimitivesTool (the model chooses), resource (the client reads), prompt (the person chooses).
Revision2026-07-28, with no initialize and no session; SDK v2 2.3.1 implements it.

Going further

Next lesson