@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,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.knowledgeCatalog = void 0;
|
|
4
|
+
// Generated by scripts/build-knowledge.ts. Do not edit.
|
|
5
|
+
exports.knowledgeCatalog = {
|
|
6
|
+
"schema_version": 1,
|
|
7
|
+
"instantcms": {
|
|
8
|
+
"tested_version": "2.18.2",
|
|
9
|
+
"minimum_version": "2.16"
|
|
10
|
+
},
|
|
11
|
+
"upstream": {
|
|
12
|
+
"repository": "https://github.com/instantsoft/icms2.git",
|
|
13
|
+
"state_file": "knowledge/upstream.json"
|
|
14
|
+
},
|
|
15
|
+
"sources": [
|
|
16
|
+
{
|
|
17
|
+
"id": "runtime-hooks",
|
|
18
|
+
"runtime_file": "src/data/hooks.ts",
|
|
19
|
+
"domain": "hooks",
|
|
20
|
+
"confidence": "inferred",
|
|
21
|
+
"verified_at": "2026-08-26"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "runtime-components",
|
|
25
|
+
"runtime_file": "src/data/components.ts",
|
|
26
|
+
"domain": "components",
|
|
27
|
+
"confidence": "inferred",
|
|
28
|
+
"verified_at": "2026-08-26"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "generated-hooks-source",
|
|
32
|
+
"runtime_file": "src/generated/hooks-source.ts",
|
|
33
|
+
"domain": "hooks",
|
|
34
|
+
"confidence": "verified",
|
|
35
|
+
"verified_at": "2026-08-26"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "generated-components-source",
|
|
39
|
+
"runtime_file": "src/generated/components-source.ts",
|
|
40
|
+
"domain": "components",
|
|
41
|
+
"confidence": "verified",
|
|
42
|
+
"verified_at": "2026-08-26"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "runtime-schemas",
|
|
46
|
+
"runtime_file": "src/data/schemas.ts",
|
|
47
|
+
"domain": "schemas",
|
|
48
|
+
"confidence": "verified",
|
|
49
|
+
"verified_at": "2026-08-26"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "generated-database",
|
|
53
|
+
"runtime_file": "src/data/database-schema.ts",
|
|
54
|
+
"domain": "database",
|
|
55
|
+
"confidence": "verified",
|
|
56
|
+
"verified_at": "2026-08-26"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "generated-events",
|
|
60
|
+
"runtime_file": "src/data/events-map.ts",
|
|
61
|
+
"domain": "events",
|
|
62
|
+
"confidence": "verified",
|
|
63
|
+
"verified_at": "2026-08-26"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "generated-controllers",
|
|
67
|
+
"runtime_file": "src/data/controllers-map.ts",
|
|
68
|
+
"domain": "controllers",
|
|
69
|
+
"confidence": "verified",
|
|
70
|
+
"verified_at": "2026-08-26"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "generated-widgets",
|
|
74
|
+
"runtime_file": "src/data/widgets-map.ts",
|
|
75
|
+
"domain": "widgets",
|
|
76
|
+
"confidence": "verified",
|
|
77
|
+
"verified_at": "2026-08-26"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "generated-traits",
|
|
81
|
+
"runtime_file": "src/data/traits-map.ts",
|
|
82
|
+
"domain": "traits",
|
|
83
|
+
"confidence": "verified",
|
|
84
|
+
"verified_at": "2026-08-26"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "generated-fields",
|
|
88
|
+
"runtime_file": "src/data/fields-map.ts",
|
|
89
|
+
"domain": "fields",
|
|
90
|
+
"confidence": "verified",
|
|
91
|
+
"verified_at": "2026-08-26"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "generated-core-api",
|
|
95
|
+
"runtime_file": "src/data/core-api.ts",
|
|
96
|
+
"domain": "core",
|
|
97
|
+
"confidence": "verified",
|
|
98
|
+
"verified_at": "2026-08-26"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
5
|
+
const server_js_1 = require("./server.js");
|
|
6
|
+
const server = (0, server_js_1.createServer)();
|
|
7
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
8
|
+
server.connect(transport).then(() => {
|
|
9
|
+
// Server is running via stdio
|
|
10
|
+
}).catch((err) => {
|
|
11
|
+
console.error("Failed to start InstantCMS MCP server:", err);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDatabaseTools = registerDatabaseTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const maria_tool_js_1 = require("../tools/maria-tool.js");
|
|
6
|
+
function registerDatabaseTools(server) {
|
|
7
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
8
|
+
// MARIADB TOOLS (Фаза 1: Работа с базой данных)
|
|
9
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
10
|
+
// Внимание: Для работы требуется настроить переменные окружения:
|
|
11
|
+
// DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_DATABASE
|
|
12
|
+
// ── 23. Выполнить SQL запрос ─────────────────────────────────────────────
|
|
13
|
+
server.tool('maria_execute_query', 'Выполняет произвольный SQL запрос к базе данных MariaDB. Возвращает результат с колонками, строками и временем выполнения.', {
|
|
14
|
+
sql: zod_1.z
|
|
15
|
+
.string()
|
|
16
|
+
.describe('SQL запрос для выполнения. Пример: SELECT * FROM cms_users LIMIT 10'),
|
|
17
|
+
}, async ({ sql }) => {
|
|
18
|
+
const result = await (0, maria_tool_js_1.mariaExecuteQuery)(sql);
|
|
19
|
+
return {
|
|
20
|
+
content: [
|
|
21
|
+
{
|
|
22
|
+
type: 'text',
|
|
23
|
+
text: JSON.stringify(result, null, 2),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
// ── 24. Список таблиц ────────────────────────────────────────────────────
|
|
29
|
+
server.tool('maria_list_tables', 'Возвращает список всех таблиц в текущей базе данных MariaDB.', {}, async () => {
|
|
30
|
+
const result = await (0, maria_tool_js_1.mariaListTables)();
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: 'text',
|
|
35
|
+
text: JSON.stringify(result, null, 2),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
// ── 25. Описание таблицы ────────────────────────────────────────────────
|
|
41
|
+
server.tool('maria_describe_table', 'Подробное описание структуры таблицы: колонки, типы, индексы, количество строк.', {
|
|
42
|
+
table_name: zod_1.z.string().describe('Имя таблицы. Пример: cms_users, cms_content'),
|
|
43
|
+
}, async ({ table_name }) => {
|
|
44
|
+
const result = await (0, maria_tool_js_1.mariaDescribeTable)(table_name);
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: 'text',
|
|
49
|
+
text: JSON.stringify(result, null, 2),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
// ── 26. Информация о базе данных ─────────────────────────────────────────
|
|
55
|
+
server.tool('maria_get_database_info', 'Статистика базы данных: имя, количество таблиц, строк, размер.', {}, async () => {
|
|
56
|
+
const result = await (0, maria_tool_js_1.mariaGetDatabaseInfo)();
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: JSON.stringify(result, null, 2),
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
// ── 27. Поиск таблиц ─────────────────────────────────────────────────────
|
|
67
|
+
server.tool('maria_search_tables', 'Поиск таблиц по имени. Полезно когда не помните точное имя таблицы.', {
|
|
68
|
+
pattern: zod_1.z.string().describe('Строка для поиска. Пример: users, content, widget'),
|
|
69
|
+
}, async ({ pattern }) => {
|
|
70
|
+
const result = await (0, maria_tool_js_1.mariaSearchTables)(pattern);
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: 'text',
|
|
75
|
+
text: JSON.stringify(result, null, 2),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
// ── 28. Данные из таблицы ───────────────────────────────────────────────
|
|
81
|
+
server.tool('maria_get_table_data', 'Получить данные из таблицы с поддержкой пагинации, сортировки и фильтрации.', {
|
|
82
|
+
table_name: zod_1.z.string().describe('Имя таблицы. Пример: cms_users'),
|
|
83
|
+
limit: zod_1.z.number().optional().default(20).describe('Количество строк (по умолчанию 20)'),
|
|
84
|
+
offset: zod_1.z.number().optional().default(0).describe('Смещение для пагинации'),
|
|
85
|
+
order_by: zod_1.z.string().optional().default('id').describe('Поле для сортировки'),
|
|
86
|
+
order_dir: zod_1.z
|
|
87
|
+
.enum(['ASC', 'DESC'])
|
|
88
|
+
.optional()
|
|
89
|
+
.default('DESC')
|
|
90
|
+
.describe('Направление сортировки'),
|
|
91
|
+
filter: zod_1.z
|
|
92
|
+
.record(zod_1.z.string(), zod_1.z.unknown())
|
|
93
|
+
.optional()
|
|
94
|
+
.describe('Фильтр в формате {поле: значение}'),
|
|
95
|
+
}, async ({ table_name, limit, offset, order_by, order_dir, filter }) => {
|
|
96
|
+
const result = await (0, maria_tool_js_1.mariaGetTableData)(table_name, {
|
|
97
|
+
limit,
|
|
98
|
+
offset,
|
|
99
|
+
orderBy: order_by,
|
|
100
|
+
orderDir: order_dir,
|
|
101
|
+
filter,
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
content: [
|
|
105
|
+
{
|
|
106
|
+
type: 'text',
|
|
107
|
+
text: JSON.stringify(result, null, 2),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
}
|