A read-only MCP server
This site exposes list_labs, get_lab, search_blog, inspect_datalayer, and example_report on POST /api/mcp. inspect_datalayer reads this browser's session when the playground passes the session id. The question is not logged.
Understanding the labHow to use it and why you'd want to
Why you'd want to
You want this site to answer tools/list from a host you already use. The route is public, read-only, and rate-limited.
How to use it
- Press Next to see tools/list and one call.
- Copy the config into Cursor or Claude Desktop.
- Restart the host and approve the tool.
- Open What is MCP for the build steps.
WalkthroughHow we built itShowHide
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
The MCP-ready lab shows the read-only POST /api/mcp route and the client config. After Accept it queues mcp_server_called with the tool name only. The question is not logged. The lab 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_server_called after Accept. Adobe is an example of the same fields.
After Accept, this lab queues mcp_server_called. 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_server_called",
tool: "list_labs",
})Example implementation. This site does not call Adobe. eVar122, prop122, and event122 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 eVar122 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: "list_labs",
},
},
})Example hit. eVar122 is hit-scoped in this example. prop122 dies at the same hit.
s.eVar122 = "list_labs"
s.prop122 = "list_labs"
s.events = "event122"
s.linkTrackVars = "eVar122,prop122,events"
s.linkTrackEvents = "event122"
s.tl(true, "o", "mcp_server_called")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_server_called after Accept.
Adobe. Example event122. 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 eVar122, 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.
Example session
Accept measurement to record the step. The example still moves. Nothing is pushed before Accept.
Connect
A host opens one client to POST /api/mcp. The route is read-only and rate-limited.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Response
{ "result": { "tools": ["list_labs", "get_lab", "search_blog", "inspect_datalayer", "example_report"] } }Client config
Paste this into .cursor/mcp.json or claude_desktop_config.json. VS Code uses .vscode/mcp.json with a servers object and the same url. Then restart the host and approve the tool.
{
"mcpServers": {
"black-box": { "url": "https://www.blackboxpersonalization.com/api/mcp" }
}
}Recommended next
Why these picksReading path transitions…