[Examples][Tests] Make the MCP Apps example work over HTTP, and pin it (#439)
* [Examples][Tests] Make the MCP Apps example work over HTTP, and pin it It was the only example without a session store, so every request under `php -S` or php-fpm - each its own process - was answered "Session not found or has expired". It now uses a FileSessionStore like the others. Inspector snapshots pin what the extension actually puts on the wire: the ui:// resource's `text/html;profile=mcp-app` MIME type and `ui` marker, and the `_meta.ui` on the tool that links the two. * Apply suggestion from @chr-hertel * Apply suggestion from @chr-hertel
This commit is contained in:
parent
7407661260
commit
0751a83658
6 changed files with 130 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"prompts": []
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"resources": [
|
||||
{
|
||||
"name": "weather-app",
|
||||
"uri": "ui://weather-app",
|
||||
"description": "Interactive weather dashboard",
|
||||
"mimeType": "text/html;profile=mcp-app",
|
||||
"_meta": {
|
||||
"ui": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"resourceTemplates": []
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "Weather in london: 15°C, Cloudy, Humidity: 78%"
|
||||
}
|
||||
],
|
||||
"isError": false
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"tools": [
|
||||
{
|
||||
"name": "get_weather",
|
||||
"description": "Get current weather for a city",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"city": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"city"
|
||||
]
|
||||
},
|
||||
"_meta": {
|
||||
"ui": {
|
||||
"resourceUri": "ui://weather-app",
|
||||
"visibility": [
|
||||
"model",
|
||||
"app"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in a new issue