@tinycloud/mcp 0.10.0-beta.3 → 0.10.0-beta.30
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 +33 -14
- package/dist/cli.cjs +6 -6
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +6 -6
- package/dist/cli.js.map +1 -1
- package/dist/http-cli.cjs +16 -17
- package/dist/http-cli.cjs.map +1 -1
- package/dist/http-cli.js +16 -16
- package/dist/http-cli.js.map +1 -1
- package/dist/http.cjs +16 -17
- package/dist/http.cjs.map +1 -1
- package/dist/http.js +16 -16
- package/dist/http.js.map +1 -1
- package/dist/index.cjs +16 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +6 -6
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +6 -6
- package/dist/server.js.map +1 -1
- package/dist/tools.cjs +2 -2
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.js +2 -2
- package/dist/tools.js.map +1 -1
- package/generated/mcp-facts.json +16 -0
- package/package.json +4 -4
- package/skills/tinycloud-delegated-secrets/SKILL.md +4 -2
package/dist/index.cjs
CHANGED
|
@@ -430,7 +430,7 @@ var TOOL_BINDINGS = [
|
|
|
430
430
|
operationVersion: 1,
|
|
431
431
|
readOnlyHint: false,
|
|
432
432
|
idempotentHint: true,
|
|
433
|
-
destructiveHint:
|
|
433
|
+
destructiveHint: false,
|
|
434
434
|
openWorldHint: false,
|
|
435
435
|
surfaces: ["hosted", "public"]
|
|
436
436
|
},
|
|
@@ -460,7 +460,7 @@ var TOOL_BINDINGS = [
|
|
|
460
460
|
operationVersion: 1,
|
|
461
461
|
readOnlyHint: false,
|
|
462
462
|
idempotentHint: true,
|
|
463
|
-
destructiveHint:
|
|
463
|
+
destructiveHint: false,
|
|
464
464
|
openWorldHint: false,
|
|
465
465
|
surfaces: ["hosted", "public"]
|
|
466
466
|
}
|
|
@@ -555,7 +555,7 @@ function outcomeCode(result) {
|
|
|
555
555
|
// package.json
|
|
556
556
|
var package_default = {
|
|
557
557
|
name: "@tinycloud/mcp",
|
|
558
|
-
version: "0.10.0-beta.
|
|
558
|
+
version: "0.10.0-beta.30",
|
|
559
559
|
description: "TinyCloud delegated operations MCP server",
|
|
560
560
|
keywords: [
|
|
561
561
|
"tinycloud",
|
|
@@ -626,9 +626,9 @@ var package_default = {
|
|
|
626
626
|
dependencies: {
|
|
627
627
|
"@modelcontextprotocol/node": "2.0.0-beta.5",
|
|
628
628
|
"@modelcontextprotocol/server": "2.0.0-beta.5",
|
|
629
|
-
"@tinycloud/node-sdk": "3.12.0-beta.
|
|
630
|
-
"@tinycloud/node-sdk-wasm": "1.7.
|
|
631
|
-
"@tinycloud/operations": "0.9.0-beta.
|
|
629
|
+
"@tinycloud/node-sdk": "3.12.0-beta.22",
|
|
630
|
+
"@tinycloud/node-sdk-wasm": "1.7.9-beta.0",
|
|
631
|
+
"@tinycloud/operations": "0.9.0-beta.26",
|
|
632
632
|
jose: "6.2.4"
|
|
633
633
|
},
|
|
634
634
|
devDependencies: {
|
|
@@ -1508,14 +1508,15 @@ var RemoteTenantStore = class {
|
|
|
1508
1508
|
did: tenant.sessionDid,
|
|
1509
1509
|
callback: callback.toString(),
|
|
1510
1510
|
host: this.#config.nodeHost,
|
|
1511
|
-
jwk: Buffer.from(JSON.stringify(publicJwk(tenant.jwk))).toString("base64url"),
|
|
1511
|
+
jwk: Buffer.from(JSON.stringify((0, import_node_sdk2.publicJwk)(tenant.jwk))).toString("base64url"),
|
|
1512
1512
|
permissions: Buffer.from(JSON.stringify({
|
|
1513
1513
|
permissions: pending.permissions,
|
|
1514
1514
|
reason: [
|
|
1515
1515
|
pending.kind === "bootstrap" ? "Connect this TinyCloud account to the hosted MCP delegate." : (0, import_tc_apps.tcAppsApprovalReason)(pending.permissions) ?? "Approve the exact capabilities requested by the TinyCloud MCP operation.",
|
|
1516
1516
|
// Owner DIDs come from the verified OpenKey access token of the MCP
|
|
1517
|
-
// client that created this link, never from the link itself.
|
|
1518
|
-
|
|
1517
|
+
// client that created this link, never from the link itself. The
|
|
1518
|
+
// callback refuses a signer outside them, so the approver isn't asked to check.
|
|
1519
|
+
...pending.ownerDids.length === 0 ? [] : [`Requested by TinyCloud account ${pending.ownerDids.join(", ")}.`]
|
|
1519
1520
|
].join(" ")
|
|
1520
1521
|
})).toString("base64url"),
|
|
1521
1522
|
expiry: this.#config.delegationExpiry
|
|
@@ -2123,11 +2124,6 @@ function sessionFromCallback(data, privateJwk) {
|
|
|
2123
2124
|
signature: data.signature
|
|
2124
2125
|
};
|
|
2125
2126
|
}
|
|
2126
|
-
function publicJwk(jwk) {
|
|
2127
|
-
const copy = { ...jwk };
|
|
2128
|
-
for (const field of ["d", "p", "q", "dp", "dq", "qi", "oth", "k"]) delete copy[field];
|
|
2129
|
-
return copy;
|
|
2130
|
-
}
|
|
2131
2127
|
function samePrincipal(left, right) {
|
|
2132
2128
|
if (typeof left !== "string") return false;
|
|
2133
2129
|
try {
|
|
@@ -2234,6 +2230,7 @@ function samePendingRequest(pending, expected) {
|
|
|
2234
2230
|
// src/http.ts
|
|
2235
2231
|
var REQUIRED_SCOPE = "tinycloud:mcp";
|
|
2236
2232
|
var MCP_CORS_ALLOWED_HEADERS = "Authorization, Content-Type, Accept, Mcp-Protocol-Version, Mcp-Session-Id, Last-Event-ID, Mcp-Method, Mcp-Name";
|
|
2233
|
+
var MCP_CORS_EXPOSED_HEADERS = "WWW-Authenticate, Mcp-Session-Id, Mcp-Protocol-Version";
|
|
2237
2234
|
var LOCAL_CLI_PACKAGE = ["@tinycloud", "cli"].join("/");
|
|
2238
2235
|
var LOCAL_MCP_PACKAGE = ["@tinycloud", "mcp"].join("/");
|
|
2239
2236
|
function createHostedMcpApp(config) {
|
|
@@ -2531,10 +2528,12 @@ Local alternative: install \`${LOCAL_CLI_PACKAGE}\` and \`${LOCAL_MCP_PACKAGE}\`
|
|
|
2531
2528
|
try {
|
|
2532
2529
|
const destination = await store.approvalRedirect(requiredState(url));
|
|
2533
2530
|
return Response.redirect(destination, 302);
|
|
2534
|
-
} catch {
|
|
2531
|
+
} catch (error) {
|
|
2532
|
+
const reason = error instanceof ApprovalRequestError ? error.detail : "unknown";
|
|
2533
|
+
writeDiagnostic(`connect rejected: reason=${reason} path=${connectPath}`);
|
|
2535
2534
|
if (request.headers.get("accept")?.includes("text/html")) {
|
|
2536
2535
|
return new Response(
|
|
2537
|
-
'<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>TinyCloud approval unavailable</title><main><h1>This approval link is unavailable</h1><p>It may have expired or already been used.
|
|
2536
|
+
'<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>TinyCloud approval unavailable</title><main><h1>This approval link is unavailable</h1><p>It may have expired or already been used. Go back to the assistant that sent it and ask it to connect TinyCloud again.</p><p>If you declined access, no further approval is required. Never paste passwords, codes or approval links into support messages.</p></main></html>',
|
|
2538
2537
|
{
|
|
2539
2538
|
status: 400,
|
|
2540
2539
|
headers: {
|
|
@@ -2745,7 +2744,7 @@ function mcpCors(response, request) {
|
|
|
2745
2744
|
if (request.headers.has("origin")) {
|
|
2746
2745
|
headers.set("access-control-allow-origin", "*");
|
|
2747
2746
|
headers.set("access-control-allow-methods", "GET, POST, DELETE, OPTIONS");
|
|
2748
|
-
headers.set("access-control-expose-headers",
|
|
2747
|
+
headers.set("access-control-expose-headers", MCP_CORS_EXPOSED_HEADERS);
|
|
2749
2748
|
if (request.method === "OPTIONS") headers.set("access-control-allow-headers", MCP_CORS_ALLOWED_HEADERS);
|
|
2750
2749
|
}
|
|
2751
2750
|
return new Response(response.body, { status: response.status, statusText: response.statusText, headers });
|