@ttoss/http-server-mcp 0.33.0 → 0.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -594,6 +594,19 @@ The spec suggests checking the client's declared capability before registering U
|
|
|
594
594
|
|
|
595
595
|
Declaring it always is also strictly more compatible — a host without Apps support ignores `_meta` and renders the tool's `content`, which is the extension's own graceful-degradation contract. Keep every tool's text result meaningful on its own and the fallback takes care of itself.
|
|
596
596
|
|
|
597
|
+
### Writing the view
|
|
598
|
+
|
|
599
|
+
A view is plain HTML; a raw `postMessage` client is enough, no SDK needed. Tools generated from OpenAPI link to a view through [`toolMeta` and `toStructuredContent`](https://github.com/ttoss/ttoss/tree/main/packages/http-server-mcp-openapi#mcp-apps-views). The parts that only fail inside a host:
|
|
600
|
+
|
|
601
|
+
- **The view speaks first.** It sends `ui/initialize` (`appInfo`, `appCapabilities`, `protocolVersion`), then `ui/notifications/initialized`, and reads the result from `ui/notifications/tool-result` — `structuredContent` when the tool sets it, else the text.
|
|
602
|
+
- **Buttons call tools through the host** with `tools/call`, and the host may ask the person to confirm. `ui/notifications/tool-input` carries the original arguments, which is what a button needs to repeat or extend the call.
|
|
603
|
+
- **Fonts and scripts load only from origins in `ui.csp.resourceDomains`.** The host's default CSP is `font-src 'self'`, so a `data:` font is blocked.
|
|
604
|
+
- **Report size from `document.body`**, not `document.documentElement`: the document is never shorter than the iframe, so the view would grow but never shrink.
|
|
605
|
+
- **Set every value from a tool result with `textContent`.** It is data a model or a user produced.
|
|
606
|
+
- **Theme from `hostContext.theme`**, updated by `ui/notifications/host-context-changed`.
|
|
607
|
+
|
|
608
|
+
To see a view, render it in a host: ext-apps' `AppBridge` in a browser works, connected before the iframe's `srcdoc` is set because the view speaks first. An agent CLI such as Claude Code is an MCP client but not an Apps host, so it never renders one.
|
|
609
|
+
|
|
597
610
|
## Issuing tokens for MCP clients
|
|
598
611
|
|
|
599
612
|
The `auth` option above covers the **resource-server** half of MCP authorization — it verifies tokens issued by an external authorization server (Cognito, Auth0, …). To make your own first-party server _issue_ the tokens an MCP client runs the full OAuth flow against, add the [`@ttoss/http-server-auth`](https://ttoss.dev/docs/modules/packages/http-server-auth) plugin's `oauthServer()` and pair it with `createMcpRouter({ auth: { verifyToken } })` so one deployment both issues and verifies tokens. See the [OAuth Authorization Server](https://ttoss.dev/docs/engineering/guidelines/oauth-authorization-server) guideline.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/http-server-mcp",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.2",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server integration for @ttoss/http-server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@modelcontextprotocol/node": "^2.0.0",
|
|
38
38
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
39
39
|
"zod": "^4.4.3",
|
|
40
|
-
"@ttoss/
|
|
41
|
-
"@ttoss/http-server-auth": "^0.8.
|
|
42
|
-
"@ttoss/
|
|
43
|
-
"@ttoss/i18n-core": "^0.
|
|
40
|
+
"@ttoss/auth-core": "^0.16.1",
|
|
41
|
+
"@ttoss/http-server-auth": "^0.8.1",
|
|
42
|
+
"@ttoss/http-server": "^0.11.1",
|
|
43
|
+
"@ttoss/i18n-core": "^0.7.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@modelcontextprotocol/client": "^2.0.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"jest": "^30.4.2",
|
|
49
49
|
"supertest": "^7.2.2",
|
|
50
50
|
"tsdown": "^0.22.2",
|
|
51
|
-
"@ttoss/config": "^1.
|
|
51
|
+
"@ttoss/config": "^1.41.0"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public",
|