@softure-ai/mcp-access 0.2.0 → 0.2.1
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/CHANGELOG.md +8 -0
- package/README.md +13 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/jobs/index.d.ts +12 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +22 -0
- package/dist/jobs/index.js.map +1 -0
- package/module.json +2 -2
- package/package.json +12 -1
- package/src/index.ts +2 -2
- package/src/jobs/index.ts +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ Newest first. Each version lists what changed for an app that uses `@softure-ai/
|
|
|
4
4
|
production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
|
|
5
5
|
"Definition of done"). Versions before the first one below are described in their GitHub Releases (`mcp-access@x.y.z`).
|
|
6
6
|
|
|
7
|
+
## 0.2.1
|
|
8
|
+
|
|
9
|
+
- `@softure-ai/mcp-access/jobs` (#491): `mcpAccessJobHandlers` and `mcpAccessJobSchedules` run `pruneMcpAccess`
|
|
10
|
+
daily as a `@softure-ai/jobs` schedule; `@softure-ai/jobs` (^0.1.1) is a new optional peer. Migrate (optional): an app with
|
|
11
|
+
`@softure-ai/jobs` adds `...mcpAccessJobSchedules` to `jobs({ schedules })` and `...mcpAccessJobHandlers` to its
|
|
12
|
+
worker's handlers, then drops the `softure-mcp prune` `maintain` hook (or its own cron). Without jobs nothing
|
|
13
|
+
changes; `softure-mcp prune` stays.
|
|
14
|
+
|
|
7
15
|
## 0.2.0
|
|
8
16
|
|
|
9
17
|
- **Breaking (#446):** the built-in `pl` dictionary is gone; English is the only built-in copy and the fallback for
|
package/README.md
CHANGED
|
@@ -372,6 +372,19 @@ runs it with the app's config (loaded like `softure migrate`, or from an app scr
|
|
|
372
372
|
|
|
373
373
|
An app that pruned inline on every token exchange can drop that code.
|
|
374
374
|
|
|
375
|
+
**With `@softure-ai/jobs`.** `@softure-ai/mcp-access/jobs` ships the handler and the schedule, so the worker runs the
|
|
376
|
+
cleanup instead of an app cron (`mcp-access.prune` daily; jobs README, "Schedules"):
|
|
377
|
+
|
|
378
|
+
```ts
|
|
379
|
+
// softure.config.ts
|
|
380
|
+
jobs({ schedules: { ...mcpAccessJobSchedules } }),
|
|
381
|
+
// src/jobs/handlers.ts (the worker's handlers)
|
|
382
|
+
export const handlers: JobHandlers = { ...mcpAccessJobHandlers /* , the app's own */ };
|
|
383
|
+
```
|
|
384
|
+
With it, drop the `mcp-prune` `maintain` hook.
|
|
385
|
+
|
|
386
|
+
`@softure-ai/jobs` is an optional peer: an app without it keeps calling the function from its own cron.
|
|
387
|
+
|
|
375
388
|
### Adopting an app's own tables
|
|
376
389
|
|
|
377
390
|
An app that ran its own `public.access_tokens` (with `grant_id`) and `oauth_clients`,
|
package/dist/index.js
CHANGED
|
@@ -30,8 +30,8 @@ export const MCP_RATE_LIMIT_BUCKETS = {
|
|
|
30
30
|
export const mcpAccess = defineModule({
|
|
31
31
|
manifest: {
|
|
32
32
|
id: MODULE_ID,
|
|
33
|
-
version: "0.2.
|
|
34
|
-
dependsOn: { security: "^0.2.0", auth: "^0.2.0" },
|
|
33
|
+
version: "0.2.1",
|
|
34
|
+
dependsOn: { security: "^0.2.0", auth: "^0.2.0", jobs: "^0.1.1?" },
|
|
35
35
|
dbSchema: "mcp",
|
|
36
36
|
tables: ["access_tokens", "oauth_clients", "oauth_authorization_codes", "oauth_grants"],
|
|
37
37
|
env: [],
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,kGAAkG;AAClG,kGAAkG;AAClG,mDAAmD;AACnD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAA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handlers: { ...mcpAccessJobHandlers }`. */
|
|
2
|
+
export declare const mcpAccessJobHandlers: {
|
|
3
|
+
/** Deletes expired access tokens and dead OAuth records (`pruneMcpAccess`). */
|
|
4
|
+
"mcp-access.prune": import("@softure-ai/jobs").JobHandler<Record<string, never>>;
|
|
5
|
+
};
|
|
6
|
+
/** Schedules for `jobs({ schedules: { ...mcpAccessJobSchedules } })`: daily. */
|
|
7
|
+
export declare const mcpAccessJobSchedules: {
|
|
8
|
+
"mcp-access.prune": {
|
|
9
|
+
every: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":"AAOA,wEAAwE;AACxE,eAAO,MAAM,oBAAoB;IAC/B,+EAA+E;;CAQ1D,CAAC;AAExB,gFAAgF;AAChF,eAAO,MAAM,qBAAqB;;;;CAEL,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The jobs adapter of @softure-ai/mcp-access: its daily cleanup as a `@softure-ai/jobs` handler and schedule (an
|
|
2
|
+
// optional peer dependency; only apps that import this entry need it).
|
|
3
|
+
import { ok } from "@softure-ai/core";
|
|
4
|
+
import { defineJobHandler } from "@softure-ai/jobs";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { pruneMcpAccess } from "../server/prune.js";
|
|
7
|
+
/** Handlers for the worker: `handlers: { ...mcpAccessJobHandlers }`. */
|
|
8
|
+
export const mcpAccessJobHandlers = {
|
|
9
|
+
/** Deletes expired access tokens and dead OAuth records (`pruneMcpAccess`). */
|
|
10
|
+
"mcp-access.prune": defineJobHandler({
|
|
11
|
+
payload: z.object({}),
|
|
12
|
+
run: async (_payload, ctx) => {
|
|
13
|
+
await pruneMcpAccess(ctx);
|
|
14
|
+
return ok();
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
/** Schedules for `jobs({ schedules: { ...mcpAccessJobSchedules } })`: daily. */
|
|
19
|
+
export const mcpAccessJobSchedules = {
|
|
20
|
+
"mcp-access.prune": { every: "1d" },
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,uEAAuE;AACvE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAA4C,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wEAAwE;AACxE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,+EAA+E;IAC/E,kBAAkB,EAAE,gBAAgB,CAAC;QACnC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;YAC3B,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;YAC1B,OAAO,EAAE,EAAE,CAAC;QACd,CAAC;KACF,CAAC;CACmB,CAAC;AAExB,gFAAgF;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,kBAAkB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;CACR,CAAC"}
|
package/module.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "mcp-access",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"dependsOn": { "security": "^0.2.0", "auth": "^0.2.0" },
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"dependsOn": { "security": "^0.2.0", "auth": "^0.2.0", "jobs": "^0.1.1?" },
|
|
5
5
|
"dbSchema": "mcp",
|
|
6
6
|
"tables": ["access_tokens", "oauth_clients", "oauth_authorization_codes", "oauth_grants"],
|
|
7
7
|
"env": [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/mcp-access",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "SOFTURE AI MCP access module: hashed, scoped, expiring access tokens, a rate-limited Bearer endpoint around the app's MCP server factory, and a token page with client setup instructions for Next.js; tool result helpers with a safe error boundary, a stdio entry, a catalog parity check and the softure-mcp prune command.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"types": "./dist/server/index.d.ts",
|
|
45
45
|
"default": "./dist/server/index.js"
|
|
46
46
|
},
|
|
47
|
+
"./jobs": {
|
|
48
|
+
"@softure-ai/source": "./src/jobs/index.ts",
|
|
49
|
+
"types": "./dist/jobs/index.d.ts",
|
|
50
|
+
"default": "./dist/jobs/index.js"
|
|
51
|
+
},
|
|
47
52
|
"./next": {
|
|
48
53
|
"@softure-ai/source": "./src/next/index.ts",
|
|
49
54
|
"types": "./dist/next/index.d.ts",
|
|
@@ -87,6 +92,7 @@
|
|
|
87
92
|
},
|
|
88
93
|
"peerDependencies": {
|
|
89
94
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
95
|
+
"@softure-ai/jobs": "^0.1.1",
|
|
90
96
|
"@softure-ai/ui": "^0.3.0",
|
|
91
97
|
"drizzle-orm": "^0.45.2",
|
|
92
98
|
"next": "^16.0.0",
|
|
@@ -94,5 +100,10 @@
|
|
|
94
100
|
},
|
|
95
101
|
"devDependencies": {
|
|
96
102
|
"@softure-ai/ui": "^0.3.0"
|
|
103
|
+
},
|
|
104
|
+
"peerDependenciesMeta": {
|
|
105
|
+
"@softure-ai/jobs": {
|
|
106
|
+
"optional": true
|
|
107
|
+
}
|
|
97
108
|
}
|
|
98
109
|
}
|
package/src/index.ts
CHANGED
|
@@ -34,8 +34,8 @@ export const MCP_RATE_LIMIT_BUCKETS = {
|
|
|
34
34
|
export const mcpAccess = defineModule({
|
|
35
35
|
manifest: {
|
|
36
36
|
id: MODULE_ID,
|
|
37
|
-
version: "0.2.
|
|
38
|
-
dependsOn: { security: "^0.2.0", auth: "^0.2.0" },
|
|
37
|
+
version: "0.2.1",
|
|
38
|
+
dependsOn: { security: "^0.2.0", auth: "^0.2.0", jobs: "^0.1.1?" },
|
|
39
39
|
dbSchema: "mcp",
|
|
40
40
|
tables: ["access_tokens", "oauth_clients", "oauth_authorization_codes", "oauth_grants"],
|
|
41
41
|
env: [],
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// The jobs adapter of @softure-ai/mcp-access: its daily cleanup as a `@softure-ai/jobs` handler and schedule (an
|
|
2
|
+
// optional peer dependency; only apps that import this entry need it).
|
|
3
|
+
import { ok } from "@softure-ai/core";
|
|
4
|
+
import { defineJobHandler, type JobHandlers, type JobSchedulesInput } from "@softure-ai/jobs";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { pruneMcpAccess } from "../server/prune.js";
|
|
7
|
+
|
|
8
|
+
/** Handlers for the worker: `handlers: { ...mcpAccessJobHandlers }`. */
|
|
9
|
+
export const mcpAccessJobHandlers = {
|
|
10
|
+
/** Deletes expired access tokens and dead OAuth records (`pruneMcpAccess`). */
|
|
11
|
+
"mcp-access.prune": defineJobHandler({
|
|
12
|
+
payload: z.object({}),
|
|
13
|
+
run: async (_payload, ctx) => {
|
|
14
|
+
await pruneMcpAccess(ctx);
|
|
15
|
+
return ok();
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
} satisfies JobHandlers;
|
|
19
|
+
|
|
20
|
+
/** Schedules for `jobs({ schedules: { ...mcpAccessJobSchedules } })`: daily. */
|
|
21
|
+
export const mcpAccessJobSchedules = {
|
|
22
|
+
"mcp-access.prune": { every: "1d" },
|
|
23
|
+
} satisfies JobSchedulesInput;
|