@abgov/adsp-sdk-mcp-server 1.24.1 → 1.25.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/README.md CHANGED
@@ -5,20 +5,27 @@ An MCP (Model Context Protocol) server that gives an AI coding assistant grounde
5
5
  (`@abgov/adsp-service-sdk`), instead of guessing.
6
6
 
7
7
  It bundles the ADSP documentation site content and a curated reference of every `@abgov/adsp-service-sdk` export,
8
- and exposes them over stdio via five tools:
8
+ and exposes them over stdio via seven tools:
9
9
 
10
10
  - `search_adsp_docs` — keyword search across ADSP platform docs (getting started, architecture, service concepts,
11
- tutorials).
12
- - `read_adsp_doc` — read the full content of a doc page found via search.
11
+ tutorials). Common words people use that the docs don't, such as `websocket` or `auth`, also search for the
12
+ docs' own terms (`src/search/aliases.ts`).
13
+ - `list_adsp_docs` — list the path and title of every bundled doc page, optionally under a path prefix such as
14
+ `services/`, for browsing when keyword search misses.
15
+ - `read_adsp_doc` — read the full content of a doc page found via search or the list.
13
16
  - `search_sdk_reference` — search `@abgov/adsp-service-sdk` by symbol name, module, or keyword; returns full symbol
14
17
  details (kind, description, option/return shape, example, deprecated flag).
15
18
  - `get_platform_quickstart` — the canonical `initializeService` usage pattern (the common case for a tenant service
16
19
  built on top of ADSP) and a capabilities summary, for the most common question: how to start using ADSP from a
17
20
  Node service.
18
- - `list_service_roles` — **the one tool that talks to a real ADSP environment**, not bundled/offline data. Reads
19
- every platform service's registered RBAC role live from tenant-service configuration, so an agent can pick a
20
- least-privileged role instead of defaulting to an admin role. Requires logging in first (see below) — everything
21
- else in this package works fully offline with no setup.
21
+ - `list_service_roles` — **live: talks to a real ADSP environment**, not bundled/offline data. Reads every platform
22
+ service's registered RBAC role from tenant-service configuration, so an agent can pick a least-privileged role
23
+ instead of defaulting to an admin role.
24
+ - `get_service_configuration_schema` — **live.** Reads platform services' configuration schemas from
25
+ configuration-service, for the shape of `serviceConfigurations` entries in `initializeService`.
26
+
27
+ The two live tools require logging in first (see below). Everything else in this package works fully offline with no
28
+ setup.
22
29
 
23
30
  This package covers the Node SDK only. Other language SDKs (`.NET`, Django, Flask, Spring) are out of scope for now.
24
31
 
@@ -105,7 +112,7 @@ Things to know when sizing and tuning these:
105
112
  | Client | Over the cap for longer than `MCP_IN_FLIGHT_WAIT_MS` | Over the cap briefly (`MCP_IN_FLIGHT_WAIT_MS=3000`, slots freed after 0.5 s) |
106
113
  |---|---|---|
107
114
  | `@modelcontextprotocol/sdk` 1.32.1 | `connect()` throws `StreamableHTTPError` (code 503) after the wait. One request, no retry, `Retry-After` ignored | Connects and calls the tool after about 0.5 s |
108
- | `@mastra/mcp` 1.8.1 | Logs `MCP_CLIENT_GET_TOOLS_FAILED` and `listTools()` returns no tools from this server, without throwing. One request, no retry | Lists all six tools and calls one after about 0.5 s |
115
+ | `@mastra/mcp` 1.8.1 | Logs `MCP_CLIENT_GET_TOOLS_FAILED` and `listTools()` returns no tools from this server, without throwing. One request, no retry | Lists all tools and calls one after about 0.5 s |
109
116
 
110
117
  So a `503` becomes a failed tool call, or an agent turn with no ADSP tools at all. Size `MCP_MAX_IN_FLIGHT` and
111
118
  the replica count so it stays rare, and watch `mcp.requests.rejected`.
@@ -130,7 +137,7 @@ OpenTelemetry SDK isn't loaded. Stdio mode never exports metrics.
130
137
 
131
138
  Every label takes a value from a fixed set:
132
139
 
133
- - `mcp.tool.name`: one of the six tool names, or `unknown` for any name the server doesn't have.
140
+ - `mcp.tool.name`: one of the seven tool names, or `unknown` for any name the server doesn't have.
134
141
  - `mcp.method.name`: an MCP method such as `initialize`, `tools/list` or `tools/call`; `other` for any other method;
135
142
  `batch` for a JSON-RPC batch; `unparsed` when the body wasn't valid JSON-RPC or was too large.
136
143
  - `error.type` on `mcp.request.duration`: `aborted` when the client disconnected before the response was written; the
@@ -142,9 +149,9 @@ Every label takes a value from a fixed set:
142
149
  request, which `adsp-cli` reports the same way.
143
150
  - `reason` on `mcp.requests.rejected`: `in_flight_cap`, `rate_limit`, `origin` or `live_tool_cap`.
144
151
 
145
- ### Using `list_service_roles`
152
+ ### Using the live tools
146
153
 
147
- That one tool needs a real ADSP environment and a logged-in session (via `@abgov/adsp-cli`, a separate package this
154
+ `list_service_roles` and `get_service_configuration_schema` need a real ADSP environment and a logged-in session (via `@abgov/adsp-cli`, a separate package this
148
155
  one depends on). One-time setup — no MCP client config changes needed:
149
156
 
150
157
  ```bash
@@ -158,7 +165,7 @@ client config. `ADSP_TENANT_REALM` remains available as an optional override (e.
158
165
  The same role data is also available directly from a terminal, without an MCP client at all: `npx @abgov/adsp-cli
159
166
  service-roles`.
160
167
 
161
- If `list_service_roles` is called without a valid login, it returns a clear, actionable error (telling you to run
168
+ If either live tool is called without a valid login, it returns a clear, actionable error (telling you to run
162
169
  `npx @abgov/adsp-cli login`) rather than failing silently or hanging — it never opens a browser or blocks waiting for
163
170
  one itself.
164
171
 
@@ -170,6 +177,11 @@ nx test adsp-sdk-mcp-server
170
177
  nx lint adsp-sdk-mcp-server
171
178
  ```
172
179
 
180
+ `src/sdk-reference/reference.ts` is maintained by hand. `reference.spec.ts` reads the root exports of
181
+ `libs/adsp-service-sdk/src/index.ts` with the TypeScript compiler and fails when the reference drifts: a missing or
182
+ stale name, or a different kind, module or deprecated flag, or a `seeAlso` with no entry. When you change what the SDK
183
+ exports, update `reference.ts` in the same PR.
184
+
173
185
  `src/fixtures/tool-contract.golden.json` is maintained by hand. It pins only the docs tools' and the unknown tool's
174
186
  output over the fixture docs in `src/fixtures/docs`; the other tools are checked for equal output across transports
175
187
  instead, so SDK reference and quickstart edits don't touch it. If you change docs search or the docs tools' output on
@@ -35,7 +35,7 @@ The tenant administration app allows you to configure platform services for your
35
35
 
36
36
  After your tenant is created, you will have access to the tenant administration application. As the original creator of a tenant, you can login from the landing page of ADSP to access tenant administration.
37
37
 
38
- For other team members, note the instructions and tenant specific login LRN shown in the aside on the _Dashboard_ view (either on the right or the bottom). Team members can login via this url to provision their user in the tenant realm; they will start with no access to tenant administration.
38
+ For other team members, note the instructions and tenant specific login URL shown in the aside on the _Dashboard_ view (either on the right or the bottom). Team members can login via this url to provision their user in the tenant realm; they will start with no access to tenant administration.
39
39
 
40
40
  **To grant administration access to team members**
41
41
 
@@ -65,7 +65,7 @@ Once you have an event definition configured, you can use the event service API
65
65
  **To create a service account**
66
66
 
67
67
  1. In Keycloak realm administration, from _Clients_, click _Create client_ to create a client to use with a service account.
68
- 2. Set the _Client Type_ to "Confidential", enter a _Client ID_ (e.g., `urn:ads:platform:event-service` for event service).
68
+ 2. Set the _Client Type_ to "Confidential", enter a _Client ID_ for your application (e.g., `my-event-sender`).
69
69
  3. Under _Client authentication_, toggle _Client authentication_ to **On**.
70
70
  4. Under _Authentication flow_, toggle _Service accounts_ to **On**.
71
71
  5. Set _Valid redirect URIs_ to https://api.adsp.alberta.ca and _Web origins_ to +.
@@ -79,14 +79,14 @@ Once you have an event definition configured, you can use the event service API
79
79
  1. In tenant administration, from the _Services_ -> _Events_ view, click the _Read the API docs_ link in the aside (either on the right or the bottom).
80
80
  2. In API documentation, click _Authorize_, and login using `client_credentials` grant with the client created above.
81
81
  3. Expand the _POST /event​/v1​/events_ endpoint, click _Try it out_.
82
- 4. In the _Request body_ text field, set the namespace and name of the event to match your definition and the timestamp to an ISO2601 timestamp (e.g. 2021-10-02T12:00:00Z).
82
+ 4. In the _Request body_ text field, set the namespace and name of the event to match your definition and the timestamp to an ISO 8601 timestamp (e.g. 2021-10-02T12:00:00Z).
83
83
  5. Click _Execute_ to send the request.
84
84
 
85
85
  **To send an event from your application**
86
86
 
87
87
  1. Get an access token with the event-sender role.
88
88
  ```typescript
89
- const { access_token } = await fetch(`${keycloakRealmTokenUrl}`, {
89
+ const tokenResponse = await fetch(`https://access.alberta.ca/auth/realms/${realm}/protocol/openid-connect/token`, {
90
90
  method: 'POST',
91
91
  headers: {
92
92
  'Content-Type': 'application/x-www-form-urlencoded',
@@ -97,10 +97,11 @@ Once you have an event definition configured, you can use the event service API
97
97
  grant_type: 'client_credentials',
98
98
  }),
99
99
  });
100
+ const { access_token } = await tokenResponse.json();
100
101
  ```
101
102
  2. Send the event via the event service.
102
103
  ```typescript
103
- await fetch(`${eventServiceUrl}`, {
104
+ await fetch('https://event-service.adsp.alberta.ca/event/v1/events', {
104
105
  method: 'POST',
105
106
  headers: {
106
107
  'Content-Type': 'application/json',
@@ -72,7 +72,7 @@ Additional services can be modified to use RabbitMQ for configuration cache inva
72
72
 
73
73
  ## OpenShift configuration
74
74
 
75
- References for configuration in the form of ConfigMaps and Secrets are included in the `/.openshift/configuration` directory. These resources need to be manually created within the environment with configuration values. Other deployment resources are contained in templates under the `/.openshift/managed` directory and are automatically applied by the `deliver-ci` workflow.
75
+ References for configuration in the form of ConfigMaps and Secrets are included in the `/.openshift/configuration` directory. These resources need to be manually created within the environment with configuration values. Other deployment resources are contained in templates under the `/.openshift/managed` directory and are automatically applied by the Delivery CI workflow (`.github/workflows/delivery-ci.yml`).
76
76
 
77
77
  1. Create projects for 'build', 'dev', 'uat', and 'prod' environments in OpenShift.
78
78
  2. Set appropriate values in the ConfigMaps and Secrets and apply to environments.
@@ -12,7 +12,6 @@ ADSP repository is a monorepo using [Nx](https://github.com/nrwl/nx).
12
12
 
13
13
  ```
14
14
  adsp-monorepo
15
- ├── .compose
16
15
  ├── .openshift
17
16
  └── apps
18
17
  ├── api-docs-app
@@ -25,13 +24,13 @@ adsp-monorepo
25
24
  └── tools
26
25
  ```
27
26
 
28
- Specific deployable frontend applications and backend services can be found under the `apps` folder and libraries of common modules can be found under the `libs` folder. The `.compose` and `.openshift` folders contain deployment manifests for docker compose and OpenShift. The `tests` folder contains artillery load test scenarios, the `tools` folder contains workspace templates, and the `docs` folder contains GitHub Pages content including this guide.
27
+ Specific deployable frontend applications and backend services can be found under the `apps` folder and libraries of common modules can be found under the `libs` folder. The `.openshift` folder contains OpenShift deployment manifests. The `tests` folder contains artillery load test scenarios, the `tools` folder contains workspace templates, and the `docs` folder contains GitHub Pages content including this guide.
29
28
 
30
29
  ## Building sub-projects
31
- The monorepo uses a common `package.json` across all sub-projects. Start by installing the dependencies including development dependencies.
30
+ The monorepo uses a common `package.json` across all sub-projects. Start by installing the dependencies, including development dependencies, from the lock file.
32
31
 
33
32
  ```bash
34
- npm i -D
33
+ npm ci
35
34
  ```
36
35
 
37
36
  Build (or run other targets) against specific sub-projects using:
@@ -49,17 +48,3 @@ npx nx affected --target build
49
48
  Backend services make use of the `dotenv` library and local environment can be configured by creating a `.env` file under the sub-project root folder.
50
49
 
51
50
  Frontend applications retrieve configuration as a json document from the server. Locally this can be handled via the webpack development server proxy configuration. Refer to the `proxy.conf.json` file under the sub-project.
52
-
53
- ## Running in Docker compose
54
- Manifests for running the services in docker compose can be found under the `.compose` folder. They are split across multiple files so that a subset of services can be run.
55
-
56
- The backend services use a common base docker container image that includes npm dependencies to streamline local workflow. Build the base service in `.compose/docker-compose.infra.yml` to create this base image.
57
-
58
- ```base
59
- docker-compose build base -f .compose/docker-compose.infra.yml
60
- ```
61
-
62
- Run a set of components using:
63
- ```bash
64
- docker-compose up -f .compose/docker-compose.infra.yml -f .compose/docker-compose.value.yml -f .compose/docker-compose.event.yml
65
- ```
@@ -34,6 +34,7 @@ In order to create the service account.
34
34
  1. Client `urn:ads:platform:tenant-service ` role `platform-service` is required.
35
35
  2. Client `urn:ads:platform:configuration-service` role `configured-service` is needed for registration and accessing service specific configuration
36
36
  3. Client `urn:ads:platform:event-service` role `event-sender` is needed for sending domain events.
37
+ 4. Client `urn:ads:platform:audit-service` role `audit-writer` is needed for recording audit events.
37
38
  4. Additional audiences in the service account access token are required for some capabilities:
38
39
  1. Client `urn:ads:platform:push-service` needs to be include via an audience mapper for socket based configuration cache invalidation.
39
40
 
@@ -346,6 +347,49 @@ Domain events can be sent using the event service.
346
347
  ...
347
348
  ```
348
349
 
350
+ ## Recording audit events
351
+ Audit events can be recorded using the audit service. Define the audit actions of the service in `audit_actions`; the SDK registers them as the service's action catalog on startup. Recording an action that is not in the catalog raises a `ValueError`.
352
+
353
+ `record` is non-blocking: it sends the event in the background, retries transient failures, and returns a `Future` of an `AuditRecordOutcome` (`recorded`, `rejected`, or `failed`). It does not raise for delivery failures. `audit_details_from_request` uses the current request user as the actor and the request tenant as the tenant. Core services must have a tenant for each record. Records without one are rejected with code `invalid_event`.
354
+
355
+ ```python
356
+ from adsp_service_flask_sdk import AuditAction, audit_details_from_request
357
+
358
+ HELLO_WORLD_ACTION = AuditAction(
359
+ "hello-world-requested",
360
+ "security",
361
+ "info",
362
+ description="Recorded when a hello world message is posted to the API.",
363
+ )
364
+
365
+ adsp = extension.init_app(
366
+ app,
367
+ AdspRegistration(
368
+ display_name="My platform service",
369
+ description="Hello world platform service.",
370
+ audit_actions=[HELLO_WORLD_ACTION],
371
+ )
372
+ )
373
+
374
+ # Send records still pending when the process exits.
375
+ atexit.register(adsp.audit_service.flush)
376
+
377
+ @app.route("hello-world/v1/hello")
378
+ @require_user()
379
+ def hello_world() -> str:
380
+ ...
381
+ adsp.audit_service.record(
382
+ HELLO_WORLD_ACTION,
383
+ audit_details_from_request(
384
+ resource={"type": "hello-world-message", "id": message_id},
385
+ metadata={"length": len(message)},
386
+ ),
387
+ )
388
+ ...
389
+ ```
390
+
391
+ Set the `ADSP_AUDIT_ENABLED` configuration value to `false` to disable recording. Records are then returned with a `rejected` outcome and code `disabled`.
392
+
349
393
  ## Additional utilities
350
394
  The SDK provides several other useful utilities.
351
395
 
@@ -23,14 +23,14 @@ npm i @abgov/adsp-service-sdk
23
23
  ```
24
24
 
25
25
  ## Generating service
26
- The ADSP project includes a [workspace generator](https://nx.dev/l/r/generators/workspace-generators) for creating new express based backend services. The base template includes usages of SDK capabilities and is a good starting point for understanding the SDK.
26
+ The ADSP project includes a workspace generator (in `tools/workspace-plugin`) for creating new express based backend services. The base template includes usages of SDK capabilities and is a good starting point for understanding the SDK.
27
27
 
28
28
  Generate a new service by running:
29
29
  ```bash
30
- npx nx workspace-generator adsp-service
30
+ npx nx g workspace-plugin:adsp-service
31
31
  ```
32
32
 
33
- The generate output includes sub-project structure and initial files under `/apps` as well as deployment manifests under `.openshift/managed` and `.compose`.
33
+ The generate output includes sub-project structure and initial files under `/apps` as well as deployment manifests under `.openshift/managed` and `.openshift/configuration`.
34
34
 
35
35
  ## Setting up a service account
36
36
  <!-- tags: [keycloak] -->
@@ -103,7 +103,7 @@ Core requests are used by platform services making requests to other platform se
103
103
 
104
104
  ### Service specific user roles
105
105
  <!-- tags: [keycloak] -->
106
- Keycloak issued tokens contain client roles nested under `realm_access`. Both tenant and core strategies flatten service specific roles from the token and qualifies roles related to other service clients with the client ID..
106
+ Keycloak issued tokens contain realm roles under `realm_access` and client roles nested under `resource_access`. Both tenant and core strategies flatten service specific roles from the token and qualifies roles related to other service clients with the client ID..
107
107
 
108
108
  For example:
109
109
  ```json
@@ -119,6 +119,7 @@ For example:
119
119
  For my-service, the roles are mapped to roles:
120
120
  - user
121
121
  - my-user
122
+ - my-service:my-user
122
123
  - other-service:other-user
123
124
 
124
125
  ## Determining tenancy
@@ -297,7 +298,7 @@ Defining configuration for other platform services:
297
298
  ...sdkCapabilities,
298
299
  } = await initializePlatform({
299
300
  roles: [{
300
- name: 'my-service-admin',
301
+ role: 'my-service-admin',
301
302
  description: 'Administrator role for my-service.',
302
303
  inTenantAdmin: true,
303
304
  }],
@@ -278,18 +278,18 @@ socket.on('session-expired', () => {
278
278
 
279
279
  When the provider reports token usage, the done event also includes `usage`:
280
280
 
281
- | Field | Meaning |
282
- | --------------------- | ---------------------------------------------------------------------------------------------------- |
283
- | `contextTokens` | Input tokens of the agent's last model call: how much of the context window the conversation takes up |
284
- | `contextWindowTokens` | The model's context window, from `AGENT_MODEL_CONTEXT_TOKENS` (default 256,000) |
285
- | `totalTokens` | Every token the reply used across its model calls, including calls tools make, such as form generation |
286
- | `outputTokens` | Tokens the model wrote |
287
- | `modelCalls` | Number of model calls the reply made |
281
+ | Field | Meaning |
282
+ | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
283
+ | `contextTokens` | Input tokens of the agent's last model call: how much of the context window the conversation takes up |
284
+ | `contextWindowTokens` | The model's context window, from `AGENT_MODEL_CONTEXT_TOKENS` (default 256,000) |
285
+ | `totalTokens` | Every token the reply used across its model calls, including calls tools make, such as form generation, and the prompt injection check |
286
+ | `outputTokens` | Tokens the model wrote |
287
+ | `modelCalls` | Number of model calls the reply made |
288
288
 
289
289
  After each reply, a `conversation-status` event says how the conversation stands. `state` is one of:
290
290
 
291
291
  - `ok`: nothing to tell the user.
292
- - `notice`: memory has started keeping the conversation short, which is normal but means early details may be missed. `reason` is `summarised` (observational memory has replaced older messages with notes) or `older-messages-dropped` (an agent without observational memory now reads only its most recent `messageLimit` messages).
292
+ - `notice`: memory has started keeping the conversation short, which is normal but means early details may be missed. `reason` is `summarised` (observational memory has replaced older messages with notes) or `older-messages-dropped` (an agent without observational memory now reads only its most recent `messageLimit` messages). For the Access Service agent, `reason` can also be `long-conversation`: the conversation takes up at least `AGENT_ACCESS_LONG_CONVERSATION_TOKENS` tokens (default 6,000), so a new chat would answer more cheaply.
293
293
  - `warning`: the conversation is close to what the assistant can handle well. `reason` is `near-context-limit` (it takes up at least 70% of the context window) or `notes-condensed` (observational memory has condensed its notes, which takes a very long conversation).
294
294
 
295
295
  ```typescript
@@ -302,6 +302,47 @@ socket.on('conversation-status', ({ threadId, contextTokens, contextWindowTokens
302
302
 
303
303
  Observational memory summarises older messages at `AGENT_OM_MESSAGE_TOKENS` unobserved tokens (default 30,000) and condenses its notes at `AGENT_OM_OBSERVATION_TOKENS` (default 40,000).
304
304
 
305
+ #### Shared token budget
306
+
307
+ Every agent uses the same model key, so the service can hold agents to a token budget for that key. Before a message reaches the model, the service estimates the reply from the agent's recent replies; when the estimate does not fit, the model is not called and the client gets a final stream event (`done: true`) with an error chunk with code `RATE_LIMITED` and a message saying how many seconds to wait. A rate-limit failure (HTTP 429) from the model provider during a reply is sent as an error chunk with the same code.
308
+
309
+ | Variable | Default | Meaning |
310
+ | ----------------------------------- | ------- | ---------------------------------------------------------------------------------------------- |
311
+ | `AGENT_TOKEN_LIMIT_PER_MINUTE` | `0` | Tokens per minute across all agents; `0` is off |
312
+ | `AGENT_TOKEN_LIMIT_PER_5_MINUTES` | `0` | Tokens per 5 minutes across all agents; `0` is off |
313
+ | `AGENT_TOKEN_AGENT_SHARES` | `''` | Share of each limit an agent may use, such as `AccessServiceAgent=0.3,formGenerationAgent=0.5` |
314
+ | `AGENT_USER_TOKEN_LIMIT_PER_MINUTE` | `0` | Tokens per minute for one user; `0` is off |
315
+ | `AGENT_TOKEN_WARN_RATIO` | `0.7` | Share of a limit at which a warning is logged, once each time usage crosses it |
316
+
317
+ Shares are clamped to 0..1, and malformed entries are logged and ignored. Agents without a share, or with a share of 0, are held only to the overall limits. A message holds its estimate against the budget from the moment it is allowed until its reply's usage is known, so messages sent at the same time cannot overshoot a limit; a reply that fails keeps its estimate counted until it leaves the window. Each pod enforces its own budget, so with several pods set the limits to the key's limit divided by the number of pods.
318
+
319
+ ```typescript
320
+ socket.on('stream', ({ chunk }) => {
321
+ if (chunk?.type === 'error' && chunk.payload?.code === 'RATE_LIMITED') {
322
+ console.log(chunk.payload.message); // The AI service is busy right now. Please try again in about 40 seconds.
323
+ }
324
+ });
325
+ ```
326
+
327
+ #### Access Service agent
328
+
329
+ `AccessServiceAgent` answers Access Service and Keycloak questions with read-only live tools and documented guidance. To keep each model call small:
330
+
331
+ - Each call gets only the tools and instruction sections its question needs: environment and realm tools, client and app tools, or people and role tools, picked from the predefined question hint, the question's words (an ADSP ID such as `urn:ads:platform:form-service` brings the client and app tools) and the tools used in the last few messages. A question that matches none gets every tool.
332
+ - How-to and concept questions are answered from the `getAccessGuide` tool, which returns one documented topic. The same topics are available without a model call at `GET /agent/v1/access/guide/:topic`, which returns `{ topic, title, markdown }`; the tenant admin app uses it to answer predefined questions about documented topics.
333
+ - Tool results are shown to the user as cards, so the model gets a compact summary of each result, and results from turns before the previous one are replaced with a short note in later requests (the thread keeps them). After a tool whose card fully answers a request to list or show something, the reply ends without a written answer.
334
+ - It keeps its own short history without observational memory.
335
+
336
+ | Variable | Default | Meaning |
337
+ | --------------------------------------- | ------- | --------------------------------------------------------- |
338
+ | `AGENT_ACCESS_LAST_MESSAGES` | `8` | Messages of the thread the agent reads |
339
+ | `AGENT_ACCESS_MAX_OUTPUT_TOKENS` | `1000` | Longest reply the model may write in one call |
340
+ | `AGENT_ACCESS_LONG_CONVERSATION_TOKENS` | `6000` | Context tokens at which to suggest a new chat; `0` is off |
341
+
342
+ ```bash
343
+ curl -H "Authorization: Bearer $TOKEN" "$AGENT_SERVICE_URL/agent/v1/access/guide/token-expiry"
344
+ ```
345
+
305
346
  ### Delete a thread
306
347
 
307
348
  Delete one of your own threads, with its stored messages, context, and workspace, for example when the user starts a new chat. The response is `{ "deleted": false }` when you have no thread with that ID, so repeating the request is harmless. The thread ID is the `threadId` used on socket.io.
@@ -21,6 +21,22 @@ Entities represent categories of objects found in language. Presidio is based on
21
21
  ### Recognizer
22
22
  Recognizers are extensible components used by Presidio to identify PII entities. PII service adds recognizers for Canadian bank account number, passport, postal code, and social insurance number.
23
23
 
24
+ ## Audit
25
+ Analyze and anonymize requests are recorded in the [audit service](/adsp-monorepo/services/audit-service.html) under the `pii-service` namespace. All actions use the `security` category, and their retention class is derived from it.
26
+
27
+ | Action | Severity | Recorded when |
28
+ |---|---|---|
29
+ | `text.analyzed` | info | An analyze request completes. |
30
+ | `text.anonymized` | info | An anonymize request completes. |
31
+ | `text.analyze-failed` | warning | An analyze request fails with a client error (4xx), such as an unsupported language. |
32
+ | `text.anonymize-failed` | warning | An anonymize request fails with a client error (4xx). |
33
+ | `text.analyze-errored` | critical | An analyze request fails with a service error. |
34
+ | `text.anonymize-errored` | critical | An anonymize request fails with a service error. |
35
+
36
+ The actor is the caller of the API, typically a service account (identified by its `client_id`), not the person whose text is processed. The resource is a `text-processing-request` identified by the request `correlation_id`, or a generated one if none is supplied. Metadata holds the `language`, `scoreThreshold`, the number of entities detected (`entitiesDetected`), the calling service (`azp` claim) and, for failures, the `errorType`. Client errors are recorded with status `failure` and service errors with status `error`. The submitted text, detected values and replacements are never recorded.
37
+
38
+ The service account of PII service needs the audit service writer role. Set `PII_AUDIT_ENABLED` to `false` to disable recording for this service. When it is unset, the platform-wide `AUDIT_ENABLED` variable applies, and recording is on if neither is set.
39
+
24
40
  ## Code examples
25
41
  ### Anonymize text
26
42
  ```typescript
@@ -8,7 +8,7 @@ parent: Services
8
8
 
9
9
  ## Overview
10
10
 
11
- Push service provides a push mode gateway to domain events sent through the [event service](event-service.md). Applications subscribe to a configured stream and receive matching events as they happen, using [socket.io](https://socket.io) or server-sent events, instead of polling.
11
+ Push service provides a push mode gateway to domain events sent through the [event service](event-service.md). Applications subscribe to a configured stream and receive matching events as they happen, using a WebSocket connection through [socket.io](https://socket.io), or server-sent events, instead of polling.
12
12
 
13
13
  The push service also calls tenant configured webhooks when matching domain events occur.
14
14
 
@@ -48,9 +48,9 @@ See the [API reference](https://api.adsp.alberta.ca) for request and response de
48
48
  | :------------------------------------ | :------------------------------------------------- | :------------------------------------------------------------------ |
49
49
  | `GET /stream/v1/streams` | List the streams that the caller can subscribe to. | None. The result only includes streams the caller can subscribe to. |
50
50
  | `GET /stream/v1/streams/{stream}` | Subscribe to a stream using server-sent events. | `stream-listener` or one of `subscriberRoles`, or a public stream. |
51
- | socket.io connection (not in OpenAPI) | Subscribe to a stream using socket.io. | `stream-listener` or one of `subscriberRoles`, or a public stream. |
51
+ | socket.io connection (not in OpenAPI) | Subscribe to a stream over WebSocket (socket.io). | `stream-listener` or one of `subscriberRoles`, or a public stream. |
52
52
 
53
- The socket.io connection is not a REST endpoint, so it isn't in the OpenAPI documentation. It works as follows:
53
+ The socket.io connection is a WebSocket connection, not a REST endpoint, so it isn't in the OpenAPI documentation. It works as follows:
54
54
 
55
55
  - **URL**: `https://push-service.adsp.alberta.ca/<namespace>` with the default socket.io path (`/socket.io`). The namespace is `/` (the default namespace), or a tenant name in kebab case, for example `/my-tenant`.
56
56
  - **Stream ID**: the `stream` query parameter of the connection. An optional `criteria` query parameter holds JSON encoded criteria (`correlationId`, `context`) that each event must match.
@@ -4,3 +4,47 @@ title: Services
4
4
  nav_order: 4
5
5
  has_children: true
6
6
  ---
7
+
8
+ # Services
9
+
10
+ ADSP platform services are multi-tenant APIs that product teams use instead of building the same capabilities themselves. Each service guide covers the service's client roles, tenancy, API overview, concepts, events and code examples. Request and response schemas for every API are in the [API documentation](https://api.adsp.alberta.ca).
11
+
12
+ Requests to a service are scoped to the tenant of the caller's access token. Platform (core) service accounts can act on behalf of a tenant by passing a `tenantId`. See [Tenant service](tenant-service.md) for how tenants map to realms, and [Directory service](directory-service.md) for how to look up service URLs by URN.
13
+
14
+ ## Foundation
15
+
16
+ | Service | Use it to |
17
+ | :------------------------------------------------ | :----------------------------------------------------------------- |
18
+ | [Access service](access-service.md) | Sign users in and manage roles, using a Keycloak realm per tenant. |
19
+ | [Tenant service](tenant-service.md) | Create and look up tenants. |
20
+ | [Directory service](directory-service.md) | Find service and API URLs from logical URNs. |
21
+ | [Configuration service](configuration-service.md) | Store tenant and platform configuration, with revisions. |
22
+ | [Event service](event-service.md) | Send domain events, which are logged and routed to other services. |
23
+ | [Value service](value-service.md) | Store time series values and metrics, including the event log. |
24
+ | [Push service](push-service.md) | Stream domain events to applications over WebSockets or webhooks. |
25
+
26
+ ## Application capabilities
27
+
28
+ | Service | Use it to |
29
+ | :---------------------------------------------------- | :------------------------------------------------------------------------------ |
30
+ | [Form service](form-service.md) | Define forms, and let applicants draft and submit them. |
31
+ | [File service](file-service.md) | Upload, scan and download files, with access controlled by file type. |
32
+ | [Notification service](notification-service.md) | Send email, SMS and bot notifications to subscribers when domain events happen. |
33
+ | [Task service](task-service.md) | Queue work and assign it to workers. |
34
+ | [Comment service](comment-service.md) | Add topics and comments to application records. |
35
+ | [Calendar service](calendar-service.md) | Look up dates and holidays, and schedule calendar events. |
36
+ | [PDF service](pdf-service.md) | Generate PDFs from templates. |
37
+ | [Export service](export-service.md) | Export another service's API resources to a file. |
38
+ | [Verify service](verify-service.md) | Generate and check time-limited verification codes. |
39
+ | [Feedback service](feedback-service.md) | Collect user feedback with an embeddable widget. |
40
+ | [Status service](status-service.md) | Monitor application health, publish status and post service notices. |
41
+ | [Audit service](audit-service.md) | Record and search audit records of who did what to which resource. |
42
+ | [PII service](pii-service.md) | Find and anonymize personally identifiable information in text. |
43
+ | [Cache service](cache-service.md) | Cache reads from upstream APIs within the tenant security model. |
44
+ | [Token handler](token-handler.md) | Sign users in to a browser application with a session cookie instead of tokens. |
45
+ | [Agent service](agent-service.md) | Run configurable AI agents with tools and role-based access. |
46
+ | [Project planner service](project-planner-service.md) | Turn a business problem into a plan for using ADSP services. |
47
+
48
+ ## Operations
49
+
50
+ - [Access service backup and disaster recovery](access-service-backup-disaster-recovery.md)
@@ -19,7 +19,7 @@ client `urn:ads:platform:verify-service`
19
19
 
20
20
  ## Tenancy
21
21
 
22
- - **Which tenant is used.** Tenant users and service accounts generate and verify codes in the tenant of their token, and need the role in that tenant. Core (platform) users with the role in the core realm use a separate core namespace. Verify service doesn't support the `tenantId` query parameter.
22
+ - **Which tenant is used.** Tenant users and service accounts generate and verify codes in the tenant of their token, and need the role in that tenant. Core (platform) users with the role in the core realm use a separate core namespace. Core users can set the `tenantId` query parameter to the tenant that the [audit records](#audit-actions) of the operation are attributed to, for example the tenant of the subscriber that notification service verifies; it doesn't change the core namespace of the code. Tenant users can't set it; their records are attributed to the tenant of their token.
23
23
  - **Isolation.** Keys are unique within a tenant, so two tenants can use the same key without conflict. A code generated in one tenant can't be verified from another tenant; the verification responds 200 with `verified: false`, as it does for a key that has no code.
24
24
 
25
25
  ## API overview
@@ -45,6 +45,25 @@ A code is a random 6 character string of characters that are easy to tell apart.
45
45
 
46
46
  Verify service does not send or consume domain events.
47
47
 
48
+ ## Audit actions
49
+
50
+ Verify service records audit events in the `verify-service` namespace of the [audit service](audit-service.md). The actor is the user or service account that calls the API, for example the notification service account; never the person the code was sent to. The key is the resource (`{ type: 'verify-code', id: <key> }`) and is included as `codeKey` in the metadata. The code value is never recorded. Keys are recorded as given, so prefer keys without personal data, such as a generated ID; notification service uses a random UUID. All actions are version 1, in the `security` category and retention class.
51
+
52
+ | action | category | severity | retention class | recorded when |
53
+ | :----------------------------- | :------- | :------- | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
54
+ | code.generated | security | info | security | A new code is generated at a key, with its `expiresAt` in the metadata. |
55
+ | code.verified | security | info | security | A submitted code matches the code at the key (`verified: true`). |
56
+ | code.rejected | security | warning | security | A submitted code fails verification (`verified: false`, status `failure`), with `reason` of `mismatch`, or `not-found` when the code expired, was cleared or never existed. |
57
+ | code.attempts-exceeded-cleared | security | warning | security | The code at a key is cleared after 10 failed verifications (`maxFailedVerifications` in the metadata), in addition to the `code.rejected` of the last attempt. |
58
+
59
+ Multiple `code.rejected` records and a `code.attempts-exceeded-cleared` on the same key in a short window can indicate a brute-force attempt.
60
+
61
+ Expired codes are removed by Redis without verify service being involved, so expiry isn't recorded on its own. A verification after expiry is recorded as `code.rejected` with `reason: 'not-found'`. Requests rejected for validation or missing roles aren't recorded.
62
+
63
+ Records are written to the tenant of the caller's token. Core users set the tenant with the `tenantId` query parameter; operations of core users without it have no tenant to be recorded to and aren't recorded. Audit failures are logged by the SDK and do not fail the operation. The verify service account requires the `audit-writer` role of `urn:ads:platform:audit-service`.
64
+
65
+ Audit recording is on by default. Set the environment variable `VERIFY_AUDIT_ENABLED=false` on verify service to turn it off, or `true` to turn it on regardless of the SDK `AUDIT_ENABLED` variable, which applies when `VERIFY_AUDIT_ENABLED` is not set. The action catalog is still registered while recording is off, so turning it back on needs only a restart.
66
+
48
67
  ## Code examples
49
68
 
50
69
  ### Generate a code
@@ -40,4 +40,4 @@ Probably the easiest way to build and test a new theme is:
40
40
  - clone the Access service repository, and
41
41
  - follow the instructions in the repository to build, test, and deploy your new templates.
42
42
 
43
- The Access service repository is maintained by the ADSP team in a private Government of Alberta organization, so you will need to request access before you can clone it. Please contact the ADSP team on slack (#adsp-connect) or email us at [ADSP Support](adsp@gov.ab.ca) to request access, or if you have any questions.
43
+ The Access service repository is maintained by the ADSP team in a private Government of Alberta organization, so you will need to request access before you can clone it. Please contact the ADSP team on slack (#adsp-connect) or email us at [ADSP Support](mailto:adsp@gov.ab.ca) to request access, or if you have any questions.
@@ -359,7 +359,7 @@ The agent creates display-only help blocks using Markdown:
359
359
  > **You:**
360
360
  > "Add a help block at the top of the form that says: '## Community Event Permit\nUse this form to apply for a permit to host an event on public property. **All fields marked with an asterisk are required.**\n\nFor questions, contact [permits@edmonton.ca](mailto:permits@edmonton.ca).'"
361
361
 
362
- Supports: headings, **bold**, _italic_, [links](url), bullet lists, numbered lists, and images.
362
+ Supports: headings, **bold**, _italic_, links (`[text](url)`), bullet lists, numbered lists, and images.
363
363
 
364
364
  ### Collapsible Details
365
365
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/adsp-sdk-mcp-server",
3
- "version": "1.24.1",
3
+ "version": "1.25.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - MCP server for ADSP documentation and Node SDK reference lookup.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",
@@ -14,10 +14,6 @@ const EXCLUDED_DOC_PATHS = new Set([
14
14
  'platform/platform-flask-sdk.md',
15
15
  'platform/platform-spring-sdk.md',
16
16
  ]);
17
- const STOP_WORDS = new Set([
18
- 'a', 'an', 'the', 'to', 'of', 'in', 'on', 'for', 'and', 'or', 'is', 'are',
19
- 'how', 'do', 'does', 'i', 'what', 'with', 'from', 'this', 'that', 'it', 'be',
20
- ]);
21
17
  function parseFrontmatter(raw) {
22
18
  const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(raw);
23
19
  if (!match) {
@@ -83,7 +79,7 @@ class DocsRepository {
83
79
  return doc && { path: doc.path, title: doc.title, content: doc.content };
84
80
  }
85
81
  search(query, limit = 5) {
86
- const terms = (0, textSearch_1.tokenize)(query).filter((term) => !STOP_WORDS.has(term));
82
+ const terms = (0, textSearch_1.queryTerms)(query);
87
83
  if (terms.length === 0) {
88
84
  return [];
89
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"docsRepository.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/docs/docsRepository.ts"],"names":[],"mappings":";;;AAqFA,4BASC;AA9FD,2BAA+C;AAC/C,+BAA2C;AAC3C,qDAAkF;AAelF;;GAEG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,iCAAiC;IACjC,iCAAiC;IACjC,gCAAgC;IAChC,iCAAiC;CAClC,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK;IACzE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;CAC7E,CAAC,CAAC;AAOH,SAAS,gBAAgB,CAAC,GAAW;IACnC,MAAM,KAAK,GAAG,mCAAmC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC;IAED,MAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAEjE,OAAO,EAAE,KAA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E,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;aACjC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;aACf,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;CACF;AAjCD,wCAiCC"}
package/src/metrics.js CHANGED
@@ -4,9 +4,8 @@ exports.getMetrics = getMetrics;
4
4
  exports.installMetrics = installMetrics;
5
5
  exports.startMetricsFromEnv = startMetricsFromEnv;
6
6
  exports.bucketMcpMethod = bucketMcpMethod;
7
- const fs_1 = require("fs");
8
- const path_1 = require("path");
9
7
  const perf_hooks_1 = require("perf_hooks");
8
+ const version_1 = require("./version");
10
9
  const NOOP_METRICS = {
11
10
  addInFlight: () => undefined,
12
11
  recordRejection: () => undefined,
@@ -93,14 +92,6 @@ function installMetrics(meterProvider) {
93
92
  }
94
93
  const DEFAULT_EXPORT_INTERVAL_MS = 60_000;
95
94
  const EXPORT_TIMEOUT_MS = 30_000;
96
- function readPackageVersion() {
97
- try {
98
- return JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '..', 'package.json'), 'utf8')).version ?? 'unknown';
99
- }
100
- catch {
101
- return 'unknown';
102
- }
103
- }
104
95
  function readExportIntervalMs(env) {
105
96
  const interval = parseInt(env['OTEL_METRIC_EXPORT_INTERVAL'] ?? '', 10);
106
97
  return interval > 0 ? interval : DEFAULT_EXPORT_INTERVAL_MS;
@@ -117,7 +108,7 @@ async function startMetricsFromEnv(env = process.env) {
117
108
  const { defaultResource, resourceFromAttributes } = await Promise.resolve().then(() => require('@opentelemetry/resources'));
118
109
  const exportIntervalMillis = readExportIntervalMs(env);
119
110
  const provider = new MeterProvider({
120
- resource: defaultResource().merge(resourceFromAttributes({ 'service.name': 'adsp-sdk-mcp-server', 'service.version': readPackageVersion() })),
111
+ resource: defaultResource().merge(resourceFromAttributes({ 'service.name': 'adsp-sdk-mcp-server', 'service.version': (0, version_1.readPackageVersion)() })),
121
112
  readers: [
122
113
  new PeriodicExportingMetricReader({
123
114
  exporter: new OTLPMetricExporter({ url: `${endpoint}/v1/metrics` }),
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/metrics.ts"],"names":[],"mappings":";;AAoCA,gCAEC;AAMD,wCAoFC;AAsBD,kDAuCC;AAsBD,0CASC;AA3ND,2BAAkC;AAClC,+BAA4B;AAC5B,2CAAmD;AAsBnD,MAAM,YAAY,GAAe;IAC/B,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;IAC5B,eAAe,EAAE,GAAG,EAAE,CAAC,SAAS;IAChC,aAAa,EAAE,GAAG,EAAE,CAAC,SAAS;IAC9B,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;IAC/B,mBAAmB,EAAE,GAAG,EAAE,CAAC,SAAS;IACpC,oBAAoB,EAAE,GAAG,EAAE,CAAC,SAAS;CACtC,CAAC;AAEF,IAAI,OAAO,GAAe,YAAY,CAAC;AAEvC,SAAgB,UAAU;IACxB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3F,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAEpC,SAAgB,cAAc,CAAC,aAA4B;IACzD,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC5D,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,EAAE,CAAC;IAE1F,MAAM,Q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
30
  }
31
- const terms = (0, textSearch_1.tokenize)(query);
31
+ const terms = (0, textSearch_1.queryTerms)(query);
32
32
  return reference_1.SDK_REFERENCE.map((symbol) => ({ symbol, score: scoreSymbol(symbol, normalizedQuery, terms) }))
33
33
  .filter(({ score }) => score > 0)
34
34
  .sort((a, b) => b.score - a.score)
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/sdk-reference/search.ts"],"names":[],"mappings":";;AAyBA,gDAaC;AAtCD,qDAAkF;AAClF,2CAA0D;AAE1D,SAAS,cAAc,CAAC,IAAY,EAAE,eAAuB;IAC3D,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACrC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,WAAW,CAAC,MAAoB,EAAE,eAAuB,EAAE,KAAe;IACjF,MAAM,cAAc,GAAG,IAAA,uBAAU,EAAC,IAAA,qBAAQ,EAAC,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1G,OAAO,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,eAAe,CAAC,GAAG,IAAA,iCAAoB,EAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AAClH,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,KAAa,EAAE,KAAK,GAAG,CAAC;IACzD,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnD,IAA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AAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1G,OAAO,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,eAAe,CAAC,GAAG,IAAA,iCAAoB,EAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AAClH,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,KAAa,EAAE,KAAK,GAAG,CAAC;IACzD,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,IAAA,uBAAU,EAAC,KAAK,CAAC,CAAC;IAEhC,OAAO,yBAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;SACnG,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;SAChC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;SACjC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;SACf,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Query term → extra terms searched along with it, for words people use that the docs don't (or use rarely).
3
+ * Keys and values are single lowercase tokens, as produced by `tokenize`. Expansion is one way: searching a value
4
+ * does not add its key.
5
+ */
6
+ export declare const SEARCH_ALIASES: Readonly<Record<string, readonly string[]>>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SEARCH_ALIASES = void 0;
4
+ /**
5
+ * Query term → extra terms searched along with it, for words people use that the docs don't (or use rarely).
6
+ * Keys and values are single lowercase tokens, as produced by `tokenize`. Expansion is one way: searching a value
7
+ * does not add its key.
8
+ */
9
+ exports.SEARCH_ALIASES = {
10
+ auth: ['authentication', 'authorization', 'keycloak', 'login', 'access'],
11
+ authentication: ['keycloak', 'login', 'access'],
12
+ sso: ['keycloak', 'login', 'access'],
13
+ websocket: ['socket', 'push', 'stream'],
14
+ websockets: ['websocket', 'socket', 'push', 'stream'],
15
+ realtime: ['push', 'stream', 'socket'],
16
+ upload: ['file'],
17
+ email: ['notification'],
18
+ notify: ['notification'],
19
+ };
20
+ //# sourceMappingURL=aliases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aliases.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/search/aliases.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,cAAc,GAAgD;IACzE,IAAI,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;IACxE,cAAc,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC/C,GAAG,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;IACpC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;IACvC,UAAU,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;IACrD,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC;IACtC,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,KAAK,EAAE,CAAC,cAAc,CAAC;IACvB,MAAM,EAAE,CAAC,cAAc,CAAC;CACzB,CAAC"}
@@ -1,3 +1,8 @@
1
1
  export declare function tokenize(text: string): string[];
2
2
  export declare function countTerms(tokens: string[]): Map<string, number>;
3
3
  export declare function scoreByTermFrequency(terms: string[], counts: Map<string, number>): number;
4
+ /**
5
+ * Search terms for a query: its tokens without stop words, plus their aliases. Empty when the query has no
6
+ * searchable word, e.g. "how do i".
7
+ */
8
+ export declare function queryTerms(query: string): string[];
@@ -3,6 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tokenize = tokenize;
4
4
  exports.countTerms = countTerms;
5
5
  exports.scoreByTermFrequency = scoreByTermFrequency;
6
+ exports.queryTerms = queryTerms;
7
+ const aliases_1 = require("./aliases");
8
+ // prettier-ignore
9
+ const STOP_WORDS = new Set([
10
+ 'a', 'an', 'the', 'to', 'of', 'in', 'on', 'for', 'and', 'or', 'is', 'are',
11
+ 'how', 'do', 'does', 'i', 'what', 'with', 'from', 'this', 'that', 'it', 'be',
12
+ ]);
6
13
  function tokenize(text) {
7
14
  return text.toLowerCase().match(/[a-z0-9]+/g) ?? [];
8
15
  }
@@ -16,4 +23,12 @@ function countTerms(tokens) {
16
23
  function scoreByTermFrequency(terms, counts) {
17
24
  return terms.reduce((score, term) => score + (counts.get(term) ?? 0), 0);
18
25
  }
26
+ /**
27
+ * Search terms for a query: its tokens without stop words, plus their aliases. Empty when the query has no
28
+ * searchable word, e.g. "how do i".
29
+ */
30
+ function queryTerms(query) {
31
+ const terms = tokenize(query).filter((term) => !STOP_WORDS.has(term));
32
+ return [...new Set(terms.flatMap((term) => [term, ...(aliases_1.SEARCH_ALIASES[term] ?? [])]))];
33
+ }
19
34
  //# sourceMappingURL=textSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textSearch.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/search/textSearch.ts"],"names":[],"mappings":";;AAAA,4BAEC;AAED,gCAMC;AAED,oDAEC;AAdD,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK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AC;AAED,SAAgB,UAAU,CAAC,MAAgB;IACzC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,oBAAoB,CAAC,KAAe,EAAE,MAA2B;IAC/E,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,KAAa;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,wBAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC"}
package/src/server.js CHANGED
@@ -14,6 +14,7 @@ const registerDocsTools_1 = require("./tools/registerDocsTools");
14
14
  const registerQuickstartTool_1 = require("./tools/registerQuickstartTool");
15
15
  const registerServiceRolesTool_1 = require("./tools/registerServiceRolesTool");
16
16
  const registerSdkTools_1 = require("./tools/registerSdkTools");
17
+ const version_1 = require("./version");
17
18
  // Compiled output places this file under dist/.../src/, while the docs asset copy lands one level up at dist/.../assets/docs.
18
19
  const DEFAULT_DOCS_ROOT = (0, path_1.join)(__dirname, '..', 'assets', 'docs');
19
20
  const toolsByDocsRoot = new Map();
@@ -46,7 +47,7 @@ function createAdspMcpServer(options = {}) {
46
47
  // would fix it but risks changing runtime behavior for unrelated consumers (e.g. agent-service's Mastra agent
47
48
  // config). Server + setRequestHandler avoids the SDK's zod-compat generics entirely; tools validate their own
48
49
  // args with zod as a plain value (see tools/*.ts), never passing a schema through the SDK's type machinery.
49
- const server = new index_js_1.Server({ name: 'adsp-sdk-mcp-server', version: '0.0.1' }, { capabilities: { tools: {} } });
50
+ const server = new index_js_1.Server({ name: 'adsp-sdk-mcp-server', version: (0, version_1.readPackageVersion)() }, { capabilities: { tools: {} } });
50
51
  server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
51
52
  tools: tools.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })),
52
53
  }));
package/src/server.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/server.ts"],"names":[],"mappings":";;AA6BA,4CAmBC;AAED,kDAsCC;AAxFD,wEAAmE;AACnE,iEAAmH;AACnH,+BAAqC;AACrC,2CAAyC;AACzC,0DAAuD;AACvD,uCAAsD;AACtD,6FAAyF;AACzF,yDAAqD;AACrD,iEAA4D;AAC5D,2EAAsE;AACtE,+EAA2E;AAC3E,+DAA0D;AAa1D,8HAA8H;AAC9H,MAAM,iBAAiB,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAElE,MAAM,eAAe,GAAG,IAAI,GAAG,EAAwB,CAAC;AAExD,SAAgB,gBAAgB,CAAC,UAAsC,EAAE;IACvE,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,QAAQ,IAAI,iBAAiB,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAA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C,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,aAAa,CAAC,MAAsB;IAC3C,IAAI,IAAA,4BAAY,EAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AACnD,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,OAAO,CAAC,wBAAW,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC;AAC9C,CAAC"}
@@ -2,10 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createDocsTools = createDocsTools;
4
4
  const zod_1 = require("zod");
5
+ const textSearch_1 = require("../search/textSearch");
5
6
  const SearchArgs = zod_1.z.object({
6
7
  query: zod_1.z.string(),
7
8
  limit: zod_1.z.number().int().min(1).max(20).optional(),
8
9
  });
10
+ const ListArgs = zod_1.z.object({
11
+ prefix: zod_1.z.string().optional(),
12
+ });
9
13
  const ReadArgs = zod_1.z.object({
10
14
  path: zod_1.z.string(),
11
15
  });
@@ -31,12 +35,65 @@ function createDocsTools(docs) {
31
35
  },
32
36
  handler: (args) => {
33
37
  const { query, limit } = SearchArgs.parse(args);
34
- return { content: [{ type: 'text', text: JSON.stringify(docs.search(query, limit ?? 5), null, 2) }] };
38
+ if ((0, textSearch_1.queryTerms)(query).length === 0) {
39
+ return {
40
+ content: [
41
+ {
42
+ type: 'text',
43
+ text: `"${query}" has only common words such as "how" or "the", so there is nothing to search for. ` +
44
+ 'Use a service or feature name, e.g. "send a domain event", or call list_adsp_docs to browse.',
45
+ },
46
+ ],
47
+ };
48
+ }
49
+ const results = docs.search(query, limit ?? 5);
50
+ if (results.length === 0) {
51
+ return {
52
+ content: [
53
+ {
54
+ type: 'text',
55
+ text: `No ADSP docs match "${query}". Try other keywords, or call list_adsp_docs to browse.`,
56
+ },
57
+ ],
58
+ };
59
+ }
60
+ return { content: [{ type: 'text', text: JSON.stringify(results, null, 2) }] };
61
+ },
62
+ },
63
+ {
64
+ name: 'list_adsp_docs',
65
+ description: 'List the paths and titles of every bundled ADSP doc page, optionally only those under a path prefix ' +
66
+ '(e.g. "services/" or "tutorials/"). Use it to browse what exists when keyword search misses; read a page ' +
67
+ 'with read_adsp_doc.',
68
+ inputSchema: {
69
+ type: 'object',
70
+ properties: {
71
+ prefix: {
72
+ type: 'string',
73
+ description: 'Only list doc paths that start with this, e.g. "services/".',
74
+ },
75
+ },
76
+ },
77
+ handler: (args) => {
78
+ const { prefix } = ListArgs.parse(args);
79
+ const pages = docs.list().filter(({ path }) => !prefix || path.startsWith(prefix));
80
+ if (pages.length === 0) {
81
+ return {
82
+ content: [
83
+ {
84
+ type: 'text',
85
+ text: `No doc paths start with "${prefix}". Call list_adsp_docs without a prefix to see all.`,
86
+ },
87
+ ],
88
+ };
89
+ }
90
+ return { content: [{ type: 'text', text: JSON.stringify(pages, null, 2) }] };
35
91
  },
36
92
  },
37
93
  {
38
94
  name: 'read_adsp_doc',
39
- description: 'Return the full markdown content of an ADSP doc page by its path, as returned by search_adsp_docs.',
95
+ description: 'Return the full markdown content of an ADSP doc page by its path, as returned by search_adsp_docs or ' +
96
+ 'list_adsp_docs.',
40
97
  inputSchema: {
41
98
  type: 'object',
42
99
  properties: {
@@ -55,7 +112,10 @@ function createDocsTools(docs) {
55
112
  return {
56
113
  isError: true,
57
114
  content: [
58
- { type: 'text', text: `No doc found at path "${path}". Use search_adsp_docs to find a valid path.` },
115
+ {
116
+ type: 'text',
117
+ text: `No doc found at path "${path}". Use search_adsp_docs or list_adsp_docs to find a valid path.`,
118
+ },
59
119
  ],
60
120
  };
61
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"registerDocsTools.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/registerDocsTools.ts"],"names":[],"mappings":";;AAaA,0CAwDC;AAr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E;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,6CAA6C;qBAC3D;iBACF;gBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;aACnB;YACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACtC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5B,IAAI,CAAC,GAAG,EAAE,CAAC;oBACT,8HAA8H;oBAC9H,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE;4BACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,IAAI,+CAA+C,EAAE;yBACrG;qBACF,CAAC;gBACJ,CAAC;gBAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC;YACnF,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"registerDocsTools.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/registerDocsTools.ts"],"names":[],"mappings":";;AAkBA,0CAsHC;AAxID,6BAAwB;AAExB,qDAAkD;AAGlD,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,OAAC,CAAC,MAAM,CAAC;IACxB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CA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,EAAE,6CAA6C;qBAC3D;iBACF;gBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;aACnB;YACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACtC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5B,IAAI,CAAC,GAAG,EAAE,CAAC;oBACT,8HAA8H;oBAC9H,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE;4BACP;gCACE,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,yBAAyB,IAAI,iEAAiE;6BACrG;yBACF;qBACF,CAAC;gBACJ,CAAC;gBAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC;YACnF,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Version of this package, read at runtime from the package.json next to `src/`.
3
+ *
4
+ * Read at runtime rather than imported: semantic-release writes the release version into the dist package.json
5
+ * after the build, so a build-time import would capture the placeholder version in the source package.json.
6
+ */
7
+ export declare function readPackageVersion(): string;
package/src/version.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readPackageVersion = readPackageVersion;
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
6
+ /**
7
+ * Version of this package, read at runtime from the package.json next to `src/`.
8
+ *
9
+ * Read at runtime rather than imported: semantic-release writes the release version into the dist package.json
10
+ * after the build, so a build-time import would capture the placeholder version in the source package.json.
11
+ */
12
+ function readPackageVersion() {
13
+ try {
14
+ return JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '..', 'package.json'), 'utf8')).version ?? 'unknown';
15
+ }
16
+ catch {
17
+ return 'unknown';
18
+ }
19
+ }
20
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/version.ts"],"names":[],"mappings":";;AASA,gDAMC;AAfD,2BAAkC;AAClC,+BAA4B;AAE5B;;;;;GAKG;AACH,SAAgB,kBAAkB;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,IAAI,SAAS,CAAC;IACtG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}