@abgov/adsp-sdk-mcp-server 0.0.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 +51 -0
- package/assets/docs/architecture.md +79 -0
- package/assets/docs/getting-started.md +118 -0
- package/assets/docs/important-notes.md +47 -0
- package/assets/docs/index.md +9 -0
- package/assets/docs/platform/deployment.md +80 -0
- package/assets/docs/platform/getting-started.md +66 -0
- package/assets/docs/platform/operations.md +8 -0
- package/assets/docs/platform/platform-django-sdk.md +330 -0
- package/assets/docs/platform/platform-dotnet-sdk.md +457 -0
- package/assets/docs/platform/platform-flask-sdk.md +355 -0
- package/assets/docs/platform/platform-node-sdk.md +433 -0
- package/assets/docs/platform/platform-spring-sdk.md +344 -0
- package/assets/docs/platform/platform.md +8 -0
- package/assets/docs/services/access-service.md +75 -0
- package/assets/docs/services/agent-service.md +316 -0
- package/assets/docs/services/cache-service.md +61 -0
- package/assets/docs/services/calendar-service.md +86 -0
- package/assets/docs/services/comment-service.md +87 -0
- package/assets/docs/services/configuration-service.md +92 -0
- package/assets/docs/services/directory-service.md +57 -0
- package/assets/docs/services/event-service.md +122 -0
- package/assets/docs/services/feedback-service.md +152 -0
- package/assets/docs/services/file-service.md +164 -0
- package/assets/docs/services/form-service.md +149 -0
- package/assets/docs/services/notification-service.md +151 -0
- package/assets/docs/services/pdf-service.md +116 -0
- package/assets/docs/services/pii-service.md +45 -0
- package/assets/docs/services/push-service.md +106 -0
- package/assets/docs/services/services.md +6 -0
- package/assets/docs/services/status-service.md +29 -0
- package/assets/docs/services/task-service.md +139 -0
- package/assets/docs/services/tenant-service.md +18 -0
- package/assets/docs/services/token-handler.md +135 -0
- package/assets/docs/services/value-service.md +80 -0
- package/assets/docs/services/verify-service.md +61 -0
- package/assets/docs/tutorials/access-service/access-service.md +9 -0
- package/assets/docs/tutorials/access-service/adsp-clients.md +29 -0
- package/assets/docs/tutorials/access-service/application-clients.md +61 -0
- package/assets/docs/tutorials/access-service/front-end-access.md +53 -0
- package/assets/docs/tutorials/access-service/introduction.md +33 -0
- package/assets/docs/tutorials/access-service/tenants.md +68 -0
- package/assets/docs/tutorials/access-service/themes.md +43 -0
- package/assets/docs/tutorials/feedback-service/accessing-data.md +41 -0
- package/assets/docs/tutorials/feedback-service/feedback-service.md +9 -0
- package/assets/docs/tutorials/feedback-service/installation.md +142 -0
- package/assets/docs/tutorials/feedback-service/introduction.md +28 -0
- package/assets/docs/tutorials/feedback-service/security.md +40 -0
- package/assets/docs/tutorials/feedback-service/triggering.md +21 -0
- package/assets/docs/tutorials/file-service/file-service.md +9 -0
- package/assets/docs/tutorials/file-service/file-types.md +35 -0
- package/assets/docs/tutorials/file-service/introduction.md +34 -0
- package/assets/docs/tutorials/file-service/security.md +31 -0
- package/assets/docs/tutorials/file-service/working-with.md +65 -0
- package/assets/docs/tutorials/form-service/Integration.md +31 -0
- package/assets/docs/tutorials/form-service/ai-agent.md +450 -0
- package/assets/docs/tutorials/form-service/building-forms.md +264 -0
- package/assets/docs/tutorials/form-service/cheat-sheet.md +1461 -0
- package/assets/docs/tutorials/form-service/custom-error-messages.md +87 -0
- package/assets/docs/tutorials/form-service/data-registers.md +204 -0
- package/assets/docs/tutorials/form-service/file-uploader.md +81 -0
- package/assets/docs/tutorials/form-service/form-app.md +72 -0
- package/assets/docs/tutorials/form-service/form-editor.md +62 -0
- package/assets/docs/tutorials/form-service/form-service.md +9 -0
- package/assets/docs/tutorials/form-service/form-submissions.md +77 -0
- package/assets/docs/tutorials/form-service/instructions.md +173 -0
- package/assets/docs/tutorials/form-service/introduction.md +66 -0
- package/assets/docs/tutorials/form-service/repeated-items.md +87 -0
- package/assets/docs/tutorials/form-service/security.md +36 -0
- package/assets/docs/tutorials/form-service/steppers.md +237 -0
- package/assets/docs/tutorials/notification-service/emailAttachment.md +75 -0
- package/assets/docs/tutorials/notification-service/events.md +20 -0
- package/assets/docs/tutorials/notification-service/introduction.md +37 -0
- package/assets/docs/tutorials/notification-service/notification-service.md +9 -0
- package/assets/docs/tutorials/notification-service/notification-types.md +86 -0
- package/assets/docs/tutorials/notification-service/subscribers.md +33 -0
- package/assets/docs/tutorials/pdf-service/building-a-template.md +339 -0
- package/assets/docs/tutorials/pdf-service/generate-a-pdf.md +150 -0
- package/assets/docs/tutorials/pdf-service/handlebars.md +51 -0
- package/assets/docs/tutorials/pdf-service/introduction.md +26 -0
- package/assets/docs/tutorials/pdf-service/pdf-service.md +9 -0
- package/assets/docs/tutorials/pdf-service/puppeteer.md +25 -0
- package/assets/docs/tutorials/pdf-service/video.md +18 -0
- package/assets/docs/tutorials/status-service/Introduction.md +46 -0
- package/assets/docs/tutorials/status-service/health.md +51 -0
- package/assets/docs/tutorials/status-service/notices.md +34 -0
- package/assets/docs/tutorials/status-service/notifications.md +107 -0
- package/assets/docs/tutorials/status-service/status-service.md +9 -0
- package/assets/docs/tutorials/status-service/status.md +35 -0
- package/assets/docs/tutorials/status-service/webhooks.md +24 -0
- package/assets/docs/tutorials/task-service/introduction.md +23 -0
- package/assets/docs/tutorials/task-service/task-app.md +43 -0
- package/assets/docs/tutorials/task-service/task-definitions.md +49 -0
- package/assets/docs/tutorials/task-service/task-queues.md +67 -0
- package/assets/docs/tutorials/task-service/task-service.md +9 -0
- package/assets/docs/tutorials/tutorials.md +8 -0
- package/package.json +18 -0
- package/src/docs/docsRepository.d.ts +22 -0
- package/src/docs/docsRepository.js +110 -0
- package/src/docs/docsRepository.js.map +1 -0
- package/src/main.d.ts +2 -0
- package/src/main.js +16 -0
- package/src/main.js.map +1 -0
- package/src/sdk-reference/reference.d.ts +17 -0
- package/src/sdk-reference/reference.js +547 -0
- package/src/sdk-reference/reference.js.map +1 -0
- package/src/sdk-reference/search.d.ts +6 -0
- package/src/sdk-reference/search.js +41 -0
- package/src/sdk-reference/search.js.map +1 -0
- package/src/server.d.ts +6 -0
- package/src/server.js +30 -0
- package/src/server.js.map +1 -0
- package/src/tools/registerDocsTools.d.ts +3 -0
- package/src/tools/registerDocsTools.js +66 -0
- package/src/tools/registerDocsTools.js.map +1 -0
- package/src/tools/registerQuickstartTool.d.ts +2 -0
- package/src/tools/registerQuickstartTool.js +82 -0
- package/src/tools/registerQuickstartTool.js.map +1 -0
- package/src/tools/registerSdkTools.d.ts +2 -0
- package/src/tools/registerSdkTools.js +43 -0
- package/src/tools/registerSdkTools.js.map +1 -0
- package/src/tools/types.d.ts +12 -0
- package/src/tools/types.js +3 -0
- package/src/tools/types.js.map +1 -0
package/src/server.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAdspMcpServer = createAdspMcpServer;
|
|
4
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
5
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const docsRepository_1 = require("./docs/docsRepository");
|
|
8
|
+
const registerDocsTools_1 = require("./tools/registerDocsTools");
|
|
9
|
+
const registerQuickstartTool_1 = require("./tools/registerQuickstartTool");
|
|
10
|
+
const registerSdkTools_1 = require("./tools/registerSdkTools");
|
|
11
|
+
function createAdspMcpServer(options = {}) {
|
|
12
|
+
// Compiled output places this file under dist/.../src/, while the docs asset copy lands one level up at dist/.../assets/docs.
|
|
13
|
+
const docsRoot = options.docsRoot ?? (0, path_1.join)(__dirname, '..', 'assets', 'docs');
|
|
14
|
+
const docs = new docsRepository_1.DocsRepository(docsRoot);
|
|
15
|
+
const tools = [...(0, registerDocsTools_1.createDocsTools)(docs), ...(0, registerSdkTools_1.createSdkTools)(), ...(0, registerQuickstartTool_1.createQuickstartTool)()];
|
|
16
|
+
const toolsByName = new Map(tools.map((tool) => [tool.name, tool]));
|
|
17
|
+
const server = new index_js_1.Server({ name: 'adsp-sdk-mcp-server', version: '0.0.1' }, { capabilities: { tools: {} } });
|
|
18
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
19
|
+
tools: tools.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })),
|
|
20
|
+
}));
|
|
21
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
22
|
+
const tool = toolsByName.get(request.params.name);
|
|
23
|
+
if (!tool) {
|
|
24
|
+
return { isError: true, content: [{ type: 'text', text: `Unknown tool: ${request.params.name}` }] };
|
|
25
|
+
}
|
|
26
|
+
return tool.handler(request.params.arguments ?? {});
|
|
27
|
+
});
|
|
28
|
+
return server;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/server.ts"],"names":[],"mappings":";;AAaA,kDAwBC;AArCD,wEAAmE;AACnE,iEAAmG;AACnG,+BAA4B;AAC5B,0DAAuD;AACvD,iEAA4D;AAC5D,2EAAsE;AACtE,+DAA0D;AAO1D,SAAgB,mBAAmB,CAAC,UAAsC,EAAE;IAC1E,8HAA8H;IAC9H,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,IAAI,+BAAc,CAAC,QAAQ,CAAC,CAAC;IAE1C,MAAM,KAAK,GAAG,CAAC,GAAG,IAAA,mCAAe,EAAC,IAAI,CAAC,EAAE,GAAG,IAAA,iCAAc,GAAE,EAAE,GAAG,IAAA,6CAAoB,GAAE,CAAC,CAAC;IACzF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAEpE,MAAM,MAAM,GAAG,IAAI,iBAAM,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAE9G,MAAM,CAAC,iBAAiB,CAAC,iCAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC5D,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;KAC/F,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,gCAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChE,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;QACtG,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDocsTools = createDocsTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const SearchArgs = zod_1.z.object({
|
|
6
|
+
query: zod_1.z.string(),
|
|
7
|
+
limit: zod_1.z.number().int().min(1).max(20).optional(),
|
|
8
|
+
});
|
|
9
|
+
const ReadArgs = zod_1.z.object({
|
|
10
|
+
path: zod_1.z.string(),
|
|
11
|
+
});
|
|
12
|
+
function createDocsTools(docs) {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
name: 'search_adsp_docs',
|
|
16
|
+
description: 'Search ADSP platform documentation (getting started, architecture, service concepts, and tutorials) by ' +
|
|
17
|
+
'keyword. Returns matching pages with a snippet; use read_adsp_doc with the returned path to read the full page.',
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
query: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Keywords to search for, e.g. "send a domain event" or "directory service".',
|
|
24
|
+
},
|
|
25
|
+
limit: {
|
|
26
|
+
type: 'number',
|
|
27
|
+
description: 'Maximum number of results to return (default 5).',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
required: ['query'],
|
|
31
|
+
},
|
|
32
|
+
handler: (args) => {
|
|
33
|
+
const { query, limit } = SearchArgs.parse(args);
|
|
34
|
+
return { content: [{ type: 'text', text: JSON.stringify(docs.search(query, limit ?? 5), null, 2) }] };
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
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.',
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
path: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Doc path, e.g. "services/event-service.md".',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
required: ['path'],
|
|
49
|
+
},
|
|
50
|
+
handler: (args) => {
|
|
51
|
+
const { path } = ReadArgs.parse(args);
|
|
52
|
+
const doc = docs.read(path);
|
|
53
|
+
if (!doc) {
|
|
54
|
+
return {
|
|
55
|
+
isError: true,
|
|
56
|
+
content: [
|
|
57
|
+
{ type: 'text', text: `No doc found at path "${path}". Use search_adsp_docs to find a valid path.` },
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return { content: [{ type: 'text', text: `# ${doc.title}\n\n${doc.content}` }] };
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=registerDocsTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerDocsTools.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/registerDocsTools.ts"],"names":[],"mappings":";;AAaA,0CAuDC;AApED,6BAAwB;AAIxB,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,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH,SAAgB,eAAe,CAAC,IAAoB;IAClD,OAAO;QACL;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EACT,yGAAyG;gBACzG,iHAAiH;YACnH,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,4EAA4E;qBAC1F;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,kDAAkD;qBAChE;iBACF;gBACD,QAAQ,EAAE,CAAC,OAAO,CAAC;aACpB;YACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAChD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACxG,CAAC;SACF;QACD;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,oGAAoG;YACjH,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;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,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"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createQuickstartTool = createQuickstartTool;
|
|
4
|
+
const QUICKSTART = `# Getting started with @abgov/adsp-service-sdk (Node)
|
|
5
|
+
|
|
6
|
+
## 1. Initialize the SDK
|
|
7
|
+
|
|
8
|
+
For a multi-tenant platform service, call \`initializePlatform\` once at startup:
|
|
9
|
+
|
|
10
|
+
\`\`\`typescript
|
|
11
|
+
import { AdspId, initializePlatform } from '@abgov/adsp-service-sdk';
|
|
12
|
+
|
|
13
|
+
const serviceId = AdspId.parse(environment.CLIENT_ID);
|
|
14
|
+
const {
|
|
15
|
+
coreStrategy,
|
|
16
|
+
tenantStrategy,
|
|
17
|
+
...sdkCapabilities
|
|
18
|
+
} = await initializePlatform(
|
|
19
|
+
{
|
|
20
|
+
displayName: 'My platform service',
|
|
21
|
+
description: 'Example of a platform service.',
|
|
22
|
+
serviceId,
|
|
23
|
+
accessServiceUrl: new URL(environment.KEYCLOAK_ROOT_URL),
|
|
24
|
+
clientSecret: environment.CLIENT_SECRET,
|
|
25
|
+
directoryUrl: new URL(environment.DIRECTORY_URL),
|
|
26
|
+
configurationSchema,
|
|
27
|
+
events: [],
|
|
28
|
+
roles: [],
|
|
29
|
+
notifications: [],
|
|
30
|
+
},
|
|
31
|
+
{ logger }
|
|
32
|
+
);
|
|
33
|
+
\`\`\`
|
|
34
|
+
|
|
35
|
+
For a single-tenant service, use \`initializeService\` instead (same options, minus \`ignoreServiceAud\`; it resolves the
|
|
36
|
+
service's own tenant automatically and omits \`tenantService\`/\`tenantHandler\` from what it returns).
|
|
37
|
+
|
|
38
|
+
## 2. What you get back
|
|
39
|
+
|
|
40
|
+
\`initializePlatform\` returns capabilities you wire into your Express app:
|
|
41
|
+
|
|
42
|
+
| Capability | Purpose |
|
|
43
|
+
|---|---|
|
|
44
|
+
| \`directory\` | Look up other service/API URLs by ADSP URN |
|
|
45
|
+
| \`tenantService\` | Look up tenant records |
|
|
46
|
+
| \`configurationService\` | Retrieve tenant/core configuration |
|
|
47
|
+
| \`eventService\` | Send domain events |
|
|
48
|
+
| \`tokenProvider\` | Get this service's own access token |
|
|
49
|
+
| \`coreStrategy\` / \`tenantStrategy\` | Passport strategies to validate incoming tokens |
|
|
50
|
+
| \`tenantHandler\` / \`configurationHandler\` | Express middleware setting \`req.tenant\` / \`req.getConfiguration()\` |
|
|
51
|
+
| \`healthCheck\` | Function to check platform dependency health |
|
|
52
|
+
| \`metricsHandler\` / \`traceHandler\` | Request instrumentation middleware |
|
|
53
|
+
|
|
54
|
+
## 3. Registering what your service needs
|
|
55
|
+
|
|
56
|
+
Pass \`roles\`, \`events\`, \`configuration\`, \`eventStreams\`, \`fileTypes\`, \`notifications\`, and/or \`values\` on the options
|
|
57
|
+
object (see the \`ServiceRegistration\` SDK reference entry) and the SDK registers them with the relevant platform
|
|
58
|
+
services (configuration-service, event-service, tenant-service, push-service, file-service, notification-service,
|
|
59
|
+
value-service) automatically on startup.
|
|
60
|
+
|
|
61
|
+
## 4. Next steps
|
|
62
|
+
|
|
63
|
+
- Use \`search_adsp_docs\` for platform concepts (multi-tenancy, service discovery, configuration, domain events) and
|
|
64
|
+
service-specific docs.
|
|
65
|
+
- Use \`search_sdk_reference\` for details on any specific SDK symbol (e.g. \`EventService\`, \`ConfigurationService\`,
|
|
66
|
+
\`authorize\`).
|
|
67
|
+
- Read the full getting-started guide with \`read_adsp_doc\` on path \`getting-started.md\`, the Node SDK page at
|
|
68
|
+
\`platform/platform-node-sdk.md\`, and the architecture overview at \`architecture.md\`.
|
|
69
|
+
`;
|
|
70
|
+
function createQuickstartTool() {
|
|
71
|
+
return [
|
|
72
|
+
{
|
|
73
|
+
name: 'get_platform_quickstart',
|
|
74
|
+
description: 'Returns the canonical initializePlatform usage pattern for a new Node ADSP service, a summary of the ' +
|
|
75
|
+
'capabilities it returns, and pointers to further docs. Use this first for the most common question: how to ' +
|
|
76
|
+
'start using ADSP from a Node service.',
|
|
77
|
+
inputSchema: { type: 'object', properties: {} },
|
|
78
|
+
handler: () => ({ content: [{ type: 'text', text: QUICKSTART }] }),
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=registerQuickstartTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerQuickstartTool.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/registerQuickstartTool.ts"],"names":[],"mappings":";;AAqEA,oDAYC;AA/ED,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiElB,CAAC;AAEF,SAAgB,oBAAoB;IAClC,OAAO;QACL;YACE,IAAI,EAAE,yBAAyB;YAC/B,WAAW,EACT,uGAAuG;gBACvG,6GAA6G;gBAC7G,uCAAuC;YACzC,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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSdkTools = createSdkTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const search_1 = require("../sdk-reference/search");
|
|
6
|
+
const SearchArgs = zod_1.z.object({
|
|
7
|
+
query: zod_1.z.string(),
|
|
8
|
+
limit: zod_1.z.number().int().min(1).max(20).optional(),
|
|
9
|
+
});
|
|
10
|
+
function createSdkTools() {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
name: 'search_sdk_reference',
|
|
14
|
+
description: 'Search the @abgov/adsp-service-sdk (Node SDK) reference by symbol name, module, or keyword. Returns full ' +
|
|
15
|
+
'symbol details: kind, module, description, option/return shape, example, and deprecated flag.',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
query: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Symbol name or keyword, e.g. "initializePlatform", "send event", or "directory".',
|
|
22
|
+
},
|
|
23
|
+
limit: {
|
|
24
|
+
type: 'number',
|
|
25
|
+
description: 'Maximum number of results to return (default 5).',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
required: ['query'],
|
|
29
|
+
},
|
|
30
|
+
handler: (args) => {
|
|
31
|
+
const { query, limit } = SearchArgs.parse(args);
|
|
32
|
+
const results = (0, search_1.searchSdkReference)(query, limit ?? 5);
|
|
33
|
+
if (results.length === 0) {
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: 'text', text: `No matching @abgov/adsp-service-sdk symbols found for "${query}".` }],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return { content: [{ type: 'text', text: JSON.stringify(results, null, 2) }] };
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=registerSdkTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerSdkTools.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/registerSdkTools.ts"],"names":[],"mappings":";;AASA,wCAkCC;AA3CD,6BAAwB;AACxB,oDAA6D;AAG7D,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,SAAgB,cAAc;IAC5B,OAAO;QACL;YACE,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EACT,2GAA2G;gBAC3G,+FAA+F;YACjG,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,kFAAkF;qBAChG;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,kDAAkD;qBAChE;iBACF;gBACD,QAAQ,EAAE,CAAC,OAAO,CAAC;aACpB;YACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAChD,MAAM,OAAO,GAAG,IAAA,2BAAkB,EAAC,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;gBACtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACzB,OAAO;wBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0DAA0D,KAAK,IAAI,EAAE,CAAC;qBACvG,CAAC;gBACJ,CAAC;gBAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACjF,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
export interface JsonSchemaObject {
|
|
3
|
+
type: 'object';
|
|
4
|
+
properties?: Record<string, unknown>;
|
|
5
|
+
required?: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ToolDefinition {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
inputSchema: JsonSchemaObject;
|
|
11
|
+
handler: (args: Record<string, unknown>) => Promise<CallToolResult> | CallToolResult;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/tools/types.ts"],"names":[],"mappings":""}
|