@softure-ai/mcp-access 0.2.5 → 0.2.8

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +121 -2
  3. package/dist/index.d.ts +8 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/messages/en.d.ts +8 -0
  7. package/dist/messages/en.d.ts.map +1 -1
  8. package/dist/messages/en.js +8 -0
  9. package/dist/messages/en.js.map +1 -1
  10. package/dist/messages/index.d.ts +8 -0
  11. package/dist/messages/index.d.ts.map +1 -1
  12. package/dist/server/action-tool.d.ts +6 -2
  13. package/dist/server/action-tool.d.ts.map +1 -1
  14. package/dist/server/action-tool.js +10 -3
  15. package/dist/server/action-tool.js.map +1 -1
  16. package/dist/server/index.d.ts +6 -2
  17. package/dist/server/index.d.ts.map +1 -1
  18. package/dist/server/index.js +6 -2
  19. package/dist/server/index.js.map +1 -1
  20. package/dist/server/server-factory.d.ts +31 -0
  21. package/dist/server/server-factory.d.ts.map +1 -0
  22. package/dist/server/server-factory.js +49 -0
  23. package/dist/server/server-factory.js.map +1 -0
  24. package/dist/server/server-info.d.ts +34 -0
  25. package/dist/server/server-info.d.ts.map +1 -0
  26. package/dist/server/server-info.js +30 -0
  27. package/dist/server/server-info.js.map +1 -0
  28. package/dist/server/strict-input.d.ts +17 -0
  29. package/dist/server/strict-input.d.ts.map +1 -0
  30. package/dist/server/strict-input.js +157 -0
  31. package/dist/server/strict-input.js.map +1 -0
  32. package/dist/server/tokens.d.ts +5 -0
  33. package/dist/server/tokens.d.ts.map +1 -1
  34. package/dist/server/tokens.js +10 -0
  35. package/dist/server/tokens.js.map +1 -1
  36. package/dist/server/tool-list.d.ts +35 -0
  37. package/dist/server/tool-list.d.ts.map +1 -0
  38. package/dist/server/tool-list.js +68 -0
  39. package/dist/server/tool-list.js.map +1 -0
  40. package/dist/server/tools.d.ts +40 -1
  41. package/dist/server/tools.d.ts.map +1 -1
  42. package/dist/server/tools.js +41 -3
  43. package/dist/server/tools.js.map +1 -1
  44. package/dist/testing/catalog.d.ts +8 -0
  45. package/dist/testing/catalog.d.ts.map +1 -1
  46. package/dist/testing/catalog.js +8 -19
  47. package/dist/testing/catalog.js.map +1 -1
  48. package/dist/testing/index.d.ts +1 -1
  49. package/dist/testing/index.d.ts.map +1 -1
  50. package/dist/testing/index.js +1 -1
  51. package/dist/testing/index.js.map +1 -1
  52. package/module.json +1 -1
  53. package/package.json +1 -1
  54. package/src/index.ts +1 -1
  55. package/src/messages/en.ts +9 -0
  56. package/src/server/action-tool.ts +15 -4
  57. package/src/server/index.ts +34 -1
  58. package/src/server/server-factory.ts +78 -0
  59. package/src/server/server-info.ts +76 -0
  60. package/src/server/strict-input.ts +191 -0
  61. package/src/server/tokens.ts +10 -0
  62. package/src/server/tool-list.ts +105 -0
  63. package/src/server/tools.ts +78 -5
  64. package/src/testing/catalog.ts +14 -23
  65. package/src/testing/index.ts +7 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,46 @@ 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.8
8
+
9
+ - The content of 0.2.7, which was never published: its release stopped at the gates (ESLint ran out of memory in
10
+ `release.yml`) before publishing, and a tag is never moved.
11
+
12
+ ## 0.2.7
13
+
14
+ - A `get_server_info` tool (#885): `serverInfoTool: { buildInfo, changelog?, description? }` on
15
+ `createMcpServerFactory` (`/server`) adds a read-only tool with no input fields for every token that answers the
16
+ build info (pass `readBuildInfo` of `@softure-ai/ops/server`), the optional changelog and the served name and
17
+ version, so an assistant checks which build answers in one call. `registerServerInfoTool(server, { buildInfo,
18
+ server: { name, version } })` registers it on a hand-built server. Its description is
19
+ `mcpAccessMessages.en.serverInfoTool.description`. Migrate: nothing; opt in to use it.
20
+ - Strict tool input (#876): `withStrictToolInput(server, { renamedFields?, coerceTextScalars?, messages? })`
21
+ (`/server`), or `strictToolInput` on `createMcpServerFactory`, rewrites every input schema at registration. Unknown
22
+ fields are refused at every level with the fields the object accepts, a field under its old name is refused as
23
+ `input.field_renamed` with the new name, and boolean and number fields also take their exact text. Texts live in
24
+ `mcpAccessMessages.en.toolInput`. The listed schemas gain `additionalProperties: false`, so the tool-list version of
25
+ a server that opts in changes once. Migrate: an app that wraps `registerTool` itself replaces it with the option.
26
+ - A server version that follows the tool list (#877): `createMcpServerFactory({ name, release?, version?, title?,
27
+ serverOptions?, registerTools(server, identity) })` (`/server`) returns an `McpServerFactory` whose servers answer
28
+ `initialize` with `<release>-tools-<12 hex>`, a fingerprint of every tool as `tools/list` serves it, measured once
29
+ per access level, so MCP clients drop a cached tool list whenever a release changes a tool.
30
+ `measureToolList(registerTools, { release?, name?, serverOptions? })` → `{ toolListVersion, toolCount }` measures a
31
+ list by hand; `measureServedToolLists(createServer)` (`/testing`) reports both levels for a snapshot. Migrate: an
32
+ app that derives the version itself on a recording server replaces it with the factory, or with `measureToolList`
33
+ when its tool list depends on the account.
34
+ - The catalog check treats a server with no tools as an empty list instead of failing to list it.
35
+
36
+ ## 0.2.6
37
+
38
+ - A hook around each tool call (#804): `withToolErrors` and `actionTool` take optional `onToolCall`, `caller`
39
+ (`{ tokenId, clientName }`) and, for `withToolErrors`, `args`. The hook gets one `ToolCallRecord` per call: tool
40
+ name, token id, client name, argument names (never values), outcome (`succeeded` with an item count, `failed` with
41
+ the error code, `thrown` with the `safeError` code), start and duration. A failing hook is logged by kind and never
42
+ changes the answer. `findTokenClientName(ctx, tokenId)` (`/server`) gives the token's name. Migrate: an app that
43
+ wraps each tool's work inside `withToolErrors` to read the raw result and time it, and looks up
44
+ `mcp.access_tokens.name` itself, drops both and passes `{ caller, args, onToolCall }` instead. `actionTool` now
45
+ answers an error state through `withToolErrors`'s result path; the answer is the same.
46
+
7
47
  ## 0.2.5
8
48
 
9
49
  - `TokenManager` keeps keyboard focus (#590): when the issued token appears, focus moves to its heading
package/README.md CHANGED
@@ -43,7 +43,10 @@ limit check made race-free.
43
43
  - Tokens an app issued before adopting the module keep working through `legacyTokenPattern`.
44
44
  - Server functions for scripts and other hosts, and a health check for `GET /api/health`.
45
45
  - For the app's own server: tool result helpers with a safe error boundary and server actions as write tools
46
- (`/server`), a stdio entry for local assistants (`/stdio`), a catalog parity check (`/testing`), a gate before a
46
+ (`/server`), a server factory whose version follows the tool list, so clients drop a stale cached `tools/list`
47
+ (`createMcpServerFactory`, `measureToolList`, `/server`), strict tool input that refuses unknown and renamed
48
+ fields (`withStrictToolInput`, `/server`), an opt-in `get_server_info` tool that tells which build answers
49
+ (`serverInfoTool`, `/server`), a stdio entry for local assistants (`/stdio`), a catalog parity check (`/testing`), a gate before a
47
50
  token is issued (`issueToken`, `/next`) and the `softure-mcp prune` command for a daily cleanup (§4, §5).
48
51
 
49
52
  ## 2. Installation
@@ -147,6 +150,101 @@ Answers to 2025-era clients come as one SSE `message` event, to 2026-07-28 clien
147
150
  mid-call notifications (progress, logging) are dropped. Keep `/api/mcp` out of a proxy guard that
148
151
  redirects to the login page: the endpoint authenticates by token, not by cookie.
149
152
 
153
+ ### A version that follows the tool list
154
+
155
+ MCP clients keep their cached `tools/list` until the server version they read at `initialize` changes, so a
156
+ release that adds a tool or changes a schema under the same `version` leaves the assistant on the old schemas.
157
+ `createMcpServerFactory` builds the factory with a version derived from the tools:
158
+
159
+ ```ts
160
+ // lib/mcp-server.ts
161
+ import { createMcpServerFactory } from "@softure-ai/mcp-access/server";
162
+
163
+ export const createServer = createMcpServerFactory({
164
+ name: "acme",
165
+ release: "2.1.0", // optional, default 1.0.0
166
+ registerTools: (server, { userId, canWrite }) => {
167
+ server.registerTool("list_orders", { description: "Lists your orders." }, () => listOrders(userId));
168
+ if (canWrite) server.registerTool("cancel_order", { ... }, (input) => cancelOrder(userId, input));
169
+ },
170
+ });
171
+ ```
172
+
173
+ - The version is `<release>-tools-<12 hex>`, a semver prerelease (comparisons ignore build metadata). The hex is a
174
+ sha256 of every tool as `tools/list` serves it (name, title, description, annotations, input and output JSON
175
+ Schema), in name order with keys sorted: the same registrations always give the same version, any change of a
176
+ name, description or schema changes it, a different registration order does not.
177
+ - It is measured once per access level, on a recording server with the same name and `serverOptions`, so a
178
+ read-only token gets the version of its smaller list. The list may depend on `canWrite` only; for one that depends
179
+ on the account, call `measureToolList(registerTools, { release, name })` → `{ toolListVersion, toolCount }` per
180
+ server instead. `version` passes a fixed value instead of the measured one.
181
+ - In the app's tests, `measureServedToolLists(createServer)` (`/testing`) gives `{ read, write }` with the version
182
+ and count of each level, for an inline snapshot next to the catalog check: a schema change that forgets to update
183
+ the snapshot fails the test.
184
+
185
+ ### Strict tool input
186
+
187
+ zod objects strip unknown keys, so a call with a misspelt field (`notes` for `note`) or a field of a newer tool list
188
+ answers as a write that worked while the value was dropped. `withStrictToolInput(server, options?)` rewrites every
189
+ input schema registered on the server from then on, or pass `strictToolInput: true | options` to
190
+ `createMcpServerFactory` (the version is then measured on the strict listing):
191
+
192
+ ```ts
193
+ const server = withStrictToolInput(new McpServer({ name: "acme", version }), {
194
+ renamedFields: { notes: "note" }, // old name → new name
195
+ coerceTextScalars: true, // default
196
+ messages: getMcpAccessMessages(config).toolInput, // default: the English dictionary
197
+ });
198
+ ```
199
+
200
+ - **Unknown fields** are refused at every level: nested objects, arrays, records, tuples, optionals, defaults,
201
+ unions, discriminated unions, intersections (a field either side knows is accepted), `z.lazy`, and the input side
202
+ of a transform. The answer names the field and the fields its object accepts, e.g.
203
+ `items.1: Unknown fields: "size". Accepted fields: "title".` An object with its own catchall (`z.looseObject`,
204
+ `.catchall(x)`) keeps it; refinements and the object's own error messages stay.
205
+ - **Renamed fields:** a field sent under an old name where the object accepts the new one is refused with the
206
+ stable code `input.field_renamed` and the new name, so a session on an older tool list learns it in one call.
207
+ - **Text scalars:** a client on an older tool list sends a field it does not know as text, so a boolean field also
208
+ takes the exact text `"true"`/`"false"` and a number field a JSON number written as text, converted before the
209
+ field's own rules (`"-1"` still fails `min(0)`). Any other text is refused. The listed JSON Schema keeps `boolean`
210
+ and `number` and gains `additionalProperties: false`.
211
+ - The SDK validates before the handler runs, so a refused call saves nothing. A raw shape is wrapped in
212
+ `z.object` first; a schema that is not zod passes unchanged. `toStrictToolInput(schema, options?)` gives the
213
+ strict schema on its own.
214
+
215
+ ### Which build answers: `get_server_info`
216
+
217
+ An assistant checks a "done" against production in one call. `serverInfoTool` on `createMcpServerFactory` adds a
218
+ read-only `get_server_info` tool for every token, with no input fields, that answers the build info of
219
+ `@softure-ai/ops` (the same public facts as its build info route) and the name and version the server answered at
220
+ `initialize`, which follows the tool list:
221
+
222
+ ```ts
223
+ import { readBuildInfo } from "@softure-ai/ops/server";
224
+
225
+ export const createServer = createMcpServerFactory({
226
+ name: "acme",
227
+ registerTools: (server, identity) => registerNoteTools(server, identity),
228
+ serverInfoTool: {
229
+ buildInfo: () => readBuildInfo(), // the route's options, when it has any
230
+ changelog: () => changelog, // optional: the provider the build info route gets
231
+ },
232
+ });
233
+ ```
234
+
235
+ ```json
236
+ { "server": { "name": "acme", "version": "1.0.0-tools-3f9a0c41d2e7" }, "release": "v1.4.0", "commit": "abc1234",
237
+ "builtAt": "2026-10-29T10:00:00.000Z", "startedAt": "2026-10-29T10:05:00.000Z", "changelog": [] }
238
+ ```
239
+
240
+ - The app passes the reader, so `/server` never loads `@softure-ai/ops`; `McpBuildInfo` is its `BuildInfo` by shape.
241
+ - `changelog` appears only with a provider; a provider that fails answers `changelog: null` and logs the error
242
+ class, as the route does. A failing `buildInfo` answers a tool error.
243
+ - The tool is part of the measured list, so turning it on changes the version once. The description comes from
244
+ `serverInfoTool.description` of the dictionary, or `description` in the options.
245
+ - A hand-built server registers it with `registerServerInfoTool(server, { buildInfo, server: { name, version } })`,
246
+ passing the name and version it serves.
247
+
150
248
  ### Writing tools
151
249
 
152
250
  `/server` answers tools safely, so a failure never hands the assistant a query or an error's text:
@@ -177,6 +275,25 @@ if (canWrite) {
177
275
  `{ status: "error", error }` state is a tool error through the hints; otherwise the answer is `message` (text or
178
276
  `(state) => text`), else the state as JSON.
179
277
 
278
+ To keep a record of tool calls (a calls panel, usage figures), pass `onToolCall` with a `caller` built once per
279
+ request in the factory. The hook runs after each call with one record: `tool` (the `label`, else `"call"`),
280
+ `tokenId`, `clientName`, `argumentNames` (names only, never values), `outcome` (`succeeded` with `itemCount` for an
281
+ array value, `failed` with the result's error code, `thrown` with the `safeError` code, `null` for a
282
+ `PublicError`), `startedAt` and `durationMs`. The hook is awaited; when it throws, the failure is logged by kind and
283
+ the assistant gets the same answer. `findTokenClientName(ctx, tokenId)` gives the token's name (`null` for the stdio
284
+ id or a token that is gone).
285
+
286
+ ```ts
287
+ export async function createServer({ userId, canWrite, tokenId }: McpServerIdentity) {
288
+ const caller = { tokenId, clientName: await findTokenClientName(ctx, tokenId) };
289
+ const onToolCall = (record: ToolCallRecord) => saveToolCall(db, userId, record);
290
+ server.registerTool("list_orders", { inputSchema: { status: z.string() } }, (args) =>
291
+ withToolErrors(() => findOrders(db, userId, args), { label: "list_orders", caller, args, onToolCall }),
292
+ );
293
+ // actionTool(handler, { label: "place_order", caller, onToolCall }) passes its arguments itself.
294
+ }
295
+ ```
296
+
180
297
  ### Stdio
181
298
 
182
299
  A local assistant on the machine that holds the database can run the same factory over stdio, without a token:
@@ -492,7 +609,9 @@ None. `allowWrites` is configuration, not a runtime switch: changing who may wri
492
609
  (placeholders `{serverName}` and `{command}`), `list`, `grants` (connected apps), `consent` (the
493
610
  consent page and its errors), and `errors` for the codes
494
611
  `mcp-access.name_required`, `name_too_long`, `token_limit_reached`, `token_not_found`, `grant_not_found`,
495
- `auth.unauthenticated`, `core.database_failed` and `core.unexpected`. Tool descriptions come from
612
+ `auth.unauthenticated`, `core.database_failed` and `core.unexpected`; `toolInput` for strict tool input
613
+ (`unknownFields` with `{fields}` and `{accepted}`, `noFields`, `fieldRenamed` with `{field}` and `{renamed}`).
614
+ Tool descriptions come from
496
615
  the `tools` option, per locale.
497
616
 
498
617
  ## 10. Hooks
package/dist/index.d.ts CHANGED
@@ -119,6 +119,14 @@ export declare const mcpAccess: import("@softure-ai/core").ModuleFactory<{
119
119
  nothingGranted: string;
120
120
  backToApp: string;
121
121
  };
122
+ toolInput: {
123
+ unknownFields: string;
124
+ noFields: string;
125
+ fieldRenamed: string;
126
+ };
127
+ serverInfoTool: {
128
+ description: string;
129
+ };
122
130
  errors: {
123
131
  "mcp-access": {
124
132
  name_required: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS,eAAe,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;IAEjC;;;;OAIG;;;;;;CAE8D,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA4BpB,CAAC;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,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AAiB,EACjB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,mCAAmC,EACnC,iCAAiC,EACjC,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,4BAA4B,EAAE,MAAM,aAAa,CAAC;AACvJ,OAAO,EAAE,oBAAoB,EAAE,KAAK,wBAAwB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ export const MCP_RATE_LIMIT_BUCKETS = {
30
30
  export const mcpAccess = defineModule({
31
31
  manifest: {
32
32
  id: MODULE_ID,
33
- version: "0.2.5",
33
+ version: "0.2.8",
34
34
  dependsOn: { security: "^0.2.0", auth: "^0.2.0", jobs: "^0.1.1?", ops: "^0.2.0?" },
35
35
  dbSchema: "mcp",
36
36
  tables: ["access_tokens", "oauth_clients", "oauth_authorization_codes", "oauth_grants", "oauth_registration_window"],
@@ -85,6 +85,14 @@ export declare const en: {
85
85
  nothingGranted: string;
86
86
  backToApp: string;
87
87
  };
88
+ toolInput: {
89
+ unknownFields: string;
90
+ noFields: string;
91
+ fieldRenamed: string;
92
+ };
93
+ serverInfoTool: {
94
+ description: string;
95
+ };
88
96
  errors: {
89
97
  "mcp-access": {
90
98
  name_required: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyGd,CAAC"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHd,CAAC"}
@@ -85,6 +85,14 @@ export const en = {
85
85
  nothingGranted: "No access was granted.",
86
86
  backToApp: "Back to the app ({target})",
87
87
  },
88
+ toolInput: {
89
+ unknownFields: "Unknown fields: {fields}. Accepted fields: {accepted}.",
90
+ noFields: "none",
91
+ fieldRenamed: "input.field_renamed: the field \"{field}\" is now \"{renamed}\". Send it as \"{renamed}\".",
92
+ },
93
+ serverInfoTool: {
94
+ description: "Tells which build of this server answers: its name and version (the version changes whenever a tool changes), the release, the commit, when it was built and started, and the changelog when the app publishes one. Use it to check that a change is live.",
95
+ },
88
96
  errors: {
89
97
  "mcp-access": {
90
98
  name_required: "Give the token a name, so you can tell it from the others.",
@@ -1 +1 @@
1
- {"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,IAAI,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D;QACD,IAAI,EAAE;YACJ,eAAe,EAAE,0DAA0D;YAC3E,UAAU,EAAE,0DAA0D;SACvE;KACF;CACF,CAAC"}
@@ -89,6 +89,14 @@ export declare const mcpAccessMessages: {
89
89
  nothingGranted: string;
90
90
  backToApp: string;
91
91
  };
92
+ toolInput: {
93
+ unknownFields: string;
94
+ noFields: string;
95
+ fieldRenamed: string;
96
+ };
97
+ serverInfoTool: {
98
+ description: string;
99
+ };
92
100
  errors: {
93
101
  "mcp-access": {
94
102
  name_required: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,0GAA0G;AAC1G,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAS,CAAC;AAExC,MAAM,MAAM,iBAAiB,GAAG,OAAO,EAAE,CAAC;AAE1C,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAOlG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,0GAA0G;AAC1G,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAS,CAAC;AAExC,MAAM,MAAM,iBAAiB,GAAG,OAAO,EAAE,CAAC;AAE1C,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAOlG"}
@@ -1,5 +1,5 @@
1
1
  import type { CallToolResult } from "@modelcontextprotocol/server";
2
- import { type ToolErrorHints } from "./tools.js";
2
+ import { type ToolCaller, type ToolCallHook, type ToolErrorHints } from "./tools.js";
3
3
  /** The action, called with the form. A `useActionState` action is passed as `(form) => action(INITIAL, form)`. */
4
4
  export type FormActionHandler = (formData: FormData) => unknown;
5
5
  export interface ActionToolOptions {
@@ -7,8 +7,12 @@ export interface ActionToolOptions {
7
7
  readonly message?: string | ((state: unknown) => string);
8
8
  /** Texts per error code, as in `withToolErrors`. */
9
9
  readonly hints?: ToolErrorHints;
10
- /** The tool's name in the log line. */
10
+ /** The tool's name in the log line and in the `onToolCall` record. */
11
11
  readonly label?: string;
12
+ /** Called once after each call with its record, as in `withToolErrors`. */
13
+ readonly onToolCall?: ToolCallHook;
14
+ /** Who called, for the record, as in `withToolErrors`. */
15
+ readonly caller?: ToolCaller;
12
16
  }
13
17
  /** The tool callback for `server.registerTool(name, { inputSchema }, actionTool(handler))`. */
14
18
  export declare function actionTool(handler: FormActionHandler, options?: ActionToolOptions): (args: Readonly<Record<string, unknown>>) => Promise<CallToolResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"action-tool.d.ts","sourceRoot":"","sources":["../../src/server/action-tool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAuD,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtG,kHAAkH;AAClH,MAAM,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,0GAA0G;IAC1G,QAAQ,CAAC,OAA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,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;CAC9B;AAED,+FAA+F;AAC/F,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,GAAE,iBAAsB,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,CAoB5J;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,QAAQ,CAS5E"}
@@ -1,16 +1,23 @@
1
- import { describeCode, toolError, toolResult, withToolErrors } from "./tools.js";
1
+ import { toolResult, withToolErrors } from "./tools.js";
2
2
  /** The tool callback for `server.registerTool(name, { inputSchema }, actionTool(handler))`. */
3
3
  export function actionTool(handler, options = {}) {
4
4
  const hints = options.hints ?? {};
5
5
  return (args) => withToolErrors(async () => {
6
6
  const state = await handler(toFormData(args));
7
7
  const error = readErrorCode(state);
8
+ // As a core result, so withToolErrors answers it through the hints and records its code.
8
9
  if (error !== null)
9
- return toolError(describeCode(error, hints));
10
+ return { ok: false, error };
10
11
  if (options.message === undefined)
11
12
  return toolResult(state);
12
13
  return toolResult(typeof options.message === "string" ? options.message : options.message(state));
13
- }, { hints, ...(options.label === undefined ? {} : { label: options.label }) });
14
+ }, {
15
+ hints,
16
+ args,
17
+ ...(options.label === undefined ? {} : { label: options.label }),
18
+ ...(options.onToolCall === undefined ? {} : { onToolCall: options.onToolCall }),
19
+ ...(options.caller === undefined ? {} : { caller: options.caller }),
20
+ });
14
21
  }
15
22
  /**
16
23
  * Arguments as a submitted form: strings as they are, numbers as text, `true` as `"on"` (a checked
@@ -1 +1 @@
1
- {"version":3,"file":"action-tool.js","sourceRoot":"","sources":["../../src/server/action-tool.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAuB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CAAC,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACvH,MAAM,SAAS,GAAG,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC;IAC3G,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC"}
@@ -13,6 +13,10 @@ export { getCodeChallenge, isPkceVerifierValid, isValidCodeChallenge, PKCE_METHO
13
13
  export { getMcpAccessMessages, getMcpAccessOptions, getMcpAccessRoutes, getMcpEndpointUrl, type McpAccessRoutes } from "./options.js";
14
14
  export { pruneMcpAccess, type PrunedMcpAccessRecords } from "./prune.js";
15
15
  export { deleteMcpAccessUserData, exportMcpAccessUserData, mcpAccessPrivacyContributor, type McpAccessUserData, } from "./privacy.js";
16
- export { ACCESS_TOKEN_PREFIX, hashAccessToken, isAccessTokenShape, issueAccessToken, listAccessTokens, pruneAccessTokens, revokeAccessToken, verifyAccessToken, type IssueAccessTokenInput, type IssueAccessTokenResult, type IssuedAccessToken, type McpAccessContext, type RevokeAccessTokenInput, type VerifiedAccessToken, } from "./tokens.js";
17
- export { toolError, toolResult, withToolErrors, type ToolErrorHints, type ToolErrorOptions } from "./tools.js";
16
+ export { ACCESS_TOKEN_PREFIX, hashAccessToken, isAccessTokenShape, issueAccessToken, listAccessTokens, pruneAccessTokens, findTokenClientName, revokeAccessToken, verifyAccessToken, type IssueAccessTokenInput, type IssueAccessTokenResult, type IssuedAccessToken, type McpAccessContext, type RevokeAccessTokenInput, type VerifiedAccessToken, } from "./tokens.js";
17
+ export { createMcpServerFactory, type McpServerFactoryOptions } from "./server-factory.js";
18
+ export { registerServerInfoTool, SERVER_INFO_TOOL_NAME, type McpBuildInfo, type RegisterServerInfoToolOptions, type ServedServerInfo, type ServerInfoAnswer, type ServerInfoToolOptions, } from "./server-info.js";
19
+ export { toStrictToolInput, withStrictToolInput, type StrictToolInputMessages, type StrictToolInputOptions } from "./strict-input.js";
20
+ export { DEFAULT_TOOL_LIST_RELEASE, describeToolList, fingerprintToolList, listServedTools, measureToolList, type MeasureToolListOptions, type RegisterTools, type ServedTool, type ToolListMeasurement, } from "./tool-list.js";
21
+ export { toolError, toolResult, withToolErrors, type ToolCaller, type ToolCallHook, type ToolCallOutcome, type ToolCallRecord, type ToolErrorHints, type ToolErrorOptions, } from "./tools.js";
18
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,GACjC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,iBAAiB,EACtB,KAA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EACvB,2BAA2B,EAC3B,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,GACjC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,4BAA4B,EACjC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CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,6BAA6B,EAClC,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,KAAK,uBAAuB,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACtI,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,EACd,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC"}
@@ -14,6 +14,10 @@ export { getCodeChallenge, isPkceVerifierValid, isValidCodeChallenge, PKCE_METHO
14
14
  export { getMcpAccessMessages, getMcpAccessOptions, getMcpAccessRoutes, getMcpEndpointUrl } from "./options.js";
15
15
  export { pruneMcpAccess } from "./prune.js";
16
16
  export { deleteMcpAccessUserData, exportMcpAccessUserData, mcpAccessPrivacyContributor, } from "./privacy.js";
17
- export { ACCESS_TOKEN_PREFIX, hashAccessToken, isAccessTokenShape, issueAccessToken, listAccessTokens, pruneAccessTokens, revokeAccessToken, verifyAccessToken, } from "./tokens.js";
18
- export { toolError, toolResult, withToolErrors } from "./tools.js";
17
+ export { ACCESS_TOKEN_PREFIX, hashAccessToken, isAccessTokenShape, issueAccessToken, listAccessTokens, pruneAccessTokens, findTokenClientName, revokeAccessToken, verifyAccessToken, } from "./tokens.js";
18
+ export { createMcpServerFactory } from "./server-factory.js";
19
+ export { registerServerInfoTool, SERVER_INFO_TOOL_NAME, } from "./server-info.js";
20
+ export { toStrictToolInput, withStrictToolInput } from "./strict-input.js";
21
+ export { DEFAULT_TOOL_LIST_RELEASE, describeToolList, fingerprintToolList, listServedTools, measureToolList, } from "./tool-list.js";
22
+ export { toolError, toolResult, withToolErrors, } from "./tools.js";
19
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,+FAA+F;AAC/F,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,eAAe,GAIhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAkD,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,sBAAsB,GAGvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,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AAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,+FAA+F;AAC/F,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,eAAe,GAIhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAkD,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,sBAAsB,GAGvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,GASjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,kCAAkC,EAClC,mBAAmB,EACnB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,2BAA2B,EAC3B,YAAY,EACZ,gCAAgC,EAChC,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,GAK7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,iBAAiB,EAA0C,MAAM,eAAe,CAAC;AACrI,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,uBAAuB,EAAyD,MAAM,uBAAuB,CAAC;AAC1L,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAwB,MAAM,cAAc,CAAC;AACtI,OAAO,EAAE,cAAc,EAA+B,MAAM,YAAY,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,GAE5B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,GAOlB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAgC,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GAMtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAA6D,MAAM,mBAAmB,CAAC;AACtI,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,GAKhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,GAOf,MAAM,YAAY,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { McpServer, type McpServerOptions } from "@modelcontextprotocol/server";
2
+ import type { McpServerIdentity } from "../contract.js";
3
+ import type { McpServerFactory } from "./endpoint.js";
4
+ import { type StrictToolInputOptions } from "./strict-input.js";
5
+ import { type ServerInfoToolOptions } from "./server-info.js";
6
+ export interface McpServerFactoryOptions {
7
+ /** `serverInfo.name`. */
8
+ readonly name: string;
9
+ /** `serverInfo.title`, the name a client shows. */
10
+ readonly title?: string;
11
+ /** The `MAJOR.MINOR.PATCH` before `-tools-`. Default: `1.0.0`. */
12
+ readonly release?: string;
13
+ /** A fixed `serverInfo.version` instead of the measured one. */
14
+ readonly version?: string;
15
+ readonly serverOptions?: McpServerOptions;
16
+ /**
17
+ * Registers the tools for one request. The tool list may depend on `identity.canWrite` only: it is
18
+ * measured once per access level. A list that depends on the account needs `measureToolList` per call.
19
+ */
20
+ readonly registerTools: (server: McpServer, identity: McpServerIdentity) => unknown;
21
+ /** Every tool's input is strict (`withStrictToolInput`), on the served and the measured server alike. */
22
+ readonly strictToolInput?: boolean | StrictToolInputOptions;
23
+ /**
24
+ * Adds the read-only `get_server_info` tool for every access level: the build info (pass `readBuildInfo` of
25
+ * `@softure-ai/ops/server`) with the served name and version. Off by default.
26
+ */
27
+ readonly serverInfoTool?: ServerInfoToolOptions;
28
+ }
29
+ /** An `McpServerFactory` whose servers carry the tool list's version for the identity's access level. */
30
+ export declare function createMcpServerFactory(options: McpServerFactoryOptions): McpServerFactory;
31
+ //# sourceMappingURL=server-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-factory.d.ts","sourceRoot":"","sources":["../../src/server/server-factory.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAA0B,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGtF,MAAM,WAAW,uBAAuB;IACtC,yBAAyB;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,KAAK,OAAO,CAAC;IACpF,yGAAyG;IACzG,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,sBAAsB,CAAC;IAC5D;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACjD;AAED,yGAAyG;AACzG,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CAmCzF"}
@@ -0,0 +1,49 @@
1
+ // The app's MCP server factory with a version that follows its tool list. The tools are measured once
2
+ // per access level (a read-only token sees fewer tools) on a recording server, and each request's
3
+ // server answers `initialize` with that level's version, so a client drops its cached `tools/list`
4
+ // whenever a release changes a tool. The factory plugs into `createMcpEndpoint`, `serveMcpStdio` and
5
+ // the catalog check like a hand-written one.
6
+ //
7
+ // export const createServer = createMcpServerFactory({
8
+ // name: "acme",
9
+ // registerTools: (server, identity) => registerNoteTools(server, identity),
10
+ // });
11
+ import { McpServer } from "@modelcontextprotocol/server";
12
+ import { withStrictToolInput } from "./strict-input.js";
13
+ import { registerServerInfoTool } from "./server-info.js";
14
+ import { measureToolList } from "./tool-list.js";
15
+ /** An `McpServerFactory` whose servers carry the tool list's version for the identity's access level. */
16
+ export function createMcpServerFactory(options) {
17
+ const strictOptions = options.strictToolInput === true ? {} : options.strictToolInput === false ? undefined : options.strictToolInput;
18
+ // The served version reaches `get_server_info` here; the recording server registers it with a placeholder, since
19
+ // its handler never runs there and the version is not part of the listed tool.
20
+ const registerTools = async (server, identity, version = "") => {
21
+ const target = strictOptions === undefined ? server : withStrictToolInput(server, strictOptions);
22
+ await options.registerTools(target, identity);
23
+ if (options.serverInfoTool !== undefined)
24
+ registerServerInfoTool(target, { ...options.serverInfoTool, server: { name: options.name, version } });
25
+ };
26
+ const measurements = new Map();
27
+ // The promise is cached, so parallel first requests measure once; a failed measurement is dropped so
28
+ // the next request tries again instead of failing for good.
29
+ const measure = (identity) => {
30
+ const cached = measurements.get(identity.canWrite);
31
+ if (cached !== undefined)
32
+ return cached;
33
+ const measurement = measureToolList((server) => registerTools(server, identity), {
34
+ ...(options.release === undefined ? {} : { release: options.release }),
35
+ name: options.name,
36
+ ...(options.serverOptions === undefined ? {} : { serverOptions: options.serverOptions }),
37
+ });
38
+ measurements.set(identity.canWrite, measurement);
39
+ void measurement.catch(() => measurements.delete(identity.canWrite));
40
+ return measurement;
41
+ };
42
+ return async (identity) => {
43
+ const version = options.version ?? (await measure(identity)).toolListVersion;
44
+ const server = new McpServer({ name: options.name, version, ...(options.title === undefined ? {} : { title: options.title }) }, options.serverOptions);
45
+ await registerTools(server, identity, version);
46
+ return server;
47
+ };
48
+ }
49
+ //# sourceMappingURL=server-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-factory.js","sourceRoot":"","sources":["../../src/server/server-factory.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,kGAAkG;AAClG,mGAAmG;AACnG,qGAAqG;AACrG,6CAA6C;AAC7C,EAAE;AACF,yDAAyD;AACzD,oBAAoB;AACpB,gFAAgF;AAChF,QAAQ;AACR,OAAO,EAAE,SAAS,EAAyB,MAAM,8BAA8B,CAAC;AAGhF,OAAO,EAAE,mBAAmB,EAA+B,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAA8B,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,eAAe,EAA4B,MAAM,gBAAgB,CAAC;AA0B3E,yGAAyG;AACzG,MAAM,UAAU,sBAAsB,CAAC,OAAgC;IACrE,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,KAAK,KAA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C,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC;SACzF,CAAC,CAAC;QACH,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QACjD,KAAK,WAAW,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrE,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,KAAK,EAAE,QAAQ,EAAE,EAAE;QACxB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC;QAC7E,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,EACjG,OAAO,CAAC,aAAa,CACtB,CAAC;QACF,MAAM,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { McpServer } from "@modelcontextprotocol/server";
2
+ export declare const SERVER_INFO_TOOL_NAME = "get_server_info";
3
+ /** The build info of `@softure-ai/ops` (`readBuildInfo()`), typed by shape so mcp-access does not import ops. */
4
+ export interface McpBuildInfo {
5
+ readonly release: string | null;
6
+ readonly commit: string | null;
7
+ readonly builtAt: string | null;
8
+ readonly startedAt: string;
9
+ }
10
+ export interface ServerInfoToolOptions {
11
+ /** The build info, e.g. `() => readBuildInfo()` from `@softure-ai/ops/server` with the route's options. */
12
+ readonly buildInfo: () => McpBuildInfo | Promise<McpBuildInfo>;
13
+ /** The changelog the build info route answers, when the app passes one there. Only what is public. */
14
+ readonly changelog?: () => unknown;
15
+ /** Default: `serverInfoTool.description` of the module dictionary. */
16
+ readonly description?: string;
17
+ }
18
+ /** What `initialize` answers as `serverInfo`. */
19
+ export interface ServedServerInfo {
20
+ readonly name: string;
21
+ readonly version: string;
22
+ }
23
+ export interface RegisterServerInfoToolOptions extends ServerInfoToolOptions {
24
+ /** The name and version the server answers at `initialize`; `createMcpServerFactory` passes them in. */
25
+ readonly server: ServedServerInfo;
26
+ }
27
+ /** The tool's answer: the served name and version, the build info and, with a provider, the changelog. */
28
+ export type ServerInfoAnswer = McpBuildInfo & {
29
+ readonly server: ServedServerInfo;
30
+ readonly changelog?: unknown;
31
+ };
32
+ /** Registers `get_server_info`: no input fields, read only. A failing `buildInfo` reaches the SDK, which answers a tool error. */
33
+ export declare function registerServerInfoTool(server: McpServer, options: RegisterServerInfoToolOptions): void;
34
+ //# sourceMappingURL=server-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-info.d.ts","sourceRoot":"","sources":["../../src/server/server-info.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAM9D,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,iHAAiH;AACjH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,2GAA2G;IAC3G,QAAQ,CAAC,SAAS,EAAE,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/D,sGAAsG;IACtG,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC;IACnC,sEAAsE;IACtE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAC1E,wGAAwG;IACxG,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;CACnC;AAED,0GAA0G;AAC1G,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAElH,kIAAkI;AAClI,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,6BAA6B,GAAG,IAAI,CAWtG"}
@@ -0,0 +1,30 @@
1
+ import { errorLogLabel } from "@softure-ai/core";
2
+ import { z } from "zod";
3
+ import { en } from "../messages/en.js";
4
+ import { toolResult } from "./tools.js";
5
+ export const SERVER_INFO_TOOL_NAME = "get_server_info";
6
+ /** Registers `get_server_info`: no input fields, read only. A failing `buildInfo` reaches the SDK, which answers a tool error. */
7
+ export function registerServerInfoTool(server, options) {
8
+ server.registerTool(SERVER_INFO_TOOL_NAME, {
9
+ description: options.description ?? en.serverInfoTool.description,
10
+ // An empty object rather than no schema, so strict input refuses a field sent to it.
11
+ inputSchema: z.object({}),
12
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
13
+ }, async () => toolResult(await readServerInfo(options)));
14
+ }
15
+ async function readServerInfo(options) {
16
+ const { release, commit, builtAt, startedAt } = await options.buildInfo();
17
+ const answer = { server: { name: options.server.name, version: options.server.version }, release, commit, builtAt, startedAt };
18
+ return options.changelog === undefined ? answer : { ...answer, changelog: await readChangelog(options.changelog) };
19
+ }
20
+ /** As the build info route: a failing provider answers `null` and logs the error class, so the build info still answers. */
21
+ async function readChangelog(provider) {
22
+ try {
23
+ return (await provider()) ?? null;
24
+ }
25
+ catch (error) {
26
+ console.error(`get_server_info: the changelog provider failed: ${errorLogLabel(error)}`);
27
+ return null;
28
+ }
29
+ }
30
+ //# sourceMappingURL=server-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-info.js","sourceRoot":"","sources":["../../src/server/server-info.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAiCvD,kIAAkI;AAClI,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,OAAsC;IAC9F,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;QACE,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,cAAc,CAAC,WAAW;QACjE,qFAAqF;QACrF,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;KAChF,EACD,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC,CACtD,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,OAAsC;IAClE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;IAC1E,MAAM,MAAM,GAAqB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,OA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