loading…
Search for a command to run...
loading…
A debug tool for platform developers to verify that their MCP App hosts correctly implement protocol specifications like context injection and message sending.
A debug tool for platform developers to verify that their MCP App hosts correctly implement protocol specifications like context injection and message sending. It provides a blind selection test to ensure seamless end-to-end communication between the UI, host, and model.
A debug tool for platform developers building MCP Apps hosts. Use this MCP server to verify that your platform correctly implements the ui/update-model-context and ui/message protocols defined in the MCP Apps Specification.
When building an MCP Apps host, you need to verify that:
ui/update-model-contextui/messageThis tool provides a simple "blind selection" test: the user picks a value in the UI, and the AI must correctly identify what was selected. If the AI knows the value, your platform is working. If not, something is broken in your ui/update-model-context implementation.
Install from npmjs.com/package/mcp-server-value-picker:
npm install -g mcp-server-value-picker
Run the server:
# Auto-detects transport mode
mcp-server-value-picker
# Force STDIO mode (for Claude Desktop)
mcp-server-value-picker --stdio
# Force HTTP mode
mcp-server-value-picker --http
Or run directly with npx (no install required):
npx mcp-server-value-picker
For modifying the example or contributing:
npm install
npm run build
npm start
Default HTTP endpoint: http://localhost:3456/mcp
pick_value tool, which displays 10 selectable values in the UIui/update-model-context with the selection detailsui/message asking "I have picked a value, can you tell me what it is?"The tool description explicitly tells the AI this is a debug test. A correct response looks like:
"You selected Alpha Protocol (id: alpha)."
If the AI elaborates extensively on the value meanings, the test still passed (context injection worked), but the AI didn't follow the debug instructions.
| Your Platform Must... | Protocol Message | Verified By |
|---|---|---|
| Inject UI context into model | ui/update-model-context |
AI knows selected value |
| Forward UI messages to conversation | ui/message |
AI receives follow-up prompt |
| Deliver tool results to UI | ui/notifications/tool-result |
UI renders value cards |
| Pass tool arguments to UI | ui/notifications/tool-input |
UI receives empty args |
| Handle teardown gracefully | ui/resource-teardown |
No errors on close |
| Feature | Spec Section |
|---|---|
text/html;profile=mcp-app MIME type |
UI Resource Format |
ui:// URI scheme |
UI Resource Format |
_meta.ui.resourceUri linkage |
Resource Discovery |
ui/initialize / ui/notifications/initialized |
Lifecycle |
ui/notifications/tool-input |
Data Passing |
ui/notifications/tool-result |
Data Passing |
ui/notifications/tool-cancelled |
Notifications |
ui/resource-teardown |
Cleanup |
ui/update-model-context |
Requests |
ui/message |
Requests |
ui/notifications/host-context-changed |
Notifications |
HostContext.theme |
Theming |
HostContext.styles.variables |
Theming |
HostContext.styles.css.fonts |
Custom Fonts |
HostContext.safeAreaInsets |
Container Dimensions |
content + structuredContent dual model |
Data Passing |
| File | Purpose |
|---|---|
server.ts |
MCP server with pick_value tool and UI resource |
src/mcp-app.ts |
View implementation (App class, handlers, context) |
src/mcp-app.css |
View styling with CSS variable fallbacks |
mcp-app.html |
HTML template with color-scheme meta tag |
main.ts |
Entry point with STDIO/HTTP transport selection |
registerAppTool(server, "pick_value", {
title: "Pick a Value",
description: "DEBUG/TEST TOOL: Tests MCP Apps communication between UI and model...",
inputSchema: {},
_meta: { ui: { resourceUri: "ui://pick-value/mcp-app.html" } },
}, async () => { /* handler */ });
return {
content: [{
type: "text",
text: `[MCP Apps Test] This is a debug tool...`,
}],
structuredContent: {
values: VALUES, // UI-only, not sent to model
},
};
await app.updateModelContext({
content: [{
type: "text",
text: `The user selected "${value.label}" (id: ${value.id}).`,
}],
});
await app.sendMessage({
role: "user",
content: [{
type: "text",
text: `I have picked a value, can you tell me what it is?`,
}],
});
app.onhostcontextchanged = (ctx) => {
if (ctx.theme) applyDocumentTheme(ctx.theme);
if (ctx.styles?.variables) applyHostStyleVariables(ctx.styles.variables);
if (ctx.styles?.css?.fonts) applyHostFonts(ctx.styles.css.fonts);
if (ctx.safeAreaInsets) { /* apply padding */ }
};
By Sebastian Whincop - https://github.com/MacJedi42
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-app-test-value-picker-server": {
"command": "npx",
"args": []
}
}
}