@ace-grid/mcp 1.0.6
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 +94 -0
- package/data/apiSpecCoverage.json +408 -0
- package/data/apiSpecQuality.json +15 -0
- package/data/docsIndex.json +4632 -0
- package/data/formulaFunctionSnapshot.json +1137 -0
- package/data/gridApiSnapshot.json +9162 -0
- package/dist/catalog.d.ts +229 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +518 -0
- package/dist/demoServer.d.ts +2 -0
- package/dist/demoServer.d.ts.map +1 -0
- package/dist/demoServer.js +324 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/portalApi.d.ts +18 -0
- package/dist/portalApi.d.ts.map +1 -0
- package/dist/portalApi.js +34 -0
- package/dist/tools.d.ts +78 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +154 -0
- package/package.json +58 -0
package/dist/tools.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { formulaSnapshot, generateImplementation, generateReactExample, getDocsPage, getFrameworkExample, getProp, gridSnapshot, licenseSetupGuide, listDocsPages, listFeatureGroups, listFrameworkExamples, planImplementation, searchCatalog, searchDocs, searchEverything, validateGridConfig, } from "./catalog.js";
|
|
2
|
+
import { PortalClient } from "./portalApi.js";
|
|
3
|
+
function jsonResult(value) {
|
|
4
|
+
return {
|
|
5
|
+
content: [
|
|
6
|
+
{
|
|
7
|
+
type: "text",
|
|
8
|
+
text: JSON.stringify(value, null, 2),
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function textResult(text) {
|
|
14
|
+
return {
|
|
15
|
+
content: [
|
|
16
|
+
{
|
|
17
|
+
type: "text",
|
|
18
|
+
text,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export const toolHandlers = {
|
|
24
|
+
searchDocs(input) {
|
|
25
|
+
return jsonResult({
|
|
26
|
+
apiGeneratedAt: gridSnapshot.generatedAt,
|
|
27
|
+
docsGeneratedAt: undefined,
|
|
28
|
+
results: searchEverything(input.query, input.limit),
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
searchApi(input) {
|
|
32
|
+
return jsonResult({
|
|
33
|
+
generatedAt: gridSnapshot.generatedAt,
|
|
34
|
+
results: searchCatalog(input.query, input.limit),
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
searchDocsPages(input) {
|
|
38
|
+
return jsonResult({
|
|
39
|
+
results: searchDocs(input.query, input.limit),
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
listFeatureGroups() {
|
|
43
|
+
return jsonResult({
|
|
44
|
+
featureGroupCount: gridSnapshot.featureGroupCount,
|
|
45
|
+
formulaFunctionCount: formulaSnapshot.functionCount,
|
|
46
|
+
groups: listFeatureGroups(),
|
|
47
|
+
propCount: gridSnapshot.propCount,
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
listDocsPages() {
|
|
51
|
+
return jsonResult({
|
|
52
|
+
pages: listDocsPages(),
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
getDocsPage(input) {
|
|
56
|
+
const page = getDocsPage(input.slugOrPath);
|
|
57
|
+
if (!page) {
|
|
58
|
+
return jsonResult({
|
|
59
|
+
ok: false,
|
|
60
|
+
message: `No Ace Grid docs page found for ${input.slugOrPath}.`,
|
|
61
|
+
suggestions: searchDocs(input.slugOrPath, 5),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return jsonResult({
|
|
65
|
+
ok: true,
|
|
66
|
+
page,
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
getProp(input) {
|
|
70
|
+
const prop = getProp(input.path);
|
|
71
|
+
if (!prop) {
|
|
72
|
+
return jsonResult({
|
|
73
|
+
ok: false,
|
|
74
|
+
message: `No Ace Grid prop found at ${input.path}.`,
|
|
75
|
+
suggestions: searchCatalog(input.path, 5),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return jsonResult({
|
|
79
|
+
ok: true,
|
|
80
|
+
prop,
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
validateConfig(input) {
|
|
84
|
+
return jsonResult(validateGridConfig(input.config));
|
|
85
|
+
},
|
|
86
|
+
planImplementation(input) {
|
|
87
|
+
return jsonResult(planImplementation(input));
|
|
88
|
+
},
|
|
89
|
+
generateImplementation(input) {
|
|
90
|
+
return jsonResult(generateImplementation(input));
|
|
91
|
+
},
|
|
92
|
+
generateReactExample(input) {
|
|
93
|
+
return textResult(generateReactExample(input));
|
|
94
|
+
},
|
|
95
|
+
listExamples() {
|
|
96
|
+
return jsonResult({
|
|
97
|
+
examples: listFrameworkExamples(),
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
generateFrameworkExample(input) {
|
|
101
|
+
const example = getFrameworkExample(input.framework);
|
|
102
|
+
if (!example) {
|
|
103
|
+
return jsonResult({
|
|
104
|
+
ok: false,
|
|
105
|
+
message: `No Ace Grid example found for framework ${input.framework}.`,
|
|
106
|
+
availableFrameworks: listFrameworkExamples().map((entry) => entry.framework),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return textResult(input.includeActions ? example.actionsSample : example.codeSample);
|
|
110
|
+
},
|
|
111
|
+
licenseSetup() {
|
|
112
|
+
return jsonResult(licenseSetupGuide());
|
|
113
|
+
},
|
|
114
|
+
async accountStatus(input = {}) {
|
|
115
|
+
const client = new PortalClient({ token: input.token });
|
|
116
|
+
const [me, entitlements, subscriptions] = await Promise.all([
|
|
117
|
+
client.request("/portal/me"),
|
|
118
|
+
client.request("/portal/entitlements"),
|
|
119
|
+
client.request("/portal/subscriptions"),
|
|
120
|
+
]);
|
|
121
|
+
return jsonResult({
|
|
122
|
+
me,
|
|
123
|
+
entitlements,
|
|
124
|
+
subscriptions,
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
async listApps(input = {}) {
|
|
128
|
+
const client = new PortalClient({ token: input.token });
|
|
129
|
+
return jsonResult(await client.request("/portal/apps"));
|
|
130
|
+
},
|
|
131
|
+
async createApp(input) {
|
|
132
|
+
const client = new PortalClient({ token: input.token });
|
|
133
|
+
return jsonResult(await client.request("/portal/apps", {
|
|
134
|
+
body: {
|
|
135
|
+
allowedDomains: input.allowedDomains ?? [],
|
|
136
|
+
name: input.name,
|
|
137
|
+
},
|
|
138
|
+
method: "POST",
|
|
139
|
+
}));
|
|
140
|
+
},
|
|
141
|
+
async listLicenseKeys(input) {
|
|
142
|
+
const client = new PortalClient({ token: input.token });
|
|
143
|
+
return jsonResult(await client.request(`/portal/apps/${encodeURIComponent(input.appId)}/keys`));
|
|
144
|
+
},
|
|
145
|
+
async createLicenseKey(input) {
|
|
146
|
+
const client = new PortalClient({ token: input.token });
|
|
147
|
+
return jsonResult(await client.request(`/portal/apps/${encodeURIComponent(input.appId)}/keys`, {
|
|
148
|
+
body: {
|
|
149
|
+
label: input.label,
|
|
150
|
+
},
|
|
151
|
+
method: "POST",
|
|
152
|
+
}));
|
|
153
|
+
},
|
|
154
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ace-grid/mcp",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "Model Context Protocol server for Ace Grid docs, API metadata, config validation, migration help, and optional account automation.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ace-grid-mcp": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"data",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc -p tsconfig.json",
|
|
17
|
+
"demo": "tsx src/demoServer.ts",
|
|
18
|
+
"dev": "tsx src/index.ts",
|
|
19
|
+
"prepack": "npm run build",
|
|
20
|
+
"sync:docs": "tsx scripts/export-docs-index.ts",
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
"type-check": "tsc -p tsconfig.json --noEmit"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/Vitashev/gridix.git"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"ace-grid",
|
|
30
|
+
"mcp",
|
|
31
|
+
"model-context-protocol",
|
|
32
|
+
"data-grid",
|
|
33
|
+
"react",
|
|
34
|
+
"ai"
|
|
35
|
+
],
|
|
36
|
+
"author": "Ace Grid",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.12.2",
|
|
40
|
+
"zod": "^3.25.76"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"tsx": "^4.19.0",
|
|
45
|
+
"typescript": "^5.0.0",
|
|
46
|
+
"vitest": "^3.2.4"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/Vitashev/gridix/issues"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://ace-grid.com",
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
}
|
|
58
|
+
}
|