@tinycloud/mcp 0.9.0-beta.4 → 0.9.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/dist/index.js CHANGED
@@ -26,14 +26,27 @@ function toMcpToolResult(result, bindings = [], options = {}) {
26
26
  serialized = JSON.stringify(canonical);
27
27
  if ((options.readOnly === true || options.operationId === "tinycloud.apps.context" || options.operationId === "tinycloud.apps.query") && serialized.length > 1e5) {
28
28
  const sql = options.operationId?.startsWith("tinycloud.sql.") || options.operationId === "tinycloud.apps.query";
29
+ const readTool = options.operationId === "tinycloud.kv.get" || options.operationId === "tinycloud.sql.query" ? bindings.find((binding) => binding.operationId === "tinycloud.read") : void 0;
29
30
  canonical = {
30
31
  status: "error",
31
32
  operation: canonical.operation,
32
33
  context: canonical.context,
33
34
  error: {
34
35
  code: sql ? "SQL_RESULT_LIMIT_EXCEEDED" : "KV_RESPONSE_TOO_LARGE",
35
- 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.",
36
- retryable: false
36
+ 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.",
37
+ retryable: false,
38
+ ...readTool === void 0 ? {} : {
39
+ details: {
40
+ recovery: {
41
+ action: "read_in_chunks",
42
+ tool: readTool.name,
43
+ operationId: "tinycloud.read",
44
+ operationVersion: 1,
45
+ resourceKind: sql ? "sql" : "kv",
46
+ requiresCallerInput: true
47
+ }
48
+ }
49
+ }
37
50
  }
38
51
  };
39
52
  serialized = JSON.stringify(canonical);
@@ -136,11 +149,13 @@ var TOOL_NAMES = [
136
149
  "tinycloud_auth_status",
137
150
  "tinycloud_auth_capabilities",
138
151
  "tinycloud_auth_request",
152
+ "tinycloud_auth_read_scope",
139
153
  "tinycloud_auth_import",
140
154
  "tinycloud_account_spaces_list",
141
155
  "tinycloud_account_applications_list",
142
156
  "tinycloud_kv_list",
143
157
  "tinycloud_kv_get",
158
+ "tinycloud_read",
144
159
  "tinycloud_kv_head",
145
160
  "tinycloud_kv_put",
146
161
  "tinycloud_kv_delete",
@@ -213,6 +228,15 @@ var TOOL_BINDINGS = [
213
228
  destructiveHint: false,
214
229
  openWorldHint: false
215
230
  },
231
+ {
232
+ name: "tinycloud_auth_read_scope",
233
+ operationId: "tinycloud.auth.read_scope",
234
+ operationVersion: 1,
235
+ readOnlyHint: true,
236
+ idempotentHint: true,
237
+ destructiveHint: false,
238
+ openWorldHint: false
239
+ },
216
240
  {
217
241
  name: "tinycloud_auth_import",
218
242
  operationId: "tinycloud.auth.import",
@@ -261,6 +285,15 @@ var TOOL_BINDINGS = [
261
285
  destructiveHint: false,
262
286
  openWorldHint: true
263
287
  },
288
+ {
289
+ name: "tinycloud_read",
290
+ operationId: "tinycloud.read",
291
+ operationVersion: 1,
292
+ readOnlyHint: true,
293
+ idempotentHint: true,
294
+ destructiveHint: false,
295
+ openWorldHint: true
296
+ },
264
297
  {
265
298
  name: "tinycloud_kv_head",
266
299
  operationId: "tinycloud.kv.head",
@@ -485,7 +518,7 @@ function outcomeCode(result) {
485
518
  // package.json
486
519
  var package_default = {
487
520
  name: "@tinycloud/mcp",
488
- version: "0.9.0-beta.4",
521
+ version: "0.9.0",
489
522
  description: "TinyCloud delegated operations MCP server",
490
523
  keywords: [
491
524
  "tinycloud",
@@ -556,9 +589,9 @@ var package_default = {
556
589
  dependencies: {
557
590
  "@modelcontextprotocol/node": "2.0.0-beta.5",
558
591
  "@modelcontextprotocol/server": "2.0.0-beta.5",
559
- "@tinycloud/node-sdk": "3.11.0-beta.2",
592
+ "@tinycloud/node-sdk": "3.11.0",
560
593
  "@tinycloud/node-sdk-wasm": "1.7.8",
561
- "@tinycloud/operations": "0.7.11-beta.2",
594
+ "@tinycloud/operations": "0.8.0",
562
595
  jose: "6.2.4"
563
596
  },
564
597
  devDependencies: {
@@ -2247,7 +2280,7 @@ function createHostedSurface(config, resourceUrl, surface, tokenStatus) {
2247
2280
  { name: MCP_SERVER_NAME, version: MCP_VERSION },
2248
2281
  {
2249
2282
  jsonSchemaValidator: validator,
2250
- 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, open approval.url, then retry that operation unchanged. For personal records such as weight, workouts, goals or todos, call tinycloud_apps_context first." : "Use only the user's requested connector-transcript data. The signed TinyCloud grant authorizes read-only SQL and transcript KV reads."
2283
+ 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."
2251
2284
  }
2252
2285
  );
2253
2286
  registerTinyCloudTools(server, {
@@ -2257,7 +2290,7 @@ function createHostedSurface(config, resourceUrl, surface, tokenStatus) {
2257
2290
  allowOwnerProfile: false,
2258
2291
  stateRoot,
2259
2292
  ...nativeOwner === void 0 ? {} : {
2260
- allowedTools: ["tinycloud_sql_query", "tinycloud_kv_get"]
2293
+ allowedTools: ["tinycloud_sql_query", "tinycloud_kv_get", "tinycloud_read"]
2261
2294
  },
2262
2295
  beforeOperation: nativeOwner === void 0 ? () => store.validateTenant(subject, ownerDids) : () => store.assertNativeGrantActive(nativeOwner),
2263
2296
  ...nativeOwner === void 0 ? {
@@ -2423,7 +2456,7 @@ Agentmap: ${new URL("/.well-known/ai-catalog.json", resourceUrl)}
2423
2456
  { service: "tinycloud.sql", space: "applications", path: "xyz.tinycloud.tinychat/connectors", actions: ["tinycloud.sql/read"] },
2424
2457
  { service: "tinycloud.kv", space: "applications", path: "xyz.tinycloud.tinychat/connectors/", actions: ["tinycloud.kv/get", "tinycloud.kv/list"] }
2425
2458
  ],
2426
- tools: ["tinycloud_sql_query", "tinycloud_kv_get"],
2459
+ tools: ["tinycloud_sql_query", "tinycloud_kv_get", "tinycloud_read"],
2427
2460
  errors: {
2428
2461
  required: NATIVE_GRANT_REQUIRED,
2429
2462
  expired: NATIVE_GRANT_EXPIRED,