@tenuo/mcp 0.3.2-beta.0 → 0.3.4-beta.0
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 +10 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -48,8 +48,11 @@ Zod (or any host schema) is **valid**. `allow` is **allowed**, AND'd with the
|
|
|
48
48
|
warrant in Rust, and zero-trust: every argument must be named. `allow` is
|
|
49
49
|
stripped before `registerTool` so it is not advertised. Pass `nonceStore:
|
|
50
50
|
memoryNonceStore()` to reject an exact replayed PoP (opt-in, in-process only).
|
|
51
|
-
PoP v1 is replayable in-window, including approval-gated calls
|
|
52
|
-
`nonceStore
|
|
51
|
+
PoP v1 is replayable in-window, including approval-gated calls. With
|
|
52
|
+
`nonceStore`, an allowed call also consumes the approvals it carried, so a
|
|
53
|
+
fresh PoP cannot reuse them; pass it on a gated tool if approvals must be
|
|
54
|
+
one-use, with a TTL at least as long as an approval lives
|
|
55
|
+
(`memoryNonceStore({ ttlSeconds: 3600 })` for the one-hour default).
|
|
53
56
|
Tenuo denials become `{ isError: true }` with a JSON-RPC body. Handler
|
|
54
57
|
exceptions become `{ isError: true, content: [{ type: "text", text: "Tool execution failed" }] }`
|
|
55
58
|
— the official transport must not see thrown messages. Pass `onHandlerError`
|
|
@@ -58,6 +61,10 @@ are registered as `(ctx)` only, matching the official server. `guardHandler()`
|
|
|
58
61
|
without a schema returns that same `(ctx)` callback so a raw `registerTool`
|
|
59
62
|
wrap typechecks. `guardTools().register()` is the schema-typed path;
|
|
60
63
|
`guardHandler()` with a typed callback infers args from it.
|
|
64
|
+
`guardHandler(tenuo, name, ...)` enforces the authority for `name`, whatever
|
|
65
|
+
name you register it under: the official server does not tell a handler which
|
|
66
|
+
tool was called, so a mismatch cannot be detected at call time. Pass the same
|
|
67
|
+
name to `registerTool`, or use `guardTools().register()`, which binds both.
|
|
61
68
|
A nonce-store
|
|
62
69
|
failure returns the constant "Replay store unavailable"; pass
|
|
63
70
|
`onNonceStoreError` for the original cause. Unknown option keys, including
|
|
@@ -65,7 +72,7 @@ mixed typos like `{ allow, nonceStroe }`, throw at register time.
|
|
|
65
72
|
|
|
66
73
|
A minimal runnable version of the above, with an in-memory v2 client and
|
|
67
74
|
server, one allowed call, and one denied call, lives in
|
|
68
|
-
[`examples/v2`](examples/v2
|
|
75
|
+
[`examples/v2`](https://github.com/tenuo-ai/tenuo/tree/main/tenuo-ts/packages/mcp/examples/v2). From `tenuo-ts`: `pnpm example:mcp:v2`.
|
|
69
76
|
|
|
70
77
|
There is no FastMCP adapter and no v1 adapter package. For
|
|
71
78
|
`@modelcontextprotocol/sdk` v1, copy the recipe in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenuo/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4-beta.0",
|
|
4
4
|
"description": "Per-call, argument-level authorization for Model Context Protocol (MCP) servers: guard @modelcontextprotocol/server v2 tools with Tenuo warrants (beta).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Tenuo Contributors",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"typecheck": "tsc --noEmit",
|
|
51
51
|
"build": "tsc -p tsconfig.build.json && node scripts/copy-build-assets.mjs",
|
|
52
52
|
"pack:smoke": "node scripts/pack-smoke.mjs",
|
|
53
|
-
"publish:npm": "npm publish
|
|
53
|
+
"publish:npm": "node ../../scripts/npm-release-policy.mjs publish ."
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">=20"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
60
|
-
"@tenuo/core": ">=0.3.
|
|
60
|
+
"@tenuo/core": ">=0.3.4-beta.0 <0.3.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@modelcontextprotocol/client": "2.0.0",
|