@clipform/mcp-server 1.16.1 → 1.17.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/auth-context.d.ts +1 -0
- package/dist/auth-context.js +1 -1
- package/dist/{chunk-VWGIVJMQ.js → chunk-HCZI2UJ5.js} +1 -1
- package/dist/chunk-HCZI2UJ5.js.map +1 -0
- package/dist/{chunk-MB6BZ2JN.js → chunk-Y22DYUS3.js} +172 -122
- package/dist/{chunk-MB6BZ2JN.js.map → chunk-Y22DYUS3.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/server.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-VWGIVJMQ.js.map +0 -1
package/dist/auth-context.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ interface McpAuthContext {
|
|
|
13
13
|
workspace_id: string;
|
|
14
14
|
scopes: string[];
|
|
15
15
|
tool_name?: string;
|
|
16
|
+
api_key?: string;
|
|
16
17
|
}
|
|
17
18
|
declare function runWithMcpAuth<T>(ctx: McpAuthContext, fn: () => Promise<T> | T): Promise<T> | T;
|
|
18
19
|
declare function getMcpAuth(): McpAuthContext | undefined;
|
package/dist/auth-context.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/auth-context.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\n/**\n * Identity of the end-user a given MCP request is acting on behalf of.\n *\n * Populated by the in-process host (apps/api) after validating an OAuth\n * Bearer on /mcp. The MCP tool layer reads it to decide which workspace\n * forms should land in and which plan tier gates apply.\n *\n * NOT populated when the server runs as a local stdio process (npx) - in\n * that mode tools fall back to edit-token based auth.\n */\nexport interface McpAuthContext {\n user_id: string;\n workspace_id: string;\n scopes: string[];\n tool_name?: string;\n api_key?: string;\n}\n\nconst storage = new AsyncLocalStorage<McpAuthContext>();\n\nexport function runWithMcpAuth<T>(ctx: McpAuthContext, fn: () => Promise<T> | T): Promise<T> | T {\n return storage.run(ctx, fn);\n}\n\nexport function getMcpAuth(): McpAuthContext | undefined {\n return storage.getStore();\n}\n\nexport function runWithMcpTool<T>(toolName: string, fn: () => Promise<T> | T): Promise<T> | T {\n const parent = storage.getStore();\n if (!parent) return fn();\n return storage.run({ ...parent, tool_name: toolName }, fn);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,yBAAyB;AAoBlC,IAAM,UAAU,IAAI,kBAAkC;AAE/C,SAAS,eAAkB,KAAqB,IAA0C;AAC/F,SAAO,QAAQ,IAAI,KAAK,EAAE;AAC5B;AAEO,SAAS,aAAyC;AACvD,SAAO,QAAQ,SAAS;AAC1B;AAEO,SAAS,eAAkB,UAAkB,IAA0C;AAC5F,QAAM,SAAS,QAAQ,SAAS;AAChC,MAAI,CAAC,OAAQ,QAAO,GAAG;AACvB,SAAO,QAAQ,IAAI,EAAE,GAAG,QAAQ,WAAW,SAAS,GAAG,EAAE;AAC3D;","names":[]}
|