@breadstone/archipel-mcp 0.0.10 → 0.0.13
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/data/guides/ai-text-generation.md +361 -0
- package/data/guides/analytics-and-error-tracking.md +189 -0
- package/data/guides/authentication-and-authorization.md +657 -0
- package/data/guides/blob-storage.md +242 -0
- package/data/guides/caching.md +255 -0
- package/data/guides/cryptography-and-otp.md +240 -0
- package/data/guides/database-setup.md +546 -0
- package/data/guides/document-generation.md +174 -0
- package/data/guides/email-delivery.md +196 -0
- package/data/guides/esigning-integration.md +231 -0
- package/data/guides/getting-started.md +351 -0
- package/data/guides/implementing-ports.md +317 -0
- package/data/guides/index.md +62 -0
- package/data/guides/mcp-server.md +222 -0
- package/data/guides/openapi-and-feature-discovery.md +266 -0
- package/data/guides/payments-and-feature-gating.md +244 -0
- package/data/guides/resource-management.md +352 -0
- package/data/guides/telemetry-and-observability.md +190 -0
- package/data/guides/testing.md +319 -0
- package/data/guides/tsdoc-guidelines.md +45 -0
- package/data/packages/platform-database/api/Class.DatabaseModule.md +3 -5
- package/data/packages/platform-database/api/Class.DatabaseService.md +5 -4
- package/data/packages/platform-database/api/Class.PrismaService.md +8 -7
- package/data/packages/platform-database/api/Interface.IDatabaseModuleConfig.md +13 -1
- package/data/packages/platform-database/api/Interface.IPrismaServiceOptions.md +22 -0
- package/data/packages/platform-database/api/Variable.DATABASE_MODULE_CONFIG.md +14 -0
- package/data/packages/platform-database/api/Variable.DB_ACCELERATE_URL.md +14 -0
- package/data/packages/platform-database/api/Variable.DB_AUTO_CONNECTION.md +14 -0
- package/data/packages/platform-database/api/Variable.DB_OPTIMIZE.md +14 -0
- package/data/packages/platform-database/api/Variable.DB_OPTIMIZE_API_KEY.md +14 -0
- package/data/packages/platform-database/api/Variable.PLATFORM_DATABASE_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-database/api/index.md +13 -1
- package/data/packages/platform-database/index.md +41 -18
- package/data/packages/platform-openapi/api/Class.SwaggerFeatureDiscovery.md +10 -6
- package/data/packages/platform-telemetry/api/Class.NoopTelemetryFacade.md +10 -10
- package/data/packages/platform-telemetry/api/Interface.ITelemetryFacade.md +1 -1
- package/package.json +1 -1
- package/src/GuidesLoader.d.ts +13 -0
- package/src/GuidesLoader.js +81 -0
- package/src/main.js +36 -198
- package/src/models/IGuideDoc.d.ts +15 -0
- package/src/models/IGuideDoc.js +3 -0
- package/src/tools/registerGetConfigPatternTool.d.ts +5 -0
- package/src/tools/registerGetConfigPatternTool.js +15 -0
- package/src/tools/registerGetDtoPatternTool.d.ts +5 -0
- package/src/tools/registerGetDtoPatternTool.js +15 -0
- package/src/tools/registerGetErrorHandlingPatternTool.d.ts +5 -0
- package/src/tools/registerGetErrorHandlingPatternTool.js +15 -0
- package/src/tools/registerGetGuardPatternTool.d.ts +5 -0
- package/src/tools/registerGetGuardPatternTool.js +15 -0
- package/src/tools/registerGetGuideTool.d.ts +6 -0
- package/src/tools/registerGetGuideTool.js +32 -0
- package/src/tools/registerGetMappingPatternTool.d.ts +5 -0
- package/src/tools/registerGetMappingPatternTool.js +34 -0
- package/src/tools/registerGetModulePatternTool.d.ts +5 -0
- package/src/tools/registerGetModulePatternTool.js +29 -0
- package/src/tools/registerGetPackageDocTool.d.ts +6 -0
- package/src/tools/registerGetPackageDocTool.js +43 -0
- package/src/tools/registerGetQueryPatternTool.d.ts +5 -0
- package/src/tools/registerGetQueryPatternTool.js +29 -0
- package/src/tools/registerGetRepositoryPatternTool.d.ts +5 -0
- package/src/tools/registerGetRepositoryPatternTool.js +29 -0
- package/src/tools/registerGetTestingPatternTool.d.ts +5 -0
- package/src/tools/registerGetTestingPatternTool.js +15 -0
- package/src/tools/registerListGuidesTool.d.ts +6 -0
- package/src/tools/registerListGuidesTool.js +22 -0
- package/src/tools/registerListPackagesTool.d.ts +6 -0
- package/src/tools/registerListPackagesTool.js +20 -0
- package/src/tools/registerSearchDocsTool.d.ts +6 -0
- package/src/tools/registerSearchDocsTool.js +35 -0
- package/src/tools/registerSearchGuidesTool.d.ts +6 -0
- package/src/tools/registerSearchGuidesTool.js +28 -0
package/src/main.js
CHANGED
|
@@ -3,17 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
5
5
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
6
|
const DocsLoader_1 = require("./DocsLoader");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
7
|
+
const GuidesLoader_1 = require("./GuidesLoader");
|
|
8
|
+
const registerGetConfigPatternTool_1 = require("./tools/registerGetConfigPatternTool");
|
|
9
|
+
const registerGetDtoPatternTool_1 = require("./tools/registerGetDtoPatternTool");
|
|
10
|
+
const registerGetErrorHandlingPatternTool_1 = require("./tools/registerGetErrorHandlingPatternTool");
|
|
11
|
+
const registerGetGuardPatternTool_1 = require("./tools/registerGetGuardPatternTool");
|
|
12
|
+
const registerGetGuideTool_1 = require("./tools/registerGetGuideTool");
|
|
13
|
+
const registerGetMappingPatternTool_1 = require("./tools/registerGetMappingPatternTool");
|
|
14
|
+
const registerGetModulePatternTool_1 = require("./tools/registerGetModulePatternTool");
|
|
15
|
+
const registerGetPackageDocTool_1 = require("./tools/registerGetPackageDocTool");
|
|
16
|
+
const registerGetQueryPatternTool_1 = require("./tools/registerGetQueryPatternTool");
|
|
17
|
+
const registerGetRepositoryPatternTool_1 = require("./tools/registerGetRepositoryPatternTool");
|
|
18
|
+
const registerGetTestingPatternTool_1 = require("./tools/registerGetTestingPatternTool");
|
|
19
|
+
const registerListGuidesTool_1 = require("./tools/registerListGuidesTool");
|
|
20
|
+
const registerListPackagesTool_1 = require("./tools/registerListPackagesTool");
|
|
21
|
+
const registerSearchDocsTool_1 = require("./tools/registerSearchDocsTool");
|
|
22
|
+
const registerSearchGuidesTool_1 = require("./tools/registerSearchGuidesTool");
|
|
17
23
|
// #region Fields
|
|
18
24
|
const SERVER_NAME = 'archipel-mcp';
|
|
19
25
|
const SERVER_VERSION = '0.0.1';
|
|
@@ -22,203 +28,35 @@ const SERVER_VERSION = '0.0.1';
|
|
|
22
28
|
async function main() {
|
|
23
29
|
const docsLoader = new DocsLoader_1.DocsLoader();
|
|
24
30
|
docsLoader.load();
|
|
31
|
+
const guidesLoader = new GuidesLoader_1.GuidesLoader();
|
|
32
|
+
guidesLoader.load();
|
|
25
33
|
const server = new mcp_js_1.McpServer({
|
|
26
34
|
name: SERVER_NAME,
|
|
35
|
+
description: 'MCP server for Archipel platform documentation, guides, and knowledge base.',
|
|
36
|
+
title: 'Archipel MCP Server',
|
|
37
|
+
websiteUrl: 'https://archipel.breadstone.de/',
|
|
27
38
|
version: SERVER_VERSION,
|
|
28
39
|
});
|
|
29
|
-
|
|
40
|
+
(0, registerListPackagesTool_1.registerListPackagesTool)(server, docsLoader);
|
|
41
|
+
(0, registerGetPackageDocTool_1.registerGetPackageDocTool)(server, docsLoader);
|
|
42
|
+
(0, registerSearchDocsTool_1.registerSearchDocsTool)(server, docsLoader);
|
|
43
|
+
(0, registerListGuidesTool_1.registerListGuidesTool)(server, guidesLoader);
|
|
44
|
+
(0, registerGetGuideTool_1.registerGetGuideTool)(server, guidesLoader);
|
|
45
|
+
(0, registerSearchGuidesTool_1.registerSearchGuidesTool)(server, guidesLoader);
|
|
46
|
+
(0, registerGetQueryPatternTool_1.registerGetQueryPatternTool)(server);
|
|
47
|
+
(0, registerGetRepositoryPatternTool_1.registerGetRepositoryPatternTool)(server);
|
|
48
|
+
(0, registerGetMappingPatternTool_1.registerGetMappingPatternTool)(server);
|
|
49
|
+
(0, registerGetModulePatternTool_1.registerGetModulePatternTool)(server);
|
|
50
|
+
(0, registerGetErrorHandlingPatternTool_1.registerGetErrorHandlingPatternTool)(server);
|
|
51
|
+
(0, registerGetConfigPatternTool_1.registerGetConfigPatternTool)(server);
|
|
52
|
+
(0, registerGetGuardPatternTool_1.registerGetGuardPatternTool)(server);
|
|
53
|
+
(0, registerGetDtoPatternTool_1.registerGetDtoPatternTool)(server);
|
|
54
|
+
(0, registerGetTestingPatternTool_1.registerGetTestingPatternTool)(server);
|
|
30
55
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
31
56
|
await server.connect(transport);
|
|
32
57
|
process.stderr.write(`[${SERVER_NAME}] Server running on stdio\n`);
|
|
33
58
|
}
|
|
34
59
|
// #endregion
|
|
35
|
-
// #region Tool Registration
|
|
36
|
-
function registerTools(server, docsLoader) {
|
|
37
|
-
// --- list-packages ---
|
|
38
|
-
server.tool('list-packages', 'Lists all available Archipel platform packages with their descriptions and tags.', {}, async () => {
|
|
39
|
-
const packages = Array.from(docsLoader.packages.values()).map((packageDoc) => ({
|
|
40
|
-
name: packageDoc.name,
|
|
41
|
-
package: packageDoc.packageScope,
|
|
42
|
-
description: packageDoc.description,
|
|
43
|
-
tags: packageDoc.tags,
|
|
44
|
-
}));
|
|
45
|
-
return {
|
|
46
|
-
content: [{ type: 'text', text: JSON.stringify(packages, null, 2) }],
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
// --- get-package-doc ---
|
|
50
|
-
server.tool('get-package-doc', 'Gets the full documentation (overview + API reference) for a specific Archipel platform package.', {
|
|
51
|
-
packageName: zod_1.z.string().describe('The package directory name (e.g. "platform-core", "platform-database").'),
|
|
52
|
-
}, async (params) => {
|
|
53
|
-
const packageDoc = docsLoader.packages.get(params.packageName);
|
|
54
|
-
if (!packageDoc) {
|
|
55
|
-
return {
|
|
56
|
-
content: [
|
|
57
|
-
{
|
|
58
|
-
type: 'text',
|
|
59
|
-
text: `Package "${params.packageName}" not found. Use the list-packages tool to see available packages.`,
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
isError: true,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
const sections = [
|
|
66
|
-
`# ${packageDoc.title}`,
|
|
67
|
-
'',
|
|
68
|
-
`> ${packageDoc.description}`,
|
|
69
|
-
'',
|
|
70
|
-
`**Package:** \`${packageDoc.packageScope}\``,
|
|
71
|
-
];
|
|
72
|
-
if (packageDoc.tags.length > 0) {
|
|
73
|
-
sections.push(`**Tags:** ${packageDoc.tags.join(', ')}`);
|
|
74
|
-
}
|
|
75
|
-
sections.push('', packageDoc.content);
|
|
76
|
-
if (packageDoc.apiContent) {
|
|
77
|
-
sections.push('', '---', '', '## API Reference', '', packageDoc.apiContent);
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
content: [{ type: 'text', text: sections.join('\n') }],
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
// --- search-docs ---
|
|
84
|
-
server.tool('search-docs', 'Searches across all Archipel platform documentation by keyword or phrase.', {
|
|
85
|
-
query: zod_1.z.string().describe('The search query to match against package names, descriptions, tags, and content.'),
|
|
86
|
-
}, async (params) => {
|
|
87
|
-
const results = docsLoader.search(params.query);
|
|
88
|
-
if (results.length === 0) {
|
|
89
|
-
return {
|
|
90
|
-
content: [{ type: 'text', text: `No documentation found matching: "${params.query}"` }],
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
const summary = results
|
|
94
|
-
.map((packageDoc) => [
|
|
95
|
-
`## ${packageDoc.title}`,
|
|
96
|
-
`**Package:** \`${packageDoc.packageScope}\``,
|
|
97
|
-
'',
|
|
98
|
-
packageDoc.description,
|
|
99
|
-
'',
|
|
100
|
-
packageDoc.content,
|
|
101
|
-
].join('\n'))
|
|
102
|
-
.join('\n\n---\n\n');
|
|
103
|
-
return {
|
|
104
|
-
content: [
|
|
105
|
-
{ type: 'text', text: `Found ${results.length} result(s) for "${params.query}":\n\n${summary}` },
|
|
106
|
-
],
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
// --- get-query-pattern ---
|
|
110
|
-
server.tool('get-query-pattern', 'Returns the Archipel query pattern documentation — interfaces, factories, rules, and examples. Optionally tailored to a specific Prisma model.', {
|
|
111
|
-
modelName: zod_1.z
|
|
112
|
-
.string()
|
|
113
|
-
.optional()
|
|
114
|
-
.describe('Prisma model name (e.g. "User", "Order"). If provided, generates model-specific examples.'),
|
|
115
|
-
fields: zod_1.z
|
|
116
|
-
.array(zod_1.z.string())
|
|
117
|
-
.optional()
|
|
118
|
-
.describe('Field names of the model (e.g. ["id", "email", "name", "createdAt"]). Used with modelName for tailored examples.'),
|
|
119
|
-
}, async (params) => {
|
|
120
|
-
let content = queryPattern_1.QUERY_PATTERN_KNOWLEDGE;
|
|
121
|
-
if (params.modelName && params.fields && params.fields.length > 0) {
|
|
122
|
-
content += '\n\n' + (0, queryPattern_1.QUERY_PATTERN_WITH_MODEL)(params.modelName, params.fields);
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
content: [{ type: 'text', text: content }],
|
|
126
|
-
};
|
|
127
|
-
});
|
|
128
|
-
// --- get-repository-pattern ---
|
|
129
|
-
server.tool('get-repository-pattern', 'Returns the Archipel repository class pattern — how to create a RepositoryBase subclass with correct generics, module registration, and service injection. Optionally tailored to a specific Prisma model.', {
|
|
130
|
-
modelName: zod_1.z
|
|
131
|
-
.string()
|
|
132
|
-
.optional()
|
|
133
|
-
.describe('Prisma model name (e.g. "User", "Order"). If provided, generates a complete repository scaffold.'),
|
|
134
|
-
fields: zod_1.z
|
|
135
|
-
.array(zod_1.z.string())
|
|
136
|
-
.optional()
|
|
137
|
-
.describe('Field names of the model (e.g. ["id", "email", "name", "createdAt"]). Used with modelName for tailored examples.'),
|
|
138
|
-
}, async (params) => {
|
|
139
|
-
let content = repositoryPattern_1.REPOSITORY_PATTERN_KNOWLEDGE;
|
|
140
|
-
if (params.modelName && params.fields && params.fields.length > 0) {
|
|
141
|
-
content += '\n\n' + (0, repositoryPattern_1.REPOSITORY_PATTERN_WITH_MODEL)(params.modelName, params.fields);
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
content: [{ type: 'text', text: content }],
|
|
145
|
-
};
|
|
146
|
-
});
|
|
147
|
-
// --- get-mapping-pattern ---
|
|
148
|
-
server.tool('get-mapping-pattern', 'Returns the Archipel mapping pattern — branded type-safe mapping keys, MappingProfileBase, MappingService, and MappingModule registration. Optionally tailored to a specific entity and response class.', {
|
|
149
|
-
entityName: zod_1.z
|
|
150
|
-
.string()
|
|
151
|
-
.optional()
|
|
152
|
-
.describe('Entity name (e.g. "Product", "User"). If provided, generates tailored mapping scaffold.'),
|
|
153
|
-
fields: zod_1.z
|
|
154
|
-
.array(zod_1.z.string())
|
|
155
|
-
.optional()
|
|
156
|
-
.describe('Field names of the entity (e.g. ["id", "name", "barcode", "createdAt"]).'),
|
|
157
|
-
responseName: zod_1.z
|
|
158
|
-
.string()
|
|
159
|
-
.optional()
|
|
160
|
-
.describe('Response class name (e.g. "ProductResponse"). Defaults to "{entityName}Response".'),
|
|
161
|
-
}, async (params) => {
|
|
162
|
-
let content = mappingPattern_1.MAPPING_PATTERN_KNOWLEDGE;
|
|
163
|
-
if (params.entityName && params.fields && params.fields.length > 0) {
|
|
164
|
-
const responseName = params.responseName || `${params.entityName}Response`;
|
|
165
|
-
content += '\n\n' + (0, mappingPattern_1.MAPPING_PATTERN_WITH_CONTEXT)(params.entityName, params.fields, responseName);
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
content: [{ type: 'text', text: content }],
|
|
169
|
-
};
|
|
170
|
-
});
|
|
171
|
-
// --- get-module-pattern ---
|
|
172
|
-
server.tool('get-module-pattern', 'Returns the Archipel NestJS dynamic module pattern — register(), port/adapter injection, ConfigModule integration. Optionally tailored with module name and port definitions.', {
|
|
173
|
-
moduleName: zod_1.z
|
|
174
|
-
.string()
|
|
175
|
-
.optional()
|
|
176
|
-
.describe('Module name (e.g. "NotificationModule"). If provided, generates a complete module scaffold.'),
|
|
177
|
-
ports: zod_1.z
|
|
178
|
-
.array(zod_1.z.string())
|
|
179
|
-
.optional()
|
|
180
|
-
.describe('Port class names (e.g. ["NotificationPort", "TemplatePort"]). Abstract port classes for dependency inversion.'),
|
|
181
|
-
}, async (params) => {
|
|
182
|
-
let content = modulePattern_1.MODULE_PATTERN_KNOWLEDGE;
|
|
183
|
-
if (params.moduleName && params.ports && params.ports.length > 0) {
|
|
184
|
-
content += '\n\n' + (0, modulePattern_1.MODULE_PATTERN_WITH_CONTEXT)(params.moduleName, params.ports);
|
|
185
|
-
}
|
|
186
|
-
return {
|
|
187
|
-
content: [{ type: 'text', text: content }],
|
|
188
|
-
};
|
|
189
|
-
});
|
|
190
|
-
// --- get-error-handling-pattern ---
|
|
191
|
-
server.tool('get-error-handling-pattern', 'Returns the Archipel error handling pattern — domain errors, RepositoryError, exception filters, and structured error response envelopes.', {}, async () => {
|
|
192
|
-
return {
|
|
193
|
-
content: [{ type: 'text', text: errorHandlingPattern_1.ERROR_HANDLING_PATTERN_KNOWLEDGE }],
|
|
194
|
-
};
|
|
195
|
-
});
|
|
196
|
-
// --- get-config-pattern ---
|
|
197
|
-
server.tool('get-config-pattern', 'Returns the Archipel configuration pattern — typed config keys (createConfigKey), ConfigRegistry, ConfigService, env.ts conventions, and ConfigModule integration.', {}, async () => {
|
|
198
|
-
return {
|
|
199
|
-
content: [{ type: 'text', text: configPattern_1.CONFIG_PATTERN_KNOWLEDGE }],
|
|
200
|
-
};
|
|
201
|
-
});
|
|
202
|
-
// --- get-guard-pattern ---
|
|
203
|
-
server.tool('get-guard-pattern', 'Returns the Archipel guard & interceptor pattern — metadata decorators, FeatureGuard, RolesGuard, FeatureUsageInterceptor, and the full decorator-guard-interceptor trio.', {}, async () => {
|
|
204
|
-
return {
|
|
205
|
-
content: [{ type: 'text', text: guardPattern_1.GUARD_PATTERN_KNOWLEDGE }],
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
// --- get-dto-pattern ---
|
|
209
|
-
server.tool('get-dto-pattern', 'Returns the Archipel DTO & validation pattern — Request/Response DTOs, class-validator decorators, cross-field validation, query parameter DTOs, OpenAPI integration, and naming conventions.', {}, async () => {
|
|
210
|
-
return {
|
|
211
|
-
content: [{ type: 'text', text: dtoPattern_1.DTO_PATTERN_KNOWLEDGE }],
|
|
212
|
-
};
|
|
213
|
-
});
|
|
214
|
-
// --- get-testing-pattern ---
|
|
215
|
-
server.tool('get-testing-pattern', 'Returns the Archipel testing pattern — Vitest conventions, mocking patterns for repositories/services/delegates, AAA structure, and test naming conventions.', {}, async () => {
|
|
216
|
-
return {
|
|
217
|
-
content: [{ type: 'text', text: testingPattern_1.TESTING_PATTERN_KNOWLEDGE }],
|
|
218
|
-
};
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
// #endregion
|
|
222
60
|
main().catch((error) => {
|
|
223
61
|
process.stderr.write(`[${SERVER_NAME}] Fatal error: ${String(error)}\n`);
|
|
224
62
|
process.exit(1);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes a loaded guide documentation entry.
|
|
3
|
+
*/
|
|
4
|
+
export interface IGuideDoc {
|
|
5
|
+
/** File name without extension (e.g. "getting-started"). */
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** Human-readable title from frontmatter. */
|
|
8
|
+
readonly title: string;
|
|
9
|
+
/** Short description from frontmatter. */
|
|
10
|
+
readonly description: string;
|
|
11
|
+
/** Sort order from frontmatter. */
|
|
12
|
+
readonly order: number;
|
|
13
|
+
/** Markdown body (without frontmatter). */
|
|
14
|
+
readonly content: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetConfigPatternTool = registerGetConfigPatternTool;
|
|
4
|
+
const configPattern_1 = require("../knowledge/configPattern");
|
|
5
|
+
/**
|
|
6
|
+
* Registers the get-config-pattern tool on the MCP server.
|
|
7
|
+
*/
|
|
8
|
+
function registerGetConfigPatternTool(server) {
|
|
9
|
+
server.tool('get-config-pattern', 'Returns the Archipel configuration pattern — typed config keys (createConfigKey), ConfigRegistry, ConfigService, env.ts conventions, and ConfigModule integration.', {}, async () => {
|
|
10
|
+
return {
|
|
11
|
+
content: [{ type: 'text', text: configPattern_1.CONFIG_PATTERN_KNOWLEDGE }],
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=registerGetConfigPatternTool.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetDtoPatternTool = registerGetDtoPatternTool;
|
|
4
|
+
const dtoPattern_1 = require("../knowledge/dtoPattern");
|
|
5
|
+
/**
|
|
6
|
+
* Registers the get-dto-pattern tool on the MCP server.
|
|
7
|
+
*/
|
|
8
|
+
function registerGetDtoPatternTool(server) {
|
|
9
|
+
server.tool('get-dto-pattern', 'Returns the Archipel DTO & validation pattern — Request/Response DTOs, class-validator decorators, cross-field validation, query parameter DTOs, OpenAPI integration, and naming conventions.', {}, async () => {
|
|
10
|
+
return {
|
|
11
|
+
content: [{ type: 'text', text: dtoPattern_1.DTO_PATTERN_KNOWLEDGE }],
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=registerGetDtoPatternTool.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetErrorHandlingPatternTool = registerGetErrorHandlingPatternTool;
|
|
4
|
+
const errorHandlingPattern_1 = require("../knowledge/errorHandlingPattern");
|
|
5
|
+
/**
|
|
6
|
+
* Registers the get-error-handling-pattern tool on the MCP server.
|
|
7
|
+
*/
|
|
8
|
+
function registerGetErrorHandlingPatternTool(server) {
|
|
9
|
+
server.tool('get-error-handling-pattern', 'Returns the Archipel error handling pattern — domain errors, RepositoryError, exception filters, and structured error response envelopes.', {}, async () => {
|
|
10
|
+
return {
|
|
11
|
+
content: [{ type: 'text', text: errorHandlingPattern_1.ERROR_HANDLING_PATTERN_KNOWLEDGE }],
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=registerGetErrorHandlingPatternTool.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetGuardPatternTool = registerGetGuardPatternTool;
|
|
4
|
+
const guardPattern_1 = require("../knowledge/guardPattern");
|
|
5
|
+
/**
|
|
6
|
+
* Registers the get-guard-pattern tool on the MCP server.
|
|
7
|
+
*/
|
|
8
|
+
function registerGetGuardPatternTool(server) {
|
|
9
|
+
server.tool('get-guard-pattern', 'Returns the Archipel guard & interceptor pattern — metadata decorators, FeatureGuard, RolesGuard, FeatureUsageInterceptor, and the full decorator-guard-interceptor trio.', {}, async () => {
|
|
10
|
+
return {
|
|
11
|
+
content: [{ type: 'text', text: guardPattern_1.GUARD_PATTERN_KNOWLEDGE }],
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=registerGetGuardPatternTool.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { GuidesLoader } from '../GuidesLoader';
|
|
3
|
+
/**
|
|
4
|
+
* Registers the get-guide tool on the MCP server.
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerGetGuideTool(server: McpServer, guidesLoader: GuidesLoader): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetGuideTool = registerGetGuideTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Registers the get-guide tool on the MCP server.
|
|
7
|
+
*/
|
|
8
|
+
function registerGetGuideTool(server, guidesLoader) {
|
|
9
|
+
server.tool('get-guide', 'Gets the full content of a specific Archipel platform guide.', {
|
|
10
|
+
guideName: zod_1.z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('The guide file name without extension (e.g. "getting-started", "caching", "authentication-and-authorization").'),
|
|
13
|
+
}, async (params) => {
|
|
14
|
+
const guide = guidesLoader.guides.get(params.guideName);
|
|
15
|
+
if (!guide) {
|
|
16
|
+
return {
|
|
17
|
+
content: [
|
|
18
|
+
{
|
|
19
|
+
type: 'text',
|
|
20
|
+
text: `Guide "${params.guideName}" not found. Use the list-guides tool to see available guides.`,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
isError: true,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const sections = [`# ${guide.title}`, '', `> ${guide.description}`, '', guide.content];
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: 'text', text: sections.join('\n') }],
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=registerGetGuideTool.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetMappingPatternTool = registerGetMappingPatternTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const mappingPattern_1 = require("../knowledge/mappingPattern");
|
|
6
|
+
/**
|
|
7
|
+
* Registers the get-mapping-pattern tool on the MCP server.
|
|
8
|
+
*/
|
|
9
|
+
function registerGetMappingPatternTool(server) {
|
|
10
|
+
server.tool('get-mapping-pattern', 'Returns the Archipel mapping pattern — branded type-safe mapping keys, MappingProfileBase, MappingService, and MappingModule registration. Optionally tailored to a specific entity and response class.', {
|
|
11
|
+
entityName: zod_1.z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Entity name (e.g. "Product", "User"). If provided, generates tailored mapping scaffold.'),
|
|
15
|
+
fields: zod_1.z
|
|
16
|
+
.array(zod_1.z.string())
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Field names of the entity (e.g. ["id", "name", "barcode", "createdAt"]).'),
|
|
19
|
+
responseName: zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Response class name (e.g. "ProductResponse"). Defaults to "{entityName}Response".'),
|
|
23
|
+
}, async (params) => {
|
|
24
|
+
let content = mappingPattern_1.MAPPING_PATTERN_KNOWLEDGE;
|
|
25
|
+
if (params.entityName && params.fields && params.fields.length > 0) {
|
|
26
|
+
const responseName = params.responseName || `${params.entityName}Response`;
|
|
27
|
+
content += '\n\n' + (0, mappingPattern_1.MAPPING_PATTERN_WITH_CONTEXT)(params.entityName, params.fields, responseName);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: 'text', text: content }],
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=registerGetMappingPatternTool.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetModulePatternTool = registerGetModulePatternTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const modulePattern_1 = require("../knowledge/modulePattern");
|
|
6
|
+
/**
|
|
7
|
+
* Registers the get-module-pattern tool on the MCP server.
|
|
8
|
+
*/
|
|
9
|
+
function registerGetModulePatternTool(server) {
|
|
10
|
+
server.tool('get-module-pattern', 'Returns the Archipel NestJS dynamic module pattern — register(), port/adapter injection, ConfigModule integration. Optionally tailored with module name and port definitions.', {
|
|
11
|
+
moduleName: zod_1.z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Module name (e.g. "NotificationModule"). If provided, generates a complete module scaffold.'),
|
|
15
|
+
ports: zod_1.z
|
|
16
|
+
.array(zod_1.z.string())
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Port class names (e.g. ["NotificationPort", "TemplatePort"]). Abstract port classes for dependency inversion.'),
|
|
19
|
+
}, async (params) => {
|
|
20
|
+
let content = modulePattern_1.MODULE_PATTERN_KNOWLEDGE;
|
|
21
|
+
if (params.moduleName && params.ports && params.ports.length > 0) {
|
|
22
|
+
content += '\n\n' + (0, modulePattern_1.MODULE_PATTERN_WITH_CONTEXT)(params.moduleName, params.ports);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: 'text', text: content }],
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=registerGetModulePatternTool.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { DocsLoader } from '../DocsLoader';
|
|
3
|
+
/**
|
|
4
|
+
* Registers the get-package-doc tool on the MCP server.
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerGetPackageDocTool(server: McpServer, docsLoader: DocsLoader): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetPackageDocTool = registerGetPackageDocTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Registers the get-package-doc tool on the MCP server.
|
|
7
|
+
*/
|
|
8
|
+
function registerGetPackageDocTool(server, docsLoader) {
|
|
9
|
+
server.tool('get-package-doc', 'Gets the full documentation (overview + API reference) for a specific Archipel platform package.', {
|
|
10
|
+
packageName: zod_1.z.string().describe('The package directory name (e.g. "platform-core", "platform-database").'),
|
|
11
|
+
}, async (params) => {
|
|
12
|
+
const packageDoc = docsLoader.packages.get(params.packageName);
|
|
13
|
+
if (!packageDoc) {
|
|
14
|
+
return {
|
|
15
|
+
content: [
|
|
16
|
+
{
|
|
17
|
+
type: 'text',
|
|
18
|
+
text: `Package "${params.packageName}" not found. Use the list-packages tool to see available packages.`,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
isError: true,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const sections = [
|
|
25
|
+
`# ${packageDoc.title}`,
|
|
26
|
+
'',
|
|
27
|
+
`> ${packageDoc.description}`,
|
|
28
|
+
'',
|
|
29
|
+
`**Package:** \`${packageDoc.packageScope}\``,
|
|
30
|
+
];
|
|
31
|
+
if (packageDoc.tags.length > 0) {
|
|
32
|
+
sections.push(`**Tags:** ${packageDoc.tags.join(', ')}`);
|
|
33
|
+
}
|
|
34
|
+
sections.push('', packageDoc.content);
|
|
35
|
+
if (packageDoc.apiContent) {
|
|
36
|
+
sections.push('', '---', '', '## API Reference', '', packageDoc.apiContent);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
content: [{ type: 'text', text: sections.join('\n') }],
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=registerGetPackageDocTool.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetQueryPatternTool = registerGetQueryPatternTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const queryPattern_1 = require("../knowledge/queryPattern");
|
|
6
|
+
/**
|
|
7
|
+
* Registers the get-query-pattern tool on the MCP server.
|
|
8
|
+
*/
|
|
9
|
+
function registerGetQueryPatternTool(server) {
|
|
10
|
+
server.tool('get-query-pattern', 'Returns the Archipel query pattern documentation — interfaces, factories, rules, and examples. Optionally tailored to a specific Prisma model.', {
|
|
11
|
+
modelName: zod_1.z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Prisma model name (e.g. "User", "Order"). If provided, generates model-specific examples.'),
|
|
15
|
+
fields: zod_1.z
|
|
16
|
+
.array(zod_1.z.string())
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Field names of the model (e.g. ["id", "email", "name", "createdAt"]). Used with modelName for tailored examples.'),
|
|
19
|
+
}, async (params) => {
|
|
20
|
+
let content = queryPattern_1.QUERY_PATTERN_KNOWLEDGE;
|
|
21
|
+
if (params.modelName && params.fields && params.fields.length > 0) {
|
|
22
|
+
content += '\n\n' + (0, queryPattern_1.QUERY_PATTERN_WITH_MODEL)(params.modelName, params.fields);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: 'text', text: content }],
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=registerGetQueryPatternTool.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetRepositoryPatternTool = registerGetRepositoryPatternTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const repositoryPattern_1 = require("../knowledge/repositoryPattern");
|
|
6
|
+
/**
|
|
7
|
+
* Registers the get-repository-pattern tool on the MCP server.
|
|
8
|
+
*/
|
|
9
|
+
function registerGetRepositoryPatternTool(server) {
|
|
10
|
+
server.tool('get-repository-pattern', 'Returns the Archipel repository class pattern — how to create a RepositoryBase subclass with correct generics, module registration, and service injection. Optionally tailored to a specific Prisma model.', {
|
|
11
|
+
modelName: zod_1.z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Prisma model name (e.g. "User", "Order"). If provided, generates a complete repository scaffold.'),
|
|
15
|
+
fields: zod_1.z
|
|
16
|
+
.array(zod_1.z.string())
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Field names of the model (e.g. ["id", "email", "name", "createdAt"]). Used with modelName for tailored examples.'),
|
|
19
|
+
}, async (params) => {
|
|
20
|
+
let content = repositoryPattern_1.REPOSITORY_PATTERN_KNOWLEDGE;
|
|
21
|
+
if (params.modelName && params.fields && params.fields.length > 0) {
|
|
22
|
+
content += '\n\n' + (0, repositoryPattern_1.REPOSITORY_PATTERN_WITH_MODEL)(params.modelName, params.fields);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: 'text', text: content }],
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=registerGetRepositoryPatternTool.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetTestingPatternTool = registerGetTestingPatternTool;
|
|
4
|
+
const testingPattern_1 = require("../knowledge/testingPattern");
|
|
5
|
+
/**
|
|
6
|
+
* Registers the get-testing-pattern tool on the MCP server.
|
|
7
|
+
*/
|
|
8
|
+
function registerGetTestingPatternTool(server) {
|
|
9
|
+
server.tool('get-testing-pattern', 'Returns the Archipel testing pattern — Vitest conventions, mocking patterns for repositories/services/delegates, AAA structure, and test naming conventions.', {}, async () => {
|
|
10
|
+
return {
|
|
11
|
+
content: [{ type: 'text', text: testingPattern_1.TESTING_PATTERN_KNOWLEDGE }],
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=registerGetTestingPatternTool.js.map
|