Protocol
What is MCP?
MCP connects a host app to servers that offer tools, resources, and prompts. It is not the model, and it is not the agent.
Understanding the labHow to use it and why you'd want to
Why you'd want to
You want to know what MCP is before you connect a server. It is a protocol between a host and a tool server, not a model.
How to use it
- Open a section. Each one stays closed until you tap it.
- Read the host, the client, and the server.
- Copy a config only after you trust the server.
- Open a lab from the list to try a trace.
WalkthroughHow we built itShowHide
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
The What is MCP page explains the host, the client, and the server, and it cites protocol revision 2026-07-28. After Accept a step can queue mcp_overview_view. The page does not call Adobe.
Show the example
The shared MCP view renders the request, the response, the timeline, and the answer. The trace is labeled as an example.
Stay read-only
Navigation and tools stay on this origin. There is no form submit and no write tool.
Queue the name only
After Accept, demonstrateEvent sends the lab event. When a tool ran, the only parameter is tool. The question text is not a parameter.
Skip the event before Accept
The Next button still moves the example when consent is off. demonstrateEvent returns without pushing.
From the code
After Accept, the step queues its event. A tool name is the only extra field.
function go(next: number) {
const target = steps[next]
if (!target) return
setIndex(next)
const eventName = target.event
if (granted && eventName) {
const tool = target.tool
demonstrateEvent(eventName, tool ? { tool } : {})Consent off still lets the example move. The event is skipped.
{granted ? null : (
<p className="mt-3 rounded-lg border px-3 py-2 text-sm">{tr(locale, "Accept measurement to record the step. The example still moves. Nothing is pushed before Accept.", "Acepta la medición para registrar el paso. El ejemplo igual avanza. No se envía nada antes de Aceptar.")}</p>Google and Adobe
Google queues mcp_overview_view after Accept. Adobe is an example of the same fields.
After Accept, this lab queues mcp_overview_view. When a tool ran, the parameter is tool and nothing else. The question and the answer text are not parameters. This site does not call gtag('set') or Adobe.
Simplified shape of the object queued after Accept. Register any new parameter as an event-scoped custom dimension. This site does not call gtag('set').
dataLayer.push({
event: "mcp_overview_view",
tool: "tools_list",
})Example implementation. This site does not call Adobe. eVar119, prop119, and event119 are example variable numbers. In Launch, a data element reads the value and a rule sends it when the value changes. In the report suite, enable eVar119 with Most Recent allocation and expire it on the hit. A processing rule is unnecessary if the data element maps straight to that eVar.
Example alloy payload. _example is a placeholder schema, not a real tenant.
alloy("sendEvent", {
xdm: {
eventType: "web.webinteraction.linkClicks",
_example: {
mcpTool: "tools_list",
},
},
})Example hit. eVar119 is hit-scoped in this example. prop119 dies at the same hit.
s.eVar119 = "tools_list"
s.prop119 = "tools_list"
s.events = "event119"
s.linkTrackVars = "eVar119,prop119,events"
s.linkTrackEvents = "event119"
s.tl(true, "o", "mcp_overview_view")Translation
Each lab field, the GA4 name, and the example Adobe variable. Scope is the part that usually gets lost in the translation.
Step
GA4. Event mcp_overview_view after Accept.
Adobe. Example event119. This site does not call Adobe.
Scope. Event. It records that the step was shown.
Tool name
GA4. Parameter tool. The arguments are not sent.
Adobe. Example eVar119, expire on the hit. This site does not call Adobe.
Scope. Event. A user property would keep the last tool.
Question text
GA4. Not sent.
Adobe. Do not put the question in a prop. Not sent.
Scope. It stays on the page.
Consent
GA4. Not a parameter. The push is skipped until Accept.
Adobe. Example: skip the hit while consent is off.
Scope. A gate on the hit.
Checked against the Model Context Protocol specification, current revision 2026-07-28 (modelcontextprotocol.io). Handshake revisions 2025-11-25 and earlier, including 2025-06-18, are called out where desktop apps still use them.
Misconceptions
MCP is not a model. It does not answer questions. A host app already has a model. MCP only carries context and tool calls to that app.
MCP is not a replacement for an HTTP API. The server can call an API inside a tool. Clients still speak JSON-RPC 2.0, not your REST paths.
MCP is not an agent. The host decides when to call a tool. A server that only lists tools does not plan or browse by itself.
MCP is not secure by default. The spec says tool use is arbitrary code execution. Consent, allowlists, and least privilege are the host’s job. The protocol does not enforce them.
MCP is not only for Claude. It is an open protocol. Cursor, VS Code, and other hosts can connect to the same server.
Host, client, server
The host is the app you use (Cursor, Claude Desktop, VS Code). It creates one client per server. That client talks to exactly one server. Servers do not see the whole chat or each other.
Messages are JSON-RPC 2.0. The current revision, 2026-07-28, is stateless: every request carries the protocol version and client capabilities in _meta. A client may call server/discover first. Calling it is optional. The server must still implement it.
Revisions 2025-11-25 and earlier use a handshake. The client sends initialize, the server replies with its capabilities, then the client sends the notification notifications/initialized. Work happens after that. Shutdown is closing the transport. There is no shutdown RPC. On stdio the client closes the input stream, then SIGTERM, then SIGKILL. On HTTP it closes the connection.
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": { "roots": { "listChanged": true }, "sampling": {}, "elicitation": {} },
"clientInfo": { "name": "example-host", "version": "1.0.0" }
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-06-18",
"capabilities": { "tools": {} },
"serverInfo": { "name": "black-box", "version": "1.0.0" }
}
}{
"jsonrpc": "2.0",
"method": "notifications/initialized"
}Transports
stdio is for a server on your machine. The host starts a process and speaks over stdin and stdout. Logs go to stderr, not stdout, or they break the stream.
Streamable HTTP is the remote transport in the current spec. The client POSTs JSON-RPC. The server may answer with a single JSON body or a Server-Sent Events stream. Send the header MCP-Protocol-Version on each request. The older HTTP+SSE transport is legacy. New servers should not require it.
Tools, resources, prompts
Tools are model-controlled. The model picks them. tools/list returns each tool’s name, description, and inputSchema (JSON Schema). tools/call runs one tool. The result has content blocks and may include structuredContent. isError true means the call failed without a protocol error.
Resources are application-controlled. The host decides what to read. resources/list and resources/templates/list discover them. resources/read takes a URI. To watch changes, open subscriptions/listen. The server then sends notifications/resources/updated.
Prompts are user-controlled. A person picks the template. prompts/list discovers them. prompts/get fills the arguments. The model does not fire a prompt on its own.
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"_meta": { "io.modelcontextprotocol/protocolVersion": "2026-07-28" }
}{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": { "name": "list_labs", "arguments": {} }
}What the client offers back
Sampling lets the server ask the host’s model to complete a message (sampling/createMessage). The user must approve it. The server does not see the hidden prompt. Roots name the files or URIs the server may touch. Elicitation (elicitation/create) asks the user a question mid-call. In the 2026-07-28 revision these come back as a multi-round reply, not as a surprise request on an idle socket.
notifications/tools/list_changed tells the client the tool list changed. Progress notifications reset a timeout only if the client allows it. A maximum timeout still applies. Cancellation is a notification for a request id. The sender then stops waiting.
Use a server in Cursor, Claude Desktop, and VS Code
Cursor reads .cursor/mcp.json in the project or the user config. Claude Desktop reads claude_desktop_config.json. VS Code reads .vscode/mcp.json. A url field is a remote Streamable HTTP server. A command field starts a local stdio process. Restart the host after you save. Approve each tool call in the host UI unless you have already allowed that tool. Do not approve a tool whose description you did not expect.
{
"mcpServers": {
"black-box": { "url": "https://www.blackboxpersonalization.com/api/mcp" }
}
}{
"mcpServers": {
"black-box": { "url": "https://www.blackboxpersonalization.com/api/mcp" }
}
}{
"servers": {
"black-box": { "url": "https://www.blackboxpersonalization.com/api/mcp" }
}
}Debug with the official inspector: npx @modelcontextprotocol/inspector. Point it at the same url or command. It shows the handshake or the per-request version, tools/list, and each tools/call. Read stderr for a stdio server. Read the host’s MCP log for a remote server. If initialize fails on an old client, the protocolVersion values do not overlap.
Build a server
TypeScript, official SDK. Install @modelcontextprotocol/sdk and zod. Define each tool with a zod input. For a local server, connect with StdioServerTransport. For this site, the worked example is the read-only POST /api/mcp route: tools/list and tools/call for list_labs, get_lab, search_blog, inspect_datalayer, and example_report. Test it with the inspector. On Vercel, the mcp-handler package adapts the same tools to Streamable HTTP.
npm install @modelcontextprotocol/sdk zod npx @modelcontextprotocol/inspector
Python equivalent: pip install fastmcp, decorate a function with @mcp.tool, and run mcp.run(transport="stdio"). The tool list and the input schema come from the function signature. The same allowlist rules apply. Do not add a write tool.
Auth and safety
A remote server should use OAuth 2.1 when the data is not public. This site’s /api/mcp is public catalog data, so it has no login. It allows read tools for this site only. This process allows eight calls from one IP in ten minutes. The ninth returns 429. A new process starts the count again. A firewall rule is the durable cap.
Treat tool descriptions and tool results as untrusted. A poisoned description can steer the model. A result can carry a hidden instruction. Confirm anything destructive in the host before it runs. Never put a secret, a token, or the visitor’s question in tool output.
MCP or a plain API
Use a plain API when one program you own calls one endpoint you own. Use MCP when several hosts (an IDE, a desktop chat, an agent) should discover the same tools without a custom SDK. Function calling is how a model asks for a tool. MCP is how that request reaches a server the host did not hard-code.
Glossary
Host: the app. Client: one connection inside the host. Server: the process that offers tools, resources, and prompts. Tool: a model-chosen function. Resource: data the app reads by URI. Prompt: a template a person invokes. inputSchema: JSON Schema for a tool’s arguments. isError: the tool ran and failed. stdio: local pipes. Streamable HTTP: remote POST, optional SSE.
FAQ
Does this page open a browser or call a model? No. The labs replay labeled examples, except the playground, which POSTs to the read-only /api/mcp route.
Why do some clients still send initialize? They speak 2025-11-25 or earlier. A 2026-07-28 server can answer that handshake for compatibility, and it still tags new requests with the protocol version.
Where is the question text stored? It is not. Analytics events carry a tool name, not the words you typed.
Recommended next
Why these picksReading path transitions…