@maxisoft/instantcms-mcp 1.2.3
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/LICENSE +21 -0
- package/README.md +308 -0
- package/dist/__tests__/artifact-tool.test.js +196 -0
- package/dist/__tests__/db-tool.test.js +152 -0
- package/dist/__tests__/define-tool.test.js +106 -0
- package/dist/__tests__/find-tool.test.js +185 -0
- package/dist/__tests__/get-component-api.test.js +144 -0
- package/dist/__tests__/hardening.test.js +73 -0
- package/dist/__tests__/hooks-tool.test.js +173 -0
- package/dist/__tests__/mcp-integration-extra.test.js +166 -0
- package/dist/__tests__/mcp-integration.test.js +53 -0
- package/dist/__tests__/pagination.test.js +114 -0
- package/dist/__tests__/performance-baseline.test.js +56 -0
- package/dist/__tests__/project-patch.test.js +144 -0
- package/dist/__tests__/project-source.test.js +44 -0
- package/dist/__tests__/project-workflows-extra.test.js +165 -0
- package/dist/__tests__/project-workflows.test.js +51 -0
- package/dist/__tests__/scaffold-addon-roundtrip.test.js +287 -0
- package/dist/__tests__/serialization.test.js +170 -0
- package/dist/__tests__/source-knowledge-parsers.test.js +42 -0
- package/dist/__tests__/template-development.test.js +78 -0
- package/dist/__tests__/template-productivity.test.js +87 -0
- package/dist/__tests__/tools.test.js +2143 -0
- package/dist/data/components.js +2818 -0
- package/dist/data/controllers-map.js +7571 -0
- package/dist/data/core-api.js +9356 -0
- package/dist/data/database-schema.js +4555 -0
- package/dist/data/events-map.js +1339 -0
- package/dist/data/fields-map.js +3692 -0
- package/dist/data/hooks.js +2257 -0
- package/dist/data/js-api.js +123 -0
- package/dist/data/libs-api.js +264 -0
- package/dist/data/routes-map.js +203 -0
- package/dist/data/schemas-validation.js +255 -0
- package/dist/data/schemas.js +1404 -0
- package/dist/data/traits-map.js +1004 -0
- package/dist/data/version-profiles.js +41 -0
- package/dist/data/widgets-map.js +131 -0
- package/dist/data/wysiwyg-map.js +486 -0
- package/dist/generated/components-source.js +14748 -0
- package/dist/generated/hooks-source.js +3399 -0
- package/dist/generated/knowledge-meta.js +101 -0
- package/dist/index.js +13 -0
- package/dist/registry/database-tools.js +112 -0
- package/dist/registry/extension-tools.js +473 -0
- package/dist/registry/generator-tools.js +506 -0
- package/dist/registry/knowledge-tools.js +441 -0
- package/dist/registry/language-tools.js +99 -0
- package/dist/registry/meta-tools.js +152 -0
- package/dist/registry/project-tools.js +48 -0
- package/dist/registry/resources.js +98 -0
- package/dist/registry/source-tools.js +211 -0
- package/dist/registry/template-development-tools.js +79 -0
- package/dist/server.js +32 -0
- package/dist/tools/addon-tool.js +1437 -0
- package/dist/tools/admin-partial-tool.js +498 -0
- package/dist/tools/api-tool.js +294 -0
- package/dist/tools/artifact-tool.js +95 -0
- package/dist/tools/cache-tool.js +360 -0
- package/dist/tools/component-tool.js +415 -0
- package/dist/tools/controllers-tool.js +125 -0
- package/dist/tools/cron-tool.js +197 -0
- package/dist/tools/crud-tool.js +659 -0
- package/dist/tools/db-tool.js +198 -0
- package/dist/tools/email-tool.js +222 -0
- package/dist/tools/external-api-tool.js +596 -0
- package/dist/tools/filter-tool.js +341 -0
- package/dist/tools/form-tool.js +275 -0
- package/dist/tools/grid-tool.js +189 -0
- package/dist/tools/hooks-tool.js +104 -0
- package/dist/tools/import-export-tool.js +548 -0
- package/dist/tools/lang-tool.js +251 -0
- package/dist/tools/layout-override-tool.js +125 -0
- package/dist/tools/layout-tool.js +548 -0
- package/dist/tools/maria-tool.js +127 -0
- package/dist/tools/mariadb.js +201 -0
- package/dist/tools/migration-tool.js +329 -0
- package/dist/tools/oauth-tool.js +520 -0
- package/dist/tools/parser/components-parser.js +76 -0
- package/dist/tools/parser/controllers-parser.js +313 -0
- package/dist/tools/parser/core-parser.js +294 -0
- package/dist/tools/parser/coverage-generator.js +424 -0
- package/dist/tools/parser/events-parser.js +127 -0
- package/dist/tools/parser/fields-parser.js +382 -0
- package/dist/tools/parser/hooks-parser.js +106 -0
- package/dist/tools/parser/sql-parser.js +197 -0
- package/dist/tools/parser/traits-parser.js +161 -0
- package/dist/tools/parser/widgets-parser.js +150 -0
- package/dist/tools/permission-tool.js +348 -0
- package/dist/tools/project-patch-tool.js +73 -0
- package/dist/tools/project-source-tool.js +188 -0
- package/dist/tools/project-workflow-tool.js +186 -0
- package/dist/tools/requirement-tool.js +212 -0
- package/dist/tools/scaffold-tool.js +815 -0
- package/dist/tools/seo-tool.js +412 -0
- package/dist/tools/source-tool.js +155 -0
- package/dist/tools/template-development-tool.js +271 -0
- package/dist/tools/template-overrides-tool.js +294 -0
- package/dist/tools/template-productivity-tool.js +319 -0
- package/dist/tools/template-tool.js +665 -0
- package/dist/tools/test-tool.js +183 -0
- package/dist/tools/webhook-tool.js +427 -0
- package/dist/tools/widget-tool.js +331 -0
- package/dist/tools/wysiwyg-tool.js +137 -0
- package/dist/types/scaffold.js +68 -0
- package/dist/utils/define-tool.js +37 -0
- package/dist/utils/find-tool.js +97 -0
- package/dist/utils/mcp-result.js +18 -0
- package/dist/utils/pagination.js +27 -0
- package/dist/utils/serialization.js +27 -0
- package/package.json +94 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerMetaTools = registerMetaTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const components_js_1 = require("../data/components.js");
|
|
6
|
+
const hooks_js_1 = require("../data/hooks.js");
|
|
7
|
+
const schemas_js_1 = require("../data/schemas.js");
|
|
8
|
+
const version_profiles_js_1 = require("../data/version-profiles.js");
|
|
9
|
+
const artifact_tool_js_1 = require("../tools/artifact-tool.js");
|
|
10
|
+
const define_tool_js_1 = require("../utils/define-tool.js");
|
|
11
|
+
const find_tool_js_1 = require("../utils/find-tool.js");
|
|
12
|
+
const mcp_result_js_1 = require("../utils/mcp-result.js");
|
|
13
|
+
const workflows = {
|
|
14
|
+
addon: [
|
|
15
|
+
'analyze_requirement',
|
|
16
|
+
'get_addon_structure',
|
|
17
|
+
'scaffold_addon',
|
|
18
|
+
'validate_addon',
|
|
19
|
+
'validate_generated_artifacts',
|
|
20
|
+
'build_addon_archive',
|
|
21
|
+
],
|
|
22
|
+
widget: ['list_widgets', 'scaffold_widget', 'validate_generated_artifacts'],
|
|
23
|
+
template: [
|
|
24
|
+
'get_template_structure',
|
|
25
|
+
'scaffold_complete_template',
|
|
26
|
+
'analyze_instantcms_template',
|
|
27
|
+
'scaffold_template_override',
|
|
28
|
+
'scaffold_layout_scheme',
|
|
29
|
+
'validate_layout_scheme',
|
|
30
|
+
'check_template_override_compatibility',
|
|
31
|
+
'merge_template_overrides',
|
|
32
|
+
'audit_template_frontend',
|
|
33
|
+
'extract_template_design_tokens',
|
|
34
|
+
'audit_template_widget_positions',
|
|
35
|
+
'scaffold_template_e2e_environment',
|
|
36
|
+
'index_upstream_template_sources',
|
|
37
|
+
'scaffold_template_php_quality',
|
|
38
|
+
'validate_generated_artifacts',
|
|
39
|
+
],
|
|
40
|
+
audit: [
|
|
41
|
+
'get_server_capabilities',
|
|
42
|
+
'validate_addon',
|
|
43
|
+
'validate_generated_artifacts',
|
|
44
|
+
'inspect_addon_archive',
|
|
45
|
+
],
|
|
46
|
+
repair: [
|
|
47
|
+
'load_instantcms_project',
|
|
48
|
+
'explain_instantcms_project',
|
|
49
|
+
'audit_instantcms_project',
|
|
50
|
+
'plan_project_changes',
|
|
51
|
+
'repair_instantcms_project',
|
|
52
|
+
'create_project_patch',
|
|
53
|
+
'audit_instantcms_project',
|
|
54
|
+
],
|
|
55
|
+
upgrade: [
|
|
56
|
+
'explain_instantcms_project',
|
|
57
|
+
'plan_instantcms_upgrade',
|
|
58
|
+
'plan_project_changes',
|
|
59
|
+
'audit_instantcms_project',
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
const toolCatalog = [
|
|
63
|
+
{
|
|
64
|
+
category: 'addon',
|
|
65
|
+
keywords: ['addon', 'дополнение', 'controller', 'crud'],
|
|
66
|
+
tools: workflows.addon,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
category: 'database',
|
|
70
|
+
keywords: ['database', 'база', 'sql', 'migration'],
|
|
71
|
+
tools: ['introspect_database', 'describe_table', 'scaffold_migration'],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
category: 'integration',
|
|
75
|
+
keywords: ['api', 'oauth', 'webhook', 'email'],
|
|
76
|
+
tools: ['scaffold_api', 'scaffold_oauth', 'scaffold_webhook', 'scaffold_email'],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
category: 'template',
|
|
80
|
+
keywords: ['template', 'шаблон', 'layout', 'widget'],
|
|
81
|
+
tools: workflows.template,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
category: 'project',
|
|
85
|
+
keywords: ['project', 'проект', 'audit', 'аудит', 'repair', 'исправ', 'upgrade', 'обнов'],
|
|
86
|
+
tools: [...workflows.repair, 'plan_instantcms_upgrade'],
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
function registerMetaTools(server) {
|
|
90
|
+
(0, define_tool_js_1.defineTool)(server, 'get_server_capabilities', 'Версии, профили и объём базы знаний MCP-сервера', {}, () => ({
|
|
91
|
+
server_version: '1.2.3',
|
|
92
|
+
tools_count: 100,
|
|
93
|
+
instantcms_profiles: version_profiles_js_1.instantCmsVersionProfiles,
|
|
94
|
+
knowledge: {
|
|
95
|
+
hooks: hooks_js_1.hooks.length,
|
|
96
|
+
hook_categories: hooks_js_1.hookCategories.length,
|
|
97
|
+
components: components_js_1.components.length,
|
|
98
|
+
addon_types: Object.keys(schemas_js_1.addonStructures),
|
|
99
|
+
},
|
|
100
|
+
}));
|
|
101
|
+
(0, define_tool_js_1.defineTool)(server, 'find_tool', 'Подбирает MCP-инструменты по описанию задачи', { query: zod_1.z.string().trim().min(2).max(500) }, args => {
|
|
102
|
+
const query = args.query;
|
|
103
|
+
const { matches, ranked } = (0, find_tool_js_1.findToolCategories)(query, toolCatalog);
|
|
104
|
+
return {
|
|
105
|
+
query,
|
|
106
|
+
matches: matches.length ? matches : toolCatalog,
|
|
107
|
+
ranked,
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
(0, define_tool_js_1.defineTool)(server, 'get_workflow', 'Возвращает рекомендуемую последовательность инструментов', { workflow: zod_1.z.enum(['addon', 'widget', 'template', 'audit', 'repair', 'upgrade']) }, args => {
|
|
111
|
+
const workflow = args.workflow;
|
|
112
|
+
return { workflow, tools: workflows[workflow] };
|
|
113
|
+
});
|
|
114
|
+
(0, define_tool_js_1.defineTool)(server, 'diagnose_request', 'Определяет тип InstantCMS-задачи и рекомендуемый workflow', { request: zod_1.z.string().trim().min(3).max(2000) }, args => {
|
|
115
|
+
const request = args.request;
|
|
116
|
+
const lower = request.toLowerCase();
|
|
117
|
+
const workflow = lower.includes('виджет') || lower.includes('widget')
|
|
118
|
+
? 'widget'
|
|
119
|
+
: lower.includes('шаблон') || lower.includes('template') || lower.includes('layout')
|
|
120
|
+
? 'template'
|
|
121
|
+
: lower.includes('провер') || lower.includes('audit')
|
|
122
|
+
? 'audit'
|
|
123
|
+
: lower.includes('обнов') || lower.includes('upgrade')
|
|
124
|
+
? 'upgrade'
|
|
125
|
+
: lower.includes('исправ') || lower.includes('repair')
|
|
126
|
+
? 'repair'
|
|
127
|
+
: 'addon';
|
|
128
|
+
return { workflow, tools: workflows[workflow] };
|
|
129
|
+
});
|
|
130
|
+
(0, define_tool_js_1.defineToolWithManualResult)(server, 'explain_validation_error', 'Объясняет стабильный код диагностики', { code: zod_1.z.string().trim().min(2).max(100) }, args => {
|
|
131
|
+
const code = args.code;
|
|
132
|
+
const explanations = {
|
|
133
|
+
MISSING_REQUIRED_FILE: 'Добавьте обязательный файл в каталог контроллера.',
|
|
134
|
+
INVALID_BASE_CLASS: 'Проверьте наследование класса InstantCMS.',
|
|
135
|
+
INVALID_ARTIFACT_SYNTAX: 'Разберите файл соответствующим parser и исправьте синтаксис.',
|
|
136
|
+
VALIDATION_NOTICE: 'Проверьте контекст сообщения: код является общим fallback.',
|
|
137
|
+
};
|
|
138
|
+
return explanations[code]
|
|
139
|
+
? (0, mcp_result_js_1.successResult)({ code, explanation: explanations[code] })
|
|
140
|
+
: (0, mcp_result_js_1.errorResult)('UNKNOWN_DIAGNOSTIC_CODE', `Код ${code} не документирован`);
|
|
141
|
+
});
|
|
142
|
+
(0, define_tool_js_1.defineTool)(server, 'compare_instantcms_versions', 'Сравнивает документированные профили InstantCMS', { from: zod_1.z.string(), to: zod_1.z.string() }, args => (0, version_profiles_js_1.compareVersionProfiles)(args.from, args.to));
|
|
143
|
+
(0, define_tool_js_1.defineTool)(server, 'get_project_health', 'Возвращает состояние встроенной базы и рекомендуемые проверки', {}, () => ({
|
|
144
|
+
status: 'ready',
|
|
145
|
+
server_version: '1.2.3',
|
|
146
|
+
tested_instantcms: '2.18.2',
|
|
147
|
+
checks: ['npm run check', 'npm run test:integration', 'npm run build', 'npm audit'],
|
|
148
|
+
}));
|
|
149
|
+
(0, define_tool_js_1.defineTool)(server, 'validate_generated_artifacts', 'Проверяет XML, INI, YAML и форму PHP-файлов настоящими parser-ами', { files: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).refine(files => Object.keys(files).length <= 500) }, args => (0, artifact_tool_js_1.validateGeneratedArtifacts)(args.files));
|
|
150
|
+
(0, define_tool_js_1.defineTool)(server, 'build_addon_archive', 'Создаёт ZIP дополнения в памяти и возвращает base64', { files: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).refine(files => Object.keys(files).length <= 500) }, args => (0, artifact_tool_js_1.buildAddonArchive)(args.files));
|
|
151
|
+
(0, define_tool_js_1.defineTool)(server, 'inspect_addon_archive', 'Проверяет пути и синтаксис файлов ZIP-архива base64', { archive: zod_1.z.string().max(20_000_000) }, args => (0, artifact_tool_js_1.inspectAddonArchive)(args.archive));
|
|
152
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerProjectTools = registerProjectTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const project_workflow_tool_js_1 = require("../tools/project-workflow-tool.js");
|
|
6
|
+
const mcp_result_js_1 = require("../utils/mcp-result.js");
|
|
7
|
+
const project_patch_tool_js_1 = require("../tools/project-patch-tool.js");
|
|
8
|
+
const project_source_tool_js_1 = require("../tools/project-source-tool.js");
|
|
9
|
+
const filesSchema = zod_1.z
|
|
10
|
+
.record(zod_1.z.string(), zod_1.z.string())
|
|
11
|
+
.refine(files => Object.keys(files).length <= 2000);
|
|
12
|
+
const loadLimitsSchema = {
|
|
13
|
+
max_files: zod_1.z.number().int().min(1).max(5000).optional(),
|
|
14
|
+
max_file_bytes: zod_1.z
|
|
15
|
+
.number()
|
|
16
|
+
.int()
|
|
17
|
+
.min(1024)
|
|
18
|
+
.max(5 * 1024 * 1024)
|
|
19
|
+
.optional(),
|
|
20
|
+
max_total_bytes: zod_1.z
|
|
21
|
+
.number()
|
|
22
|
+
.int()
|
|
23
|
+
.min(1024)
|
|
24
|
+
.max(50 * 1024 * 1024)
|
|
25
|
+
.optional(),
|
|
26
|
+
};
|
|
27
|
+
function registerProjectTools(server) {
|
|
28
|
+
server.tool('load_instantcms_project', 'Загружает текстовые файлы проекта из локальной директории или публичного GitHub-репозитория', {
|
|
29
|
+
source: zod_1.z.discriminatedUnion('type', [
|
|
30
|
+
zod_1.z.object({ type: zod_1.z.literal('local'), path: zod_1.z.string().min(1), ...loadLimitsSchema }),
|
|
31
|
+
zod_1.z.object({
|
|
32
|
+
type: zod_1.z.literal('github'),
|
|
33
|
+
repository: zod_1.z.string().min(3),
|
|
34
|
+
ref: zod_1.z.string().min(1).default('main'),
|
|
35
|
+
subpath: zod_1.z.string().default(''),
|
|
36
|
+
...loadLimitsSchema,
|
|
37
|
+
}),
|
|
38
|
+
]),
|
|
39
|
+
}, async ({ source }) => (0, mcp_result_js_1.successResult)(source.type === 'local'
|
|
40
|
+
? await (0, project_source_tool_js_1.loadLocalProject)(source.path, source)
|
|
41
|
+
: await (0, project_source_tool_js_1.loadGithubProject)(source.repository, source.ref, source.subpath, source)));
|
|
42
|
+
server.tool('create_project_patch', 'Создаёт стандартный unified Git patch между двумя project file map', { before: filesSchema, after: filesSchema }, async ({ before, after }) => (0, mcp_result_js_1.successResult)((0, project_patch_tool_js_1.createProjectPatch)(before, after)));
|
|
43
|
+
server.tool('audit_instantcms_project', 'Аудит существующего InstantCMS project file map', { files: filesSchema }, async ({ files }) => (0, mcp_result_js_1.successResult)((0, project_workflow_tool_js_1.auditInstantCmsProject)(files)));
|
|
44
|
+
server.tool('plan_project_changes', 'Строит план исправлений после аудита без изменения файлов', { files: filesSchema }, async ({ files }) => (0, mcp_result_js_1.successResult)((0, project_workflow_tool_js_1.planProjectChanges)(files)));
|
|
45
|
+
server.tool('repair_instantcms_project', 'Применяет только безопасные структурные исправления и возвращает новый file map', { files: filesSchema }, async ({ files }) => (0, mcp_result_js_1.successResult)((0, project_workflow_tool_js_1.repairInstantCmsProject)(files)));
|
|
46
|
+
server.tool('explain_instantcms_project', 'Кратко объясняет структуру существующего InstantCMS проекта', { files: filesSchema }, async ({ files }) => (0, mcp_result_js_1.successResult)((0, project_workflow_tool_js_1.explainInstantCmsProject)(files)));
|
|
47
|
+
server.tool('plan_instantcms_upgrade', 'Планирует обновление проекта между версиями InstantCMS', { files: filesSchema, from: zod_1.z.string().min(2).max(30), to: zod_1.z.string().min(2).max(30) }, async ({ files, from, to }) => (0, mcp_result_js_1.successResult)((0, project_workflow_tool_js_1.planInstantCmsUpgrade)(files, from, to)));
|
|
48
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerResources = registerResources;
|
|
4
|
+
const hooks_js_1 = require("../data/hooks.js");
|
|
5
|
+
const components_js_1 = require("../data/components.js");
|
|
6
|
+
const schemas_js_1 = require("../data/schemas.js");
|
|
7
|
+
function registerResources(server) {
|
|
8
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
9
|
+
server.resource('instantcms-hooks-all', 'instantcms://hooks/all', { mimeType: 'application/json', description: 'Полный список хуков InstantCMS' }, async () => ({
|
|
10
|
+
contents: [
|
|
11
|
+
{
|
|
12
|
+
uri: 'instantcms://hooks/all',
|
|
13
|
+
mimeType: 'application/json',
|
|
14
|
+
text: JSON.stringify({ total: hooks_js_1.hooks.length, categories: hooks_js_1.hookCategories, hooks: hooks_js_1.hooks }, null, 2),
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
}));
|
|
18
|
+
server.resource('instantcms-components-all', 'instantcms://components/all', { mimeType: 'application/json', description: 'Все компоненты и их API' }, async () => ({
|
|
19
|
+
contents: [
|
|
20
|
+
{
|
|
21
|
+
uri: 'instantcms://components/all',
|
|
22
|
+
mimeType: 'application/json',
|
|
23
|
+
text: JSON.stringify({ total: components_js_1.components.length, components: components_js_1.components }, null, 2),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
}));
|
|
27
|
+
server.resource('instantcms-addon-types', 'instantcms://addon/types', { mimeType: 'application/json', description: 'Типы дополнений и их структуры' }, async () => ({
|
|
28
|
+
contents: [
|
|
29
|
+
{
|
|
30
|
+
uri: 'instantcms://addon/types',
|
|
31
|
+
mimeType: 'application/json',
|
|
32
|
+
text: JSON.stringify(schemas_js_1.addonStructures, null, 2),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
}));
|
|
36
|
+
server.resource('instantcms-quickstart', 'instantcms://quickstart', { mimeType: 'text/markdown', description: 'Краткое руководство по созданию дополнения' }, async () => ({
|
|
37
|
+
contents: [
|
|
38
|
+
{
|
|
39
|
+
uri: 'instantcms://quickstart',
|
|
40
|
+
mimeType: 'text/markdown',
|
|
41
|
+
text: `# Быстрый старт: создание дополнения InstantCMS 2
|
|
42
|
+
|
|
43
|
+
## 1. Минимальный набор файлов
|
|
44
|
+
\`\`\`
|
|
45
|
+
/system/controllers/myaddon/
|
|
46
|
+
├── manifest.xml ← метаданные и хуки
|
|
47
|
+
├── install.php ← создание таблиц
|
|
48
|
+
├── uninstall.php ← удаление таблиц
|
|
49
|
+
├── frontend.php ← контроллер (class myaddon extends cmsFrontend)
|
|
50
|
+
└── model.php ← модель (class modelMyaddon extends cmsModel)
|
|
51
|
+
\`\`\`
|
|
52
|
+
|
|
53
|
+
## 2. Соглашения об именовании классов
|
|
54
|
+
| Файл | Класс |
|
|
55
|
+
|------|-------|
|
|
56
|
+
| frontend.php | \`class myaddon extends cmsFrontend\` |
|
|
57
|
+
| backend.php | \`class backendMyaddon extends cmsBackend\` |
|
|
58
|
+
| model.php | \`class modelMyaddon extends cmsModel\` |
|
|
59
|
+
| hooks/hook_name.php | \`class onMyaddonHookName extends cmsAction\` |
|
|
60
|
+
| forms/form_item.php | \`class formMyaddonItem extends cmsForm\` |
|
|
61
|
+
| grids/grid_items.php | \`function grid_items($controller) { return [...]; }\` |
|
|
62
|
+
| widgets/list/widget.php | \`class widgetMyaddonList extends cmsWidget\` |
|
|
63
|
+
|
|
64
|
+
## 3. Базовый паттерн action
|
|
65
|
+
\`\`\`php
|
|
66
|
+
public function actionIndex() {
|
|
67
|
+
$items = $this->model->filterEqual('is_pub', 1)->get('myaddon_items');
|
|
68
|
+
return $this->cms_template->render('index', ['items' => $items]);
|
|
69
|
+
}
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
## 4. Регистрация хука в manifest.xml
|
|
73
|
+
\`\`\`xml
|
|
74
|
+
<hooks>
|
|
75
|
+
<hook controller="myaddon" name="content_after_add_approve" />
|
|
76
|
+
</hooks>
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
## 5. Файл хука hooks/content_after_add_approve.php
|
|
80
|
+
\`\`\`php
|
|
81
|
+
class onMyaddonContentAfterAddApprove extends cmsAction {
|
|
82
|
+
public function run($data) {
|
|
83
|
+
// логика
|
|
84
|
+
return $data; // ОБЯЗАТЕЛЬНО
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
\`\`\`
|
|
88
|
+
|
|
89
|
+
## Инструменты MCP
|
|
90
|
+
- \`scaffold_addon\` — сгенерировать все файлы дополнения
|
|
91
|
+
- \`get_hook_details\` — детали хука с примером кода
|
|
92
|
+
- \`get_component_api\` — API класса (cmsModel, cmsTemplate и др.)
|
|
93
|
+
- \`validate_addon\` — проверить корректность структуры
|
|
94
|
+
`,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerSourceTools = registerSourceTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const addon_tool_js_1 = require("../tools/addon-tool.js");
|
|
6
|
+
const source_tool_js_1 = require("../tools/source-tool.js");
|
|
7
|
+
const migration_tool_js_1 = require("../tools/migration-tool.js");
|
|
8
|
+
const requirement_tool_js_1 = require("../tools/requirement-tool.js");
|
|
9
|
+
function registerSourceTools(server) {
|
|
10
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
11
|
+
// SOURCE CODE TOOLS (Фаза 2: Виджеты, трейты, поля)
|
|
12
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
13
|
+
// ── 29. Список виджетов ─────────────────────────────────────────────────
|
|
14
|
+
server.tool('list_widgets', 'Список всех доступных виджетов InstantCMS. Можно фильтровать по контроллеру.', {
|
|
15
|
+
controller: zod_1.z.string().optional().describe('Фильтр по контроллеру. Пример: content, users'),
|
|
16
|
+
}, async ({ controller }) => {
|
|
17
|
+
const result = (0, source_tool_js_1.listWidgets)(controller);
|
|
18
|
+
return {
|
|
19
|
+
content: [
|
|
20
|
+
{
|
|
21
|
+
type: 'text',
|
|
22
|
+
text: JSON.stringify(result, null, 2),
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
// ── 30. Информация о виджете ────────────────────────────────────────────
|
|
28
|
+
server.tool('get_widget_info', 'Подробная информация о виджете: класс, файл, настройки.', {
|
|
29
|
+
name: zod_1.z.string().describe('Имя виджета. Пример: text, menu, html'),
|
|
30
|
+
}, async ({ name }) => {
|
|
31
|
+
const result = (0, source_tool_js_1.getWidgetInfo)(name);
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: 'text',
|
|
36
|
+
text: JSON.stringify(result, null, 2),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
// ── 31. Список трейтов ─────────────────────────────────────────────────
|
|
42
|
+
server.tool('list_traits', 'Список всех системных трейтов. Можно фильтровать по namespace.', {
|
|
43
|
+
namespace: zod_1.z
|
|
44
|
+
.string()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('Фильтр по namespace. Пример: services, controllers'),
|
|
47
|
+
}, async ({ namespace }) => {
|
|
48
|
+
const result = (0, source_tool_js_1.listTraits)(namespace);
|
|
49
|
+
return {
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: 'text',
|
|
53
|
+
text: JSON.stringify(result, null, 2),
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
// ── 32. Информация о трейте ────────────────────────────────────────────
|
|
59
|
+
server.tool('get_trait_info', 'Подробная информация о трейте: методы, параметры, описание.', {
|
|
60
|
+
name: zod_1.z.string().describe('Имя трейта. Пример: fieldsParseable, listgrid'),
|
|
61
|
+
}, async ({ name }) => {
|
|
62
|
+
const result = (0, source_tool_js_1.getTraitInfo)(name);
|
|
63
|
+
return {
|
|
64
|
+
content: [
|
|
65
|
+
{
|
|
66
|
+
type: 'text',
|
|
67
|
+
text: JSON.stringify(result, null, 2),
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
// ── 33. Список типов полей ─────────────────────────────────────────────
|
|
73
|
+
server.tool('list_field_types', 'Список всех типов полей для форм InstantCMS: string, text, image, list и др.', {}, async () => {
|
|
74
|
+
const result = (0, source_tool_js_1.listFields)();
|
|
75
|
+
return {
|
|
76
|
+
content: [
|
|
77
|
+
{
|
|
78
|
+
type: 'text',
|
|
79
|
+
text: JSON.stringify(result, null, 2),
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
// ── 34. Информация о поле ─────────────────────────────────────────────
|
|
85
|
+
server.tool('get_field_type_info', 'Подробная информация о типе поля: класс, опции, описание.', {
|
|
86
|
+
name: zod_1.z.string().describe('Имя типа поля. Пример: string, list, image, date'),
|
|
87
|
+
}, async ({ name }) => {
|
|
88
|
+
const result = (0, source_tool_js_1.getFieldInfo)(name);
|
|
89
|
+
return {
|
|
90
|
+
content: [
|
|
91
|
+
{
|
|
92
|
+
type: 'text',
|
|
93
|
+
text: JSON.stringify(result, null, 2),
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
// ── 35. Список маршрутов ───────────────────────────────────────────────
|
|
99
|
+
server.tool('list_routes', 'Список всех маршрутов (routes) системы. Маршруты определяют URL-паттерны и действия контроллеров.', {
|
|
100
|
+
controller: zod_1.z
|
|
101
|
+
.string()
|
|
102
|
+
.optional()
|
|
103
|
+
.describe('Имя контроллера для фильтрации (content, photos)'),
|
|
104
|
+
}, async ({ controller }) => {
|
|
105
|
+
const result = (0, source_tool_js_1.listRoutes)(controller);
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: 'text',
|
|
110
|
+
text: JSON.stringify(result, null, 2),
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
// ── 36. Генерация миграции ────────────────────────────────────────────
|
|
116
|
+
server.tool('generate_migration', 'Генерация SQL и PHP кода для создания таблицы. Генерирует install.php, SQL CREATE TABLE и соглашения по именованию.', {
|
|
117
|
+
name: zod_1.z
|
|
118
|
+
.string()
|
|
119
|
+
.describe('Имя таблицы (без префикса cms_). Пример: my_items, catalog_products'),
|
|
120
|
+
fields: zod_1.z
|
|
121
|
+
.array(zod_1.z.object({
|
|
122
|
+
name: zod_1.z.string().describe('Имя поля'),
|
|
123
|
+
type: zod_1.z
|
|
124
|
+
.string()
|
|
125
|
+
.describe('Тип: varchar(255), text, int(11), datetime, tinyint(1), decimal(10,2)'),
|
|
126
|
+
nullable: zod_1.z.boolean().optional().describe('Может быть NULL'),
|
|
127
|
+
default: zod_1.z.string().optional().describe('Значение по умолчанию'),
|
|
128
|
+
comment: zod_1.z.string().optional().describe('Комментарий к полю'),
|
|
129
|
+
}))
|
|
130
|
+
.describe('Массив полей таблицы'),
|
|
131
|
+
}, async ({ name, fields }) => {
|
|
132
|
+
const result = (0, migration_tool_js_1.generateMigration)(name, fields);
|
|
133
|
+
return {
|
|
134
|
+
content: [
|
|
135
|
+
{
|
|
136
|
+
type: 'text',
|
|
137
|
+
text: JSON.stringify(result, null, 2),
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
// ── 36. Подсказки по полям ────────────────────────────────────────────
|
|
143
|
+
server.tool('get_field_suggestions', 'Подсказки по типичным полям для генерации миграций: string, text, number, datetime, user, bool.', {
|
|
144
|
+
field_type: zod_1.z
|
|
145
|
+
.enum(['string', 'text', 'number', 'datetime', 'user', 'bool'])
|
|
146
|
+
.describe('Тип категории полей'),
|
|
147
|
+
}, async ({ field_type }) => {
|
|
148
|
+
const result = (0, migration_tool_js_1.generateFieldSuggestions)(field_type);
|
|
149
|
+
return {
|
|
150
|
+
content: [
|
|
151
|
+
{
|
|
152
|
+
type: 'text',
|
|
153
|
+
text: JSON.stringify(result, null, 2),
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
// ── 37. Анализ требований ──────────────────────────────────────────
|
|
159
|
+
server.tool('analyze_requirement', 'AI анализ запроса пользователя и предложение структуры дополнения. Определяет тип дополнения, необходимые хуки, таблицы, контроллеры.', {
|
|
160
|
+
requirement: zod_1.z
|
|
161
|
+
.string()
|
|
162
|
+
.describe("Описание задачи. Пример: 'каталог товаров с корзиной', 'блог с комментариями', 'RSS лента новостей'"),
|
|
163
|
+
}, async ({ requirement }) => {
|
|
164
|
+
const result = (0, requirement_tool_js_1.analyzeRequirement)(requirement);
|
|
165
|
+
return {
|
|
166
|
+
content: [
|
|
167
|
+
{
|
|
168
|
+
type: 'text',
|
|
169
|
+
text: JSON.stringify(result, null, 2),
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
});
|
|
174
|
+
// ── 38. Структура по типу ─────────────────────────────────────────
|
|
175
|
+
server.tool('suggest_addon_structure', 'Предложить структуру файлов для типа дополнения (basic, with_admin, with_hooks, with_routes, with_widget).', {
|
|
176
|
+
type: zod_1.z
|
|
177
|
+
.enum(['basic', 'with_admin', 'with_hooks', 'with_routes', 'with_widget'])
|
|
178
|
+
.describe('Тип дополнения'),
|
|
179
|
+
}, async ({ type }) => {
|
|
180
|
+
const result = (0, requirement_tool_js_1.suggestAddonStructure)(type);
|
|
181
|
+
return {
|
|
182
|
+
content: [
|
|
183
|
+
{
|
|
184
|
+
type: 'text',
|
|
185
|
+
text: JSON.stringify(result, null, 2),
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
// ── 39. Генерация хука ───────────────────────────────────────────────
|
|
191
|
+
server.tool('scaffold_hook', 'Генерирует PHP файл хука с полным кодом класса. Автоматически определяет параметры, тип (action/filter), формирует className.', {
|
|
192
|
+
addon_name: zod_1.z.string().describe('Имя дополнения (техническое). Пример: myaddon'),
|
|
193
|
+
hook_name: zod_1.z
|
|
194
|
+
.string()
|
|
195
|
+
.describe('Имя хука. Пример: content_after_add_approve, user_registered'),
|
|
196
|
+
type: zod_1.z
|
|
197
|
+
.enum(['action', 'filter'])
|
|
198
|
+
.optional()
|
|
199
|
+
.describe('Тип хука: action (реагирует на событие) или filter (изменяет данные)'),
|
|
200
|
+
}, async ({ addon_name, hook_name, type }) => {
|
|
201
|
+
const result = (0, addon_tool_js_1.scaffoldHook)({ addon_name, hook_name, type });
|
|
202
|
+
return {
|
|
203
|
+
content: [
|
|
204
|
+
{
|
|
205
|
+
type: 'text',
|
|
206
|
+
text: JSON.stringify(result, null, 2),
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerTemplateDevelopmentTools = registerTemplateDevelopmentTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const template_development_tool_js_1 = require("../tools/template-development-tool.js");
|
|
6
|
+
const mcp_result_js_1 = require("../utils/mcp-result.js");
|
|
7
|
+
const template_productivity_tool_js_1 = require("../tools/template-productivity-tool.js");
|
|
8
|
+
const templateFilesSchema = zod_1.z
|
|
9
|
+
.record(zod_1.z.string(), zod_1.z.string())
|
|
10
|
+
.refine(files => Object.keys(files).length <= 3000);
|
|
11
|
+
function registerTemplateDevelopmentTools(server) {
|
|
12
|
+
server.tool('merge_template_overrides', 'Безопасно переносит upstream-изменения в неизменённые overrides и возвращает Git patch', {
|
|
13
|
+
theme_files: templateFilesSchema,
|
|
14
|
+
upstream_before: templateFilesSchema,
|
|
15
|
+
upstream_after: templateFilesSchema,
|
|
16
|
+
}, async ({ theme_files, upstream_before, upstream_after }) => (0, mcp_result_js_1.successResult)((0, template_productivity_tool_js_1.mergeTemplateOverrides)(theme_files, upstream_before, upstream_after)));
|
|
17
|
+
server.tool('audit_template_frontend', 'Проверяет HTML, accessibility, escaping и качество CSS файлов шаблона', { files: templateFilesSchema }, async ({ files }) => (0, mcp_result_js_1.successResult)((0, template_productivity_tool_js_1.auditTemplateFrontend)(files)));
|
|
18
|
+
server.tool('extract_template_design_tokens', 'Извлекает CSS custom properties, цвета и spacing и предлагает design tokens', { files: templateFilesSchema }, async ({ files }) => (0, mcp_result_js_1.successResult)((0, template_productivity_tool_js_1.extractTemplateDesignTokens)(files)));
|
|
19
|
+
server.tool('audit_template_widget_positions', 'Сопоставляет позиции виджетов в PHP-шаблонах и YAML layout-схемах', { files: templateFilesSchema }, async ({ files }) => (0, mcp_result_js_1.successResult)((0, template_productivity_tool_js_1.auditTemplateWidgetPositions)(files)));
|
|
20
|
+
server.tool('scaffold_template_e2e_environment', 'Генерирует Docker Compose и Playwright visual regression окружение для темы', {
|
|
21
|
+
theme: zod_1.z.string().regex(/^[a-z][a-z0-9_]{1,63}$/),
|
|
22
|
+
base_url: zod_1.z.string().url().optional(),
|
|
23
|
+
}, async (options) => (0, mcp_result_js_1.successResult)((0, template_productivity_tool_js_1.scaffoldTemplateE2eEnvironment)(options)));
|
|
24
|
+
server.tool('index_upstream_template_sources', 'Индексирует upstream template-файлы с SHA-256 и ссылками на исходный commit', {
|
|
25
|
+
files: templateFilesSchema,
|
|
26
|
+
repository: zod_1.z.string().regex(/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/),
|
|
27
|
+
ref: zod_1.z.string().regex(/^[a-zA-Z0-9._/-]+$/),
|
|
28
|
+
}, async ({ files, repository, ref }) => (0, mcp_result_js_1.successResult)((0, template_productivity_tool_js_1.indexUpstreamTemplateSources)(files, { repository, ref })));
|
|
29
|
+
server.tool('scaffold_template_php_quality', 'Генерирует PHPStan, PHPCS и PHPCompatibility конфигурацию для шаблона', {
|
|
30
|
+
theme: zod_1.z.string().regex(/^[a-z][a-z0-9_]{1,63}$/),
|
|
31
|
+
php_min: zod_1.z
|
|
32
|
+
.string()
|
|
33
|
+
.regex(/^\d+\.\d+$/)
|
|
34
|
+
.optional()
|
|
35
|
+
.default('7.2'),
|
|
36
|
+
}, async (options) => (0, mcp_result_js_1.successResult)((0, template_productivity_tool_js_1.scaffoldTemplatePhpQuality)(options)));
|
|
37
|
+
server.tool('scaffold_complete_template', 'Создаёт полный каркас frontend-шаблона InstantCMS и импортируемую layout-схему', {
|
|
38
|
+
name: zod_1.z.string().regex(/^[a-z][a-z0-9_]{1,63}$/),
|
|
39
|
+
title: zod_1.z.string().trim().min(1).max(200),
|
|
40
|
+
author: zod_1.z.string().trim().max(200).optional(),
|
|
41
|
+
inherit: zod_1.z
|
|
42
|
+
.array(zod_1.z.string().regex(/^[a-z][a-z0-9_]{1,63}$/))
|
|
43
|
+
.max(10)
|
|
44
|
+
.optional(),
|
|
45
|
+
with_layout_scheme: zod_1.z.boolean().optional().default(true),
|
|
46
|
+
}, async (options) => (0, mcp_result_js_1.successResult)((0, template_development_tool_js_1.scaffoldCompleteTemplate)(options)));
|
|
47
|
+
server.tool('analyze_instantcms_template', 'Анализирует структуру, overrides, widget positions, layout-файлы и риски шаблона', {
|
|
48
|
+
files: templateFilesSchema,
|
|
49
|
+
theme: zod_1.z
|
|
50
|
+
.string()
|
|
51
|
+
.regex(/^[a-z][a-z0-9_]{1,63}$/)
|
|
52
|
+
.optional(),
|
|
53
|
+
}, async ({ files, theme }) => (0, mcp_result_js_1.successResult)((0, template_development_tool_js_1.analyzeInstantCmsTemplate)(files, theme)));
|
|
54
|
+
server.tool('scaffold_template_override', 'Создаёт точную копию upstream template-файла в правильном каталоге override темы', {
|
|
55
|
+
theme: zod_1.z.string().regex(/^[a-z][a-z0-9_]{1,63}$/),
|
|
56
|
+
source_path: zod_1.z.string().min(1).max(500),
|
|
57
|
+
source_content: zod_1.z.string().max(2 * 1024 * 1024),
|
|
58
|
+
controller: zod_1.z
|
|
59
|
+
.string()
|
|
60
|
+
.regex(/^[a-z][a-z0-9_]{1,63}$/)
|
|
61
|
+
.optional(),
|
|
62
|
+
action: zod_1.z
|
|
63
|
+
.string()
|
|
64
|
+
.regex(/^[a-z][a-z0-9_]{0,63}$/)
|
|
65
|
+
.optional(),
|
|
66
|
+
backend: zod_1.z.boolean().optional(),
|
|
67
|
+
}, async (options) => (0, mcp_result_js_1.successResult)((0, template_development_tool_js_1.scaffoldTemplateOverride)(options)));
|
|
68
|
+
server.tool('validate_layout_scheme', 'Проверяет YAML-синтаксис, layout root и widget positions схемы InstantCMS', {
|
|
69
|
+
yaml: zod_1.z
|
|
70
|
+
.string()
|
|
71
|
+
.min(1)
|
|
72
|
+
.max(2 * 1024 * 1024),
|
|
73
|
+
}, async ({ yaml }) => (0, mcp_result_js_1.successResult)((0, template_development_tool_js_1.validateLayoutScheme)(yaml)));
|
|
74
|
+
server.tool('check_template_override_compatibility', 'Сравнивает overrides темы с upstream template-файлами до и после обновления InstantCMS', {
|
|
75
|
+
theme_files: templateFilesSchema,
|
|
76
|
+
upstream_before: templateFilesSchema,
|
|
77
|
+
upstream_after: templateFilesSchema,
|
|
78
|
+
}, async ({ theme_files, upstream_before, upstream_after }) => (0, mcp_result_js_1.successResult)((0, template_development_tool_js_1.checkTemplateOverrideCompatibility)(theme_files, upstream_before, upstream_after)));
|
|
79
|
+
}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createServer = createServer;
|
|
4
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
5
|
+
const meta_tools_js_1 = require("./registry/meta-tools.js");
|
|
6
|
+
const generator_tools_js_1 = require("./registry/generator-tools.js");
|
|
7
|
+
const knowledge_tools_js_1 = require("./registry/knowledge-tools.js");
|
|
8
|
+
const database_tools_js_1 = require("./registry/database-tools.js");
|
|
9
|
+
const source_tools_js_1 = require("./registry/source-tools.js");
|
|
10
|
+
const language_tools_js_1 = require("./registry/language-tools.js");
|
|
11
|
+
const extension_tools_js_1 = require("./registry/extension-tools.js");
|
|
12
|
+
const resources_js_1 = require("./registry/resources.js");
|
|
13
|
+
const project_tools_js_1 = require("./registry/project-tools.js");
|
|
14
|
+
const template_development_tools_js_1 = require("./registry/template-development-tools.js");
|
|
15
|
+
function createServer() {
|
|
16
|
+
const server = new mcp_js_1.McpServer({
|
|
17
|
+
name: 'instantcms-mcp',
|
|
18
|
+
version: '1.2.0',
|
|
19
|
+
description: 'MCP сервер для разработки дополнений и шаблонов InstantCMS 2',
|
|
20
|
+
});
|
|
21
|
+
(0, meta_tools_js_1.registerMetaTools)(server);
|
|
22
|
+
(0, generator_tools_js_1.registerGeneratorTools)(server);
|
|
23
|
+
(0, knowledge_tools_js_1.registerKnowledgeTools)(server);
|
|
24
|
+
(0, database_tools_js_1.registerDatabaseTools)(server);
|
|
25
|
+
(0, source_tools_js_1.registerSourceTools)(server);
|
|
26
|
+
(0, language_tools_js_1.registerLanguageTools)(server);
|
|
27
|
+
(0, extension_tools_js_1.registerExtensionTools)(server);
|
|
28
|
+
(0, resources_js_1.registerResources)(server);
|
|
29
|
+
(0, project_tools_js_1.registerProjectTools)(server);
|
|
30
|
+
(0, template_development_tools_js_1.registerTemplateDevelopmentTools)(server);
|
|
31
|
+
return server;
|
|
32
|
+
}
|