Update MCP apps tutorial: fix _meta structure and version prereq (#6404)
This commit is contained in:
@@ -17,7 +17,7 @@ In this tutorial, you will build an MCP App using JavaScript and Node.js. The ap
|
|||||||
|
|
||||||
:::info Prerequisites
|
:::info Prerequisites
|
||||||
- Node.js 18+ installed
|
- Node.js 18+ installed
|
||||||
- goose Desktop application
|
- goose Desktop 1.19.1+ installed
|
||||||
:::
|
:::
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -62,6 +62,9 @@ Update your `package.json` to use ES modules by adding `"type": "module"`:
|
|||||||
|
|
||||||
Create `server.js` - this is the MCP server that loads and serves your HTML:
|
Create `server.js` - this is the MCP server that loads and serves your HTML:
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>server.js</summary>
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
@@ -126,7 +129,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||||||
],
|
],
|
||||||
// This metadata tells goose to render the MCP App
|
// This metadata tells goose to render the MCP App
|
||||||
_meta: {
|
_meta: {
|
||||||
"ui/resourceUri": "ui://mcp-app-demo/main",
|
ui: {
|
||||||
|
resourceUri: "ui://mcp-app-demo/main",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -186,6 +191,8 @@ async function main() {
|
|||||||
main().catch(console.error);
|
main().catch(console.error);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Step 3: Create the App HTML
|
## Step 3: Create the App HTML
|
||||||
|
|||||||
Reference in New Issue
Block a user