@abgov/adsp-sdk-mcp-server 0.0.1 → 1.1.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 +8 -2
- package/package.json +2 -2
- package/src/index.d.ts +5 -0
- package/src/index.js +11 -0
- package/src/index.js.map +1 -0
- package/src/sdk-reference/reference.js +31 -25
- package/src/sdk-reference/reference.js.map +1 -1
- package/src/tools/registerQuickstartTool.js +24 -14
- package/src/tools/registerQuickstartTool.js.map +1 -1
package/README.md
CHANGED
|
@@ -12,11 +12,17 @@ and exposes them over stdio via four tools:
|
|
|
12
12
|
- `read_adsp_doc` — read the full content of a doc page found via search.
|
|
13
13
|
- `search_sdk_reference` — search `@abgov/adsp-service-sdk` by symbol name, module, or keyword; returns full symbol
|
|
14
14
|
details (kind, description, option/return shape, example, deprecated flag).
|
|
15
|
-
- `get_platform_quickstart` — the canonical `
|
|
16
|
-
most common question: how to start using ADSP from a
|
|
15
|
+
- `get_platform_quickstart` — the canonical `initializeService` usage pattern (the common case for a tenant service
|
|
16
|
+
built on top of ADSP) and a capabilities summary, for the most common question: how to start using ADSP from a
|
|
17
|
+
Node service.
|
|
17
18
|
|
|
18
19
|
This package covers the Node SDK only. Other language SDKs (`.NET`, Django, Flask, Spring) are out of scope for now.
|
|
19
20
|
|
|
21
|
+
The SDK has two entry points for two different kinds of service: `initializeService` for tenant services (the
|
|
22
|
+
primary audience for this package — product teams building on top of ADSP) and `initializePlatform` for cross-tenant
|
|
23
|
+
platform services (the ones that live in this monorepo, e.g. `directory-service`, `configuration-service`). Content
|
|
24
|
+
here is weighted toward `initializeService` accordingly.
|
|
25
|
+
|
|
20
26
|
## Usage
|
|
21
27
|
|
|
22
28
|
Add it to your MCP client's server config, run via `npx`:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/adsp-sdk-mcp-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.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",
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
"types": "./src/main.d.ts",
|
|
16
16
|
"main": "./src/main.js",
|
|
17
17
|
"type": "commonjs"
|
|
18
|
-
}
|
|
18
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DocsRepository, loadDocs } from './docs/docsRepository';
|
|
2
|
+
export type { AdspDoc, AdspDocSearchResult } from './docs/docsRepository';
|
|
3
|
+
export { SDK_REFERENCE } from './sdk-reference/reference';
|
|
4
|
+
export type { SdkSymbolDoc, SdkSymbolKind } from './sdk-reference/reference';
|
|
5
|
+
export { searchSdkReference } from './sdk-reference/search';
|
package/src/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchSdkReference = exports.SDK_REFERENCE = exports.loadDocs = exports.DocsRepository = void 0;
|
|
4
|
+
var docsRepository_1 = require("./docs/docsRepository");
|
|
5
|
+
Object.defineProperty(exports, "DocsRepository", { enumerable: true, get: function () { return docsRepository_1.DocsRepository; } });
|
|
6
|
+
Object.defineProperty(exports, "loadDocs", { enumerable: true, get: function () { return docsRepository_1.loadDocs; } });
|
|
7
|
+
var reference_1 = require("./sdk-reference/reference");
|
|
8
|
+
Object.defineProperty(exports, "SDK_REFERENCE", { enumerable: true, get: function () { return reference_1.SDK_REFERENCE; } });
|
|
9
|
+
var search_1 = require("./sdk-reference/search");
|
|
10
|
+
Object.defineProperty(exports, "searchSdkReference", { enumerable: true, get: function () { return search_1.searchSdkReference; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/index.ts"],"names":[],"mappings":";;;AAAA,wDAAiE;AAAxD,gHAAA,cAAc,OAAA;AAAE,0GAAA,QAAQ,OAAA;AAEjC,uDAA0D;AAAjD,0GAAA,aAAa,OAAA;AAEtB,iDAA4D;AAAnD,4GAAA,kBAAkB,OAAA"}
|
|
@@ -9,27 +9,26 @@ exports.SDK_REFERENCE = void 0;
|
|
|
9
9
|
exports.SDK_REFERENCE = [
|
|
10
10
|
// initialize
|
|
11
11
|
{
|
|
12
|
-
name: '
|
|
12
|
+
name: 'initializeService',
|
|
13
13
|
kind: 'function',
|
|
14
14
|
module: 'initialize',
|
|
15
|
-
summary: "SDK's main entry point for a
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
'relevant platform services (see ServiceRegistration).',
|
|
26
|
-
example: "import { AdspId, initializePlatform } from '@abgov/adsp-service-sdk';\n\n" +
|
|
15
|
+
summary: "SDK's main entry point for a tenant service — the typical way a product team consumes this SDK, since " +
|
|
16
|
+
'platform services already live in the ADSP core-services monorepo and use initializePlatform instead.',
|
|
17
|
+
details: 'async initializeService(options: Omit<PlatformOptions, "ignoreServiceAud">, logOptions: Logger | LogOptions): ' +
|
|
18
|
+
'Promise<Capabilities>\n\n' +
|
|
19
|
+
'Unlike the root initializePlatform (which fixes realm to "core"), options.realm here is your tenant\'s realm ' +
|
|
20
|
+
'(visible in Tenant Admin, or the realm name you set up your service client under in Keycloak). Resolves the ' +
|
|
21
|
+
"service's single tenant via tenantService.getTenants()[0] and returns a reshaped capability set: same as " +
|
|
22
|
+
'PlatformCapabilities but without tenantService/tenantHandler, and clearCached is reshaped to ' +
|
|
23
|
+
'(serviceId: AdspId) => void (tenant is implicit).',
|
|
24
|
+
example: "import { AdspId, initializeService } from '@abgov/adsp-service-sdk';\n\n" +
|
|
27
25
|
"const serviceId = AdspId.parse(environment.CLIENT_ID);\n" +
|
|
28
|
-
"const { coreStrategy, tenantStrategy, ...sdkCapabilities } = await
|
|
26
|
+
"const { coreStrategy, tenantStrategy, ...sdkCapabilities } = await initializeService(\n" +
|
|
29
27
|
" {\n" +
|
|
30
|
-
" displayName: 'My
|
|
31
|
-
" description: 'Example of a
|
|
28
|
+
" displayName: 'My tenant service',\n" +
|
|
29
|
+
" description: 'Example of a service built on top of ADSP.',\n" +
|
|
32
30
|
" serviceId,\n" +
|
|
31
|
+
" realm: environment.TENANT_REALM,\n" +
|
|
33
32
|
" accessServiceUrl: new URL(environment.KEYCLOAK_ROOT_URL),\n" +
|
|
34
33
|
" clientSecret: environment.CLIENT_SECRET,\n" +
|
|
35
34
|
" directoryUrl: new URL(environment.DIRECTORY_URL),\n" +
|
|
@@ -40,19 +39,26 @@ exports.SDK_REFERENCE = [
|
|
|
40
39
|
" },\n" +
|
|
41
40
|
" { logger }\n" +
|
|
42
41
|
");",
|
|
43
|
-
seeAlso: ['
|
|
42
|
+
seeAlso: ['initializePlatform', 'ServiceRegistration'],
|
|
44
43
|
},
|
|
45
44
|
{
|
|
46
|
-
name: '
|
|
45
|
+
name: 'initializePlatform',
|
|
47
46
|
kind: 'function',
|
|
48
47
|
module: 'initialize',
|
|
49
|
-
summary: 'Entry point for a
|
|
50
|
-
|
|
51
|
-
'
|
|
52
|
-
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
|
|
48
|
+
summary: 'Entry point for a multi-tenant platform service (the kind that lives in the ADSP core-services monorepo ' +
|
|
49
|
+
'alongside directory-service, configuration-service, etc). Most product teams building on ADSP want ' +
|
|
50
|
+
'initializeService instead — use this only if you are building a new cross-tenant platform capability.',
|
|
51
|
+
details: 'async initializePlatform(options: PlatformOptions, logOptions: Logger | LogOptions, services?: Partial<PlatformServices>): Promise<PlatformCapabilities>\n\n' +
|
|
52
|
+
'Fixes realm to "core". options extends ServiceRegistration with: clientSecret, directoryUrl, accessServiceUrl, ' +
|
|
53
|
+
'ignoreServiceAud?, configurationConverter?, combineConfiguration?, enableConfigurationInvalidation?, ' +
|
|
54
|
+
'useLongConfigurationCacheTTL?, additionalExtractors?, tracing? (TracingOptions | OTLP endpoint string), ' +
|
|
55
|
+
'metrics? (MetricsOptions | OTLP endpoint string).\n\n' +
|
|
56
|
+
'Returns PlatformCapabilities: directory, tenantService, configurationService, eventService, tokenProvider, ' +
|
|
57
|
+
'coreStrategy, tenantStrategy, tenantHandler, configurationHandler, healthCheck, clearCached(tenantId, serviceId), ' +
|
|
58
|
+
'metricsHandler, traceHandler, tracerProvider? (only if tracing enabled), meterProvider? (only if metrics enabled), logger.\n\n' +
|
|
59
|
+
'Also triggers a fire-and-forget registration of roles/events/configuration schema/notifications/etc with the ' +
|
|
60
|
+
'relevant platform services (see ServiceRegistration).',
|
|
61
|
+
seeAlso: ['initializeService', 'ServiceRegistration'],
|
|
56
62
|
},
|
|
57
63
|
// access
|
|
58
64
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/sdk-reference/reference.ts"],"names":[],"mappings":";;;AAaA;;;;GAIG;AACU,QAAA,aAAa,GAAmB;IAC3C,aAAa;IACb;QACE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/sdk-reference/reference.ts"],"names":[],"mappings":";;;AAaA;;;;GAIG;AACU,QAAA,aAAa,GAAmB;IAC3C,aAAa;IACb;QACE,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,YAAY;QACpB,OAAO,EACL,wGAAwG;YACxG,uGAAuG;QACzG,OAAO,EACL,gHAAgH;YAChH,2BAA2B;YAC3B,+GAA+G;YAC/G,8GAA8G;YAC9G,2GAA2G;YAC3G,+FAA+F;YAC/F,mD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AAO,EAAE,+DAA+D;QACxE,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;KAC5B;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,qEAAqE;QAC9E,OAAO,EAAE,0DAA0D;QACnE,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,WAAW,CAAC;KACvB;IACD;QACE,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,0FAA0F;QACnG,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,iBAAiB,CAAC;KAC7B;IAED,QAAQ;IACR;QACE,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,sGAAsG;QAC/G,OAAO,EAAE,kDAAkD;KAC5D;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,2EAA2E;QACpF,OAAO,EAAE,6HAA6H;QACtI,OAAO,EAAE,0BAA0B;KACpC;CACF,CAAC"}
|
|
@@ -3,23 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createQuickstartTool = createQuickstartTool;
|
|
4
4
|
const QUICKSTART = `# Getting started with @abgov/adsp-service-sdk (Node)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
The SDK has two entry points for two different kinds of service. Most product teams building on ADSP want
|
|
7
|
+
**\`initializeService\`** — use that unless you are specifically building a new cross-tenant platform capability
|
|
8
|
+
(the kind that lives in the ADSP core-services monorepo itself, e.g. directory-service, configuration-service).
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
## 1. Initialize the SDK (tenant service)
|
|
11
|
+
|
|
12
|
+
Call \`initializeService\` once at startup, with your tenant's realm:
|
|
9
13
|
|
|
10
14
|
\`\`\`typescript
|
|
11
|
-
import { AdspId,
|
|
15
|
+
import { AdspId, initializeService } from '@abgov/adsp-service-sdk';
|
|
12
16
|
|
|
13
17
|
const serviceId = AdspId.parse(environment.CLIENT_ID);
|
|
14
18
|
const {
|
|
15
19
|
coreStrategy,
|
|
16
20
|
tenantStrategy,
|
|
17
21
|
...sdkCapabilities
|
|
18
|
-
} = await
|
|
22
|
+
} = await initializeService(
|
|
19
23
|
{
|
|
20
|
-
displayName: 'My
|
|
21
|
-
description: 'Example of a
|
|
24
|
+
displayName: 'My tenant service',
|
|
25
|
+
description: 'Example of a service built on top of ADSP.',
|
|
22
26
|
serviceId,
|
|
27
|
+
realm: environment.TENANT_REALM,
|
|
23
28
|
accessServiceUrl: new URL(environment.KEYCLOAK_ROOT_URL),
|
|
24
29
|
clientSecret: environment.CLIENT_SECRET,
|
|
25
30
|
directoryUrl: new URL(environment.DIRECTORY_URL),
|
|
@@ -32,25 +37,29 @@ const {
|
|
|
32
37
|
);
|
|
33
38
|
\`\`\`
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
\`realm\` is your tenant's Keycloak realm — visible in Tenant Admin, or the realm you created your service client
|
|
41
|
+
under. (If you're instead building a cross-tenant platform service, use \`initializePlatform\` — same options minus
|
|
42
|
+
\`realm\`, which is fixed to \`"core"\`; it additionally returns \`tenantService\`/\`tenantHandler\` since it serves many
|
|
43
|
+
tenants.)
|
|
37
44
|
|
|
38
45
|
## 2. What you get back
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
Both entry points return capabilities you wire into your Express app:
|
|
41
48
|
|
|
42
49
|
| Capability | Purpose |
|
|
43
50
|
|---|---|
|
|
44
51
|
| \`directory\` | Look up other service/API URLs by ADSP URN |
|
|
45
|
-
| \`tenantService\` | Look up tenant records |
|
|
46
52
|
| \`configurationService\` | Retrieve tenant/core configuration |
|
|
47
53
|
| \`eventService\` | Send domain events |
|
|
48
54
|
| \`tokenProvider\` | Get this service's own access token |
|
|
49
55
|
| \`coreStrategy\` / \`tenantStrategy\` | Passport strategies to validate incoming tokens |
|
|
50
|
-
| \`
|
|
56
|
+
| \`configurationHandler\` | Express middleware setting \`req.getConfiguration()\` |
|
|
51
57
|
| \`healthCheck\` | Function to check platform dependency health |
|
|
52
58
|
| \`metricsHandler\` / \`traceHandler\` | Request instrumentation middleware |
|
|
53
59
|
|
|
60
|
+
(\`initializePlatform\` additionally returns \`tenantService\` and \`tenantHandler\`, since a platform service serves
|
|
61
|
+
many tenants and needs to resolve which one a request belongs to.)
|
|
62
|
+
|
|
54
63
|
## 3. Registering what your service needs
|
|
55
64
|
|
|
56
65
|
Pass \`roles\`, \`events\`, \`configuration\`, \`eventStreams\`, \`fileTypes\`, \`notifications\`, and/or \`values\` on the options
|
|
@@ -71,9 +80,10 @@ function createQuickstartTool() {
|
|
|
71
80
|
return [
|
|
72
81
|
{
|
|
73
82
|
name: 'get_platform_quickstart',
|
|
74
|
-
description: 'Returns the canonical
|
|
75
|
-
'
|
|
76
|
-
'
|
|
83
|
+
description: 'Returns the canonical initializeService usage pattern for a new Node service built on top of ADSP (the ' +
|
|
84
|
+
'common case for product teams), notes the initializePlatform variant for cross-tenant platform services, ' +
|
|
85
|
+
'and summarizes the capabilities returned. Use this first for the most common question: how to start using ' +
|
|
86
|
+
'ADSP from a Node service.',
|
|
77
87
|
inputSchema: { type: 'object', properties: {} },
|
|
78
88
|
handler: () => ({ content: [{ type: 'text', text: QUICKSTART }] }),
|
|
79
89
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerQuickstartTool.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/registerQuickstartTool.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"registerQuickstartTool.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/registerQuickstartTool.ts"],"names":[],"mappings":";;AA8EA,oDAaC;AAzFD,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ElB,CAAC;AAEF,SAAgB,oBAAoB;IAClC,OAAO;QACL;YACE,IAAI,EAAE,yBAAyB;YAC/B,WAAW,EACT,yGAAyG;gBACzG,2GAA2G;gBAC3G,4GAA4G;gBAC5G,2BAA2B;YAC7B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;YAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;SACnE;KACF,CAAC;AACJ,CAAC"}
|