@abgov/adsp-sdk-mcp-server 1.25.0 → 1.26.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 +24 -2
- package/package.json +1 -1
- package/provenance.json +12 -0
- package/src/server.js +4 -1
- package/src/server.js.map +1 -1
- package/src/tools/registerServerInfoTool.d.ts +20 -0
- package/src/tools/registerServerInfoTool.js +48 -0
- package/src/tools/registerServerInfoTool.js.map +1 -0
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ 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
|
|
8
|
+
and exposes them over stdio via eight tools:
|
|
9
9
|
|
|
10
10
|
- `search_adsp_docs` — keyword search across ADSP platform docs (getting started, architecture, service concepts,
|
|
11
11
|
tutorials). Common words people use that the docs don't, such as `websocket` or `auth`, also search for the
|
|
@@ -23,6 +23,9 @@ and exposes them over stdio via seven tools:
|
|
|
23
23
|
instead of defaulting to an admin role.
|
|
24
24
|
- `get_service_configuration_schema` — **live.** Reads platform services' configuration schemas from
|
|
25
25
|
configuration-service, for the shape of `serviceConfigurations` entries in `initializeService`.
|
|
26
|
+
- `get_adsp_mcp_server_info` — this server's version and where its bundled content came from: the docs source
|
|
27
|
+
commit, the `@abgov/adsp-service-sdk` version the SDK reference matches, and the release time. Lets an agent warn
|
|
28
|
+
that an answer may be stale.
|
|
26
29
|
|
|
27
30
|
The two live tools require logging in first (see below). Everything else in this package works fully offline with no
|
|
28
31
|
setup.
|
|
@@ -137,7 +140,7 @@ OpenTelemetry SDK isn't loaded. Stdio mode never exports metrics.
|
|
|
137
140
|
|
|
138
141
|
Every label takes a value from a fixed set:
|
|
139
142
|
|
|
140
|
-
- `mcp.tool.name`: one of the
|
|
143
|
+
- `mcp.tool.name`: one of the eight tool names, or `unknown` for any name the server doesn't have.
|
|
141
144
|
- `mcp.method.name`: an MCP method such as `initialize`, `tools/list` or `tools/call`; `other` for any other method;
|
|
142
145
|
`batch` for a JSON-RPC batch; `unparsed` when the body wasn't valid JSON-RPC or was too large.
|
|
143
146
|
- `error.type` on `mcp.request.duration`: `aborted` when the client disconnected before the response was written; the
|
|
@@ -177,6 +180,25 @@ nx test adsp-sdk-mcp-server
|
|
|
177
180
|
nx lint adsp-sdk-mcp-server
|
|
178
181
|
```
|
|
179
182
|
|
|
183
|
+
### Refresh workflow
|
|
184
|
+
|
|
185
|
+
The bundled content is refreshed from source on every release, not fetched live:
|
|
186
|
+
|
|
187
|
+
- **Docs.** The build copies `docs/**/*.md` into the package. `src/docs/docs-lock.json` fingerprints those pages, and
|
|
188
|
+
`src/docs/docsLock.spec.ts` fails CI when `docs/` changes without it. In a PR that changes `docs/`, run
|
|
189
|
+
`npx nx run adsp-sdk-mcp-server:update-docs-lock` and commit the lock. The lock is inside this package, so the
|
|
190
|
+
change releases it: `.releaserc.json` releases a patch for `docs` commits as well as `feat` and `fix`.
|
|
191
|
+
- **SDK reference.** Maintained by hand, and checked against the SDK source (below).
|
|
192
|
+
- **Provenance.** The `release` target runs `scripts/provenance.mjs` before publishing. It writes
|
|
193
|
+
`provenance.json` into the package with the source commit, the last commit to `docs/`, the latest
|
|
194
|
+
`adsp-service-sdk` release tag and whether the SDK source has changed since. `get_adsp_mcp_server_info` reports it,
|
|
195
|
+
and reports no provenance when running from source or a local build.
|
|
196
|
+
- **Hosted builds from a branch** (the ARO deployment in `GovAlta-EMU/osp-mcp-servers` builds `main`, not a
|
|
197
|
+
release) run `node libs/adsp-sdk-mcp-server/scripts/provenance.mjs --source-build` after `nx build`, with a
|
|
198
|
+
`fetch-depth: 0` checkout. It records the same provenance and sets the built version to
|
|
199
|
+
`<latest release>+<branch>.<short sha>`, e.g. `1.25.0+main.8b3ef02`, instead of the source `package.json`
|
|
200
|
+
placeholder.
|
|
201
|
+
|
|
180
202
|
`src/sdk-reference/reference.ts` is maintained by hand. `reference.spec.ts` reads the root exports of
|
|
181
203
|
`libs/adsp-service-sdk/src/index.ts` with the TypeScript compiler and fails when the reference drifts: a missing or
|
|
182
204
|
stale name, or a different kind, module or deprecated flag, or a `seeAlso` with no entry. When you change what the SDK
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/adsp-sdk-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.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",
|
package/provenance.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "release",
|
|
3
|
+
"builtAt": "2026-11-13T14:24:53.294Z",
|
|
4
|
+
"sourceCommit": "2fe2208f313fc1eaf0b0d28d94d2d4da4a94d180",
|
|
5
|
+
"latestRelease": "1.25.0",
|
|
6
|
+
"docsCommit": "ad6633793c20fd1a737240a87a5d6634e0cad6db",
|
|
7
|
+
"sdk": {
|
|
8
|
+
"version": "2.36.1",
|
|
9
|
+
"commit": "dd58a2b854c4406b42c0604dba3fa4b941038d6c",
|
|
10
|
+
"unreleasedChanges": false
|
|
11
|
+
}
|
|
12
|
+
}
|
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 registerServerInfoTool_1 = require("./tools/registerServerInfoTool");
|
|
17
18
|
const version_1 = require("./version");
|
|
18
19
|
// Compiled output places this file under dist/.../src/, while the docs asset copy lands one level up at dist/.../assets/docs.
|
|
19
20
|
const DEFAULT_DOCS_ROOT = (0, path_1.join)(__dirname, '..', 'assets', 'docs');
|
|
@@ -25,12 +26,14 @@ function loadAdspMcpTools(options = {}) {
|
|
|
25
26
|
return cached;
|
|
26
27
|
}
|
|
27
28
|
const started = perf_hooks_1.performance.now();
|
|
29
|
+
const docs = new docsRepository_1.DocsRepository(docsRoot);
|
|
28
30
|
const tools = [
|
|
29
|
-
...(0, registerDocsTools_1.createDocsTools)(
|
|
31
|
+
...(0, registerDocsTools_1.createDocsTools)(docs),
|
|
30
32
|
...(0, registerSdkTools_1.createSdkTools)(),
|
|
31
33
|
...(0, registerQuickstartTool_1.createQuickstartTool)(),
|
|
32
34
|
...(0, registerServiceRolesTool_1.createServiceRolesTools)(),
|
|
33
35
|
...(0, registerConfigurationSchemaTool_1.createConfigurationSchemaTools)(),
|
|
36
|
+
...(0, registerServerInfoTool_1.createServerInfoTool)(docs),
|
|
34
37
|
];
|
|
35
38
|
const loaded = { tools, toolsByName: new Map(tools.map((tool) => [tool.name, tool])) };
|
|
36
39
|
toolsByDocsRoot.set(docsRoot, loaded);
|
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":";;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/server.ts"],"names":[],"mappings":";;AA+BA,4CAqBC;AAED,kDAyCC;AA/FD,wEAAmE;AACnE,iEAAmH;AACnH,+BAAqC;AACrC,2CAAyC;AACzC,0DAAuD;AACvD,uCAAsD;AACtD,6FAAyF;AACzF,yDAAqD;AACrD,iEAA4D;AAC5D,2EAAsE;AACtE,+EAA2E;AAC3E,+DAA0D;AAC1D,2EAAsE;AAEtE,uCAA+C;AAY/C,8HAA8H;AAC9H,MAAM,iBAAiB,GA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AG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;YAC5F,IAAA,oBAAU,GAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;YACrF,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAA,oBAAU,GAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;YAC3E,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DocsRepository } from '../docs/docsRepository';
|
|
2
|
+
import { ToolDefinition } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Written by scripts/provenance.mjs into the package root, next to package.json: by the release target (`release`),
|
|
5
|
+
* or by a deployment that builds from a branch (`source`).
|
|
6
|
+
*/
|
|
7
|
+
export interface Provenance {
|
|
8
|
+
kind: 'release' | 'source';
|
|
9
|
+
builtAt: string;
|
|
10
|
+
sourceCommit: string | null;
|
|
11
|
+
latestRelease: string | null;
|
|
12
|
+
docsCommit: string | null;
|
|
13
|
+
sdk: {
|
|
14
|
+
version: string | null;
|
|
15
|
+
commit: string | null;
|
|
16
|
+
unreleasedChanges: boolean | null;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare function readProvenance(path?: string): Provenance | null;
|
|
20
|
+
export declare function createServerInfoTool(docs: DocsRepository, provenance?: Provenance): ToolDefinition[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readProvenance = readProvenance;
|
|
4
|
+
exports.createServerInfoTool = createServerInfoTool;
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const reference_1 = require("../sdk-reference/reference");
|
|
8
|
+
const version_1 = require("../version");
|
|
9
|
+
const PROVENANCE_PATH = (0, path_1.join)(__dirname, '..', '..', 'provenance.json');
|
|
10
|
+
function readProvenance(path = PROVENANCE_PATH) {
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse((0, fs_1.readFileSync)(path, 'utf8'));
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function describeProvenance(provenance) {
|
|
19
|
+
if (!provenance) {
|
|
20
|
+
return 'No provenance recorded: this server is running from source or a local build.';
|
|
21
|
+
}
|
|
22
|
+
const asOf = `Docs and the SDK reference are as of ${provenance.builtAt}`;
|
|
23
|
+
const source = provenance.kind === 'source'
|
|
24
|
+
? `, built from source commit ${provenance.sourceCommit ?? 'unknown'} after release ${provenance.latestRelease ?? 'unknown'}`
|
|
25
|
+
: '';
|
|
26
|
+
return (`${asOf}${source}. The live docs are at https://govalta.github.io/adsp-monorepo; a newer version may have ` +
|
|
27
|
+
'newer content.');
|
|
28
|
+
}
|
|
29
|
+
function createServerInfoTool(docs, provenance = readProvenance()) {
|
|
30
|
+
const info = {
|
|
31
|
+
name: 'adsp-sdk-mcp-server',
|
|
32
|
+
version: (0, version_1.readPackageVersion)(),
|
|
33
|
+
provenance,
|
|
34
|
+
bundled: { docPages: docs.list().length, sdkReferenceSymbols: reference_1.SDK_REFERENCE.length },
|
|
35
|
+
note: describeProvenance(provenance),
|
|
36
|
+
};
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
name: 'get_adsp_mcp_server_info',
|
|
40
|
+
description: "Report this server's version and where its bundled content came from: the docs source commit, the " +
|
|
41
|
+
'@abgov/adsp-service-sdk version the SDK reference matches, and when it was built. Use it to tell a user ' +
|
|
42
|
+
'when an answer may be stale.',
|
|
43
|
+
inputSchema: { type: 'object', properties: {} },
|
|
44
|
+
handler: () => ({ content: [{ type: 'text', text: JSON.stringify(info, null, 2) }] }),
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=registerServerInfoTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerServerInfoTool.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/registerServerInfoTool.ts"],"names":[],"mappings":";;AAsBA,wCAMC;AAkBD,oDAoBC;AAlED,2BAAkC;AAClC,+BAA4B;AAE5B,0DAA2D;AAC3D,wCAAgD;AAgBhD,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;AAEvE,SAAgB,cAAc,CAAC,IAAI,GAAG,eAAe;IACnD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,UAA6B;IACvD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,8EAA8E,CAAC;IACx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