@tinycloud/mcp 0.9.0-beta.4 → 0.9.0-beta.5
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 +88 -5
- package/dist/cli.cjs +35 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +35 -4
- package/dist/cli.js.map +1 -1
- package/dist/http-cli.cjs +38 -7
- package/dist/http-cli.cjs.map +1 -1
- package/dist/http-cli.js +38 -7
- package/dist/http-cli.js.map +1 -1
- package/dist/http.cjs +38 -7
- package/dist/http.cjs.map +1 -1
- package/dist/http.js +38 -7
- package/dist/http.js.map +1 -1
- package/dist/index.cjs +40 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -7
- package/dist/index.js.map +1 -1
- package/dist/results.cjs +15 -2
- package/dist/results.cjs.map +1 -1
- package/dist/results.js +15 -2
- package/dist/results.js.map +1 -1
- package/dist/server.cjs +35 -4
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +35 -4
- package/dist/server.js.map +1 -1
- package/dist/tools.cjs +35 -2
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +35 -2
- package/dist/tools.js.map +1 -1
- package/generated/mcp-facts.json +36 -0
- package/package.json +2 -2
- package/skills/tinycloud-delegated-secrets/SKILL.md +43 -8
package/dist/index.cjs
CHANGED
|
@@ -62,14 +62,27 @@ function toMcpToolResult(result, bindings = [], options = {}) {
|
|
|
62
62
|
serialized = JSON.stringify(canonical);
|
|
63
63
|
if ((options.readOnly === true || options.operationId === "tinycloud.apps.context" || options.operationId === "tinycloud.apps.query") && serialized.length > 1e5) {
|
|
64
64
|
const sql = options.operationId?.startsWith("tinycloud.sql.") || options.operationId === "tinycloud.apps.query";
|
|
65
|
+
const readTool = options.operationId === "tinycloud.kv.get" || options.operationId === "tinycloud.sql.query" ? bindings.find((binding) => binding.operationId === "tinycloud.read") : void 0;
|
|
65
66
|
canonical = {
|
|
66
67
|
status: "error",
|
|
67
68
|
operation: canonical.operation,
|
|
68
69
|
context: canonical.context,
|
|
69
70
|
error: {
|
|
70
71
|
code: sql ? "SQL_RESULT_LIMIT_EXCEEDED" : "KV_RESPONSE_TOO_LARGE",
|
|
71
|
-
message: sql ? "The result exceeds 100,000 characters. Select fewer columns or rows, add a WHERE filter or a smaller LIMIT, or aggregate the data." : "The result exceeds 100,000 characters. Request fewer keys, narrow the prefix, or use a smaller page size.",
|
|
72
|
-
retryable: false
|
|
72
|
+
message: readTool !== void 0 ? `The serialized result exceeds the hosted 100,000-character limit. Use ${readTool.name} with the original ${sql ? "SQL query and parameters" : "space and key"} as a ${sql ? "sql" : "kv"} resource for complete, digest-bound pages.` : options.operationId === "tinycloud.read" ? "The serialized page exceeds the hosted 100,000-character limit. Reduce pageBytes while retaining the same resource and expected binding." : sql ? "The result exceeds 100,000 characters. Select fewer columns or rows, add a WHERE filter or a smaller LIMIT, or aggregate the data." : "The result exceeds 100,000 characters. Request fewer keys, narrow the prefix, or use a smaller page size.",
|
|
73
|
+
retryable: false,
|
|
74
|
+
...readTool === void 0 ? {} : {
|
|
75
|
+
details: {
|
|
76
|
+
recovery: {
|
|
77
|
+
action: "read_in_chunks",
|
|
78
|
+
tool: readTool.name,
|
|
79
|
+
operationId: "tinycloud.read",
|
|
80
|
+
operationVersion: 1,
|
|
81
|
+
resourceKind: sql ? "sql" : "kv",
|
|
82
|
+
requiresCallerInput: true
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
73
86
|
}
|
|
74
87
|
};
|
|
75
88
|
serialized = JSON.stringify(canonical);
|
|
@@ -173,11 +186,13 @@ var TOOL_NAMES = [
|
|
|
173
186
|
"tinycloud_auth_status",
|
|
174
187
|
"tinycloud_auth_capabilities",
|
|
175
188
|
"tinycloud_auth_request",
|
|
189
|
+
"tinycloud_auth_read_scope",
|
|
176
190
|
"tinycloud_auth_import",
|
|
177
191
|
"tinycloud_account_spaces_list",
|
|
178
192
|
"tinycloud_account_applications_list",
|
|
179
193
|
"tinycloud_kv_list",
|
|
180
194
|
"tinycloud_kv_get",
|
|
195
|
+
"tinycloud_read",
|
|
181
196
|
"tinycloud_kv_head",
|
|
182
197
|
"tinycloud_kv_put",
|
|
183
198
|
"tinycloud_kv_delete",
|
|
@@ -250,6 +265,15 @@ var TOOL_BINDINGS = [
|
|
|
250
265
|
destructiveHint: false,
|
|
251
266
|
openWorldHint: false
|
|
252
267
|
},
|
|
268
|
+
{
|
|
269
|
+
name: "tinycloud_auth_read_scope",
|
|
270
|
+
operationId: "tinycloud.auth.read_scope",
|
|
271
|
+
operationVersion: 1,
|
|
272
|
+
readOnlyHint: true,
|
|
273
|
+
idempotentHint: true,
|
|
274
|
+
destructiveHint: false,
|
|
275
|
+
openWorldHint: false
|
|
276
|
+
},
|
|
253
277
|
{
|
|
254
278
|
name: "tinycloud_auth_import",
|
|
255
279
|
operationId: "tinycloud.auth.import",
|
|
@@ -298,6 +322,15 @@ var TOOL_BINDINGS = [
|
|
|
298
322
|
destructiveHint: false,
|
|
299
323
|
openWorldHint: true
|
|
300
324
|
},
|
|
325
|
+
{
|
|
326
|
+
name: "tinycloud_read",
|
|
327
|
+
operationId: "tinycloud.read",
|
|
328
|
+
operationVersion: 1,
|
|
329
|
+
readOnlyHint: true,
|
|
330
|
+
idempotentHint: true,
|
|
331
|
+
destructiveHint: false,
|
|
332
|
+
openWorldHint: true
|
|
333
|
+
},
|
|
301
334
|
{
|
|
302
335
|
name: "tinycloud_kv_head",
|
|
303
336
|
operationId: "tinycloud.kv.head",
|
|
@@ -522,7 +555,7 @@ function outcomeCode(result) {
|
|
|
522
555
|
// package.json
|
|
523
556
|
var package_default = {
|
|
524
557
|
name: "@tinycloud/mcp",
|
|
525
|
-
version: "0.9.0-beta.
|
|
558
|
+
version: "0.9.0-beta.5",
|
|
526
559
|
description: "TinyCloud delegated operations MCP server",
|
|
527
560
|
keywords: [
|
|
528
561
|
"tinycloud",
|
|
@@ -595,7 +628,7 @@ var package_default = {
|
|
|
595
628
|
"@modelcontextprotocol/server": "2.0.0-beta.5",
|
|
596
629
|
"@tinycloud/node-sdk": "3.11.0-beta.2",
|
|
597
630
|
"@tinycloud/node-sdk-wasm": "1.7.8",
|
|
598
|
-
"@tinycloud/operations": "0.
|
|
631
|
+
"@tinycloud/operations": "0.8.0-beta.3",
|
|
599
632
|
jose: "6.2.4"
|
|
600
633
|
},
|
|
601
634
|
devDependencies: {
|
|
@@ -2261,7 +2294,7 @@ function createHostedSurface(config, resourceUrl, surface, tokenStatus) {
|
|
|
2261
2294
|
{ name: MCP_SERVER_NAME, version: MCP_VERSION },
|
|
2262
2295
|
{
|
|
2263
2296
|
jsonSchemaValidator: validator,
|
|
2264
|
-
instructions: nativeOwner === void 0 ? surface === "public" ? "Use TinyCloud only for the user's requested task. Call tinycloud_connect first. If an operation returns authority_required, present approval.url and wait for the user's approval before retrying. If approval is declined, stop that operation. For personal records, call tinycloud_apps_context first. Never request or store passwords, API keys, authentication codes, government identifiers, payment-card data, or protected health information." : "Call tinycloud_connect first. If an operation returns authority_required,
|
|
2297
|
+
instructions: nativeOwner === void 0 ? surface === "public" ? "Use TinyCloud only for the user's requested task. Call tinycloud_connect first. If an operation returns authority_required, present approval.url and wait for the user's approval before retrying. If approval is declined, stop that operation. For personal records, call tinycloud_apps_context first. Never request or store passwords, API keys, authentication codes, government identifiers, payment-card data, or protected health information." : "Call tinycloud_connect first. If an operation returns authority_required, present approval.url and wait for approval before retrying unchanged. For personal records such as weight, workouts, goals or todos, call tinycloud_apps_context first. Other app data can be discovered with account-space listing, KV cursors and SQL schema/query tools without a knowledge bundle. If the user wants reusable read access, explicitly select prefixes/databases with tinycloud_auth_read_scope; never silently broaden a key read. Use tinycloud_read for complete bounded KV/SQL delivery and replay its continuation with the original resource." : "Use only the user's requested connector-transcript data. The signed TinyCloud grant authorizes read-only SQL and transcript KV reads. Use tinycloud_read for large values, retaining the original resource and returned digest-bound continuation."
|
|
2265
2298
|
}
|
|
2266
2299
|
);
|
|
2267
2300
|
registerTinyCloudTools(server, {
|
|
@@ -2271,7 +2304,7 @@ function createHostedSurface(config, resourceUrl, surface, tokenStatus) {
|
|
|
2271
2304
|
allowOwnerProfile: false,
|
|
2272
2305
|
stateRoot,
|
|
2273
2306
|
...nativeOwner === void 0 ? {} : {
|
|
2274
|
-
allowedTools: ["tinycloud_sql_query", "tinycloud_kv_get"]
|
|
2307
|
+
allowedTools: ["tinycloud_sql_query", "tinycloud_kv_get", "tinycloud_read"]
|
|
2275
2308
|
},
|
|
2276
2309
|
beforeOperation: nativeOwner === void 0 ? () => store.validateTenant(subject, ownerDids) : () => store.assertNativeGrantActive(nativeOwner),
|
|
2277
2310
|
...nativeOwner === void 0 ? {
|
|
@@ -2437,7 +2470,7 @@ Agentmap: ${new URL("/.well-known/ai-catalog.json", resourceUrl)}
|
|
|
2437
2470
|
{ service: "tinycloud.sql", space: "applications", path: "xyz.tinycloud.tinychat/connectors", actions: ["tinycloud.sql/read"] },
|
|
2438
2471
|
{ service: "tinycloud.kv", space: "applications", path: "xyz.tinycloud.tinychat/connectors/", actions: ["tinycloud.kv/get", "tinycloud.kv/list"] }
|
|
2439
2472
|
],
|
|
2440
|
-
tools: ["tinycloud_sql_query", "tinycloud_kv_get"],
|
|
2473
|
+
tools: ["tinycloud_sql_query", "tinycloud_kv_get", "tinycloud_read"],
|
|
2441
2474
|
errors: {
|
|
2442
2475
|
required: NATIVE_GRANT_REQUIRED,
|
|
2443
2476
|
expired: NATIVE_GRANT_EXPIRED,
|