@cplace/mcp-server 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -49
- package/dist/conditional-registration.d.ts.map +1 -1
- package/dist/conditional-registration.js +3 -1
- package/dist/conditional-registration.js.map +1 -1
- package/dist/linter.d.ts +14 -0
- package/dist/linter.d.ts.map +1 -0
- package/dist/linter.js +113 -0
- package/dist/linter.js.map +1 -0
- package/dist/profiles.js +1 -1
- package/dist/profiles.js.map +1 -1
- package/dist/tool-metadata.d.ts.map +1 -1
- package/dist/tool-metadata.js +3 -1
- package/dist/tool-metadata.js.map +1 -1
- package/dist/tools/layout-richstring-widgets.js +3 -3
- package/dist/tools/linting.d.ts +16 -0
- package/dist/tools/linting.d.ts.map +1 -0
- package/dist/tools/linting.js +21 -0
- package/dist/tools/linting.js.map +1 -0
- package/dist/tools/richstring-widgets.js +4 -4
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -18,15 +18,20 @@ claude mcp add --transport http cplace https://mcp.cplace.com --header "cplace-u
|
|
|
18
18
|
#### Claude Desktop
|
|
19
19
|
```json
|
|
20
20
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"cplace": {
|
|
23
|
+
"command": "/npx",
|
|
24
|
+
"args": [
|
|
25
|
+
"--ignore-existing",
|
|
26
|
+
"-y",
|
|
27
|
+
"@cplace/mcp-server@latest"
|
|
28
|
+
],
|
|
29
|
+
"env": {
|
|
30
|
+
"CPLACE_URL": "https://base.cplace.io/",
|
|
31
|
+
"API_TOKEN": "****"
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
}
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
36
|
```
|
|
32
37
|
|
|
@@ -43,31 +48,31 @@ By default, only the core tools are loaded. Add this entry to your Claude Deskto
|
|
|
43
48
|
**Option 1: Separate credentials (traditional)**
|
|
44
49
|
```json
|
|
45
50
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"cplace": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["--ignore-existing", "-y", "@cplace/mcp-server@latest"],
|
|
55
|
+
"env": {
|
|
56
|
+
"CPLACE_URL": "https://your-cplace-instance.com/your-tenant",
|
|
57
|
+
"API_TOKEN": "your-api-token"
|
|
58
|
+
}
|
|
53
59
|
}
|
|
54
|
-
|
|
55
|
-
}
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
62
|
```
|
|
58
63
|
|
|
59
64
|
**Option 2: URL-embedded credentials**
|
|
60
65
|
```json
|
|
61
66
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"cplace": {
|
|
69
|
+
"command": "npx",
|
|
70
|
+
"args": ["--ignore-existing", "-y", "@cplace/mcp-server@latest"],
|
|
71
|
+
"env": {
|
|
72
|
+
"CPLACE_URL": "https://your-api-token@your-cplace-instance.com/your-tenant"
|
|
73
|
+
}
|
|
68
74
|
}
|
|
69
|
-
|
|
70
|
-
}
|
|
75
|
+
}
|
|
71
76
|
}
|
|
72
77
|
```
|
|
73
78
|
|
|
@@ -116,7 +121,7 @@ By default, `npx` installs the latest version of the MCP server. To install a sp
|
|
|
116
121
|
@cplace/mcp-server@0.1.15
|
|
117
122
|
```
|
|
118
123
|
|
|
119
|
-
instead of
|
|
124
|
+
instead of
|
|
120
125
|
|
|
121
126
|
```
|
|
122
127
|
@cplace/mcp-server@latest
|
|
@@ -148,10 +153,10 @@ The following configuration properties must be set for API Token authentication
|
|
|
148
153
|
## Usage
|
|
149
154
|
|
|
150
155
|
1. Obtain an API Token for your cplace system (see [cplace documentation](https://docs.cplace.io/lowcode/low-code-cli/authentication/))
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
* Navigate to your user profile in cplace
|
|
157
|
+
* Click on "Action" -> "View my API Tokens" 
|
|
158
|
+
* Create a new API Token
|
|
159
|
+
* Copy the token value 
|
|
155
160
|
2. Configure your credentials (see Installation section above)
|
|
156
161
|
3. If Claude Desktop is running, close it
|
|
157
162
|
4. Add the MCP server configuration to Claude Desktop
|
|
@@ -204,16 +209,16 @@ If you're using a local MCP server installation, you can downgrade to match the
|
|
|
204
209
|
Example for Claude Desktop:
|
|
205
210
|
```json
|
|
206
211
|
{
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
"mcpServers": {
|
|
213
|
+
"cplace": {
|
|
214
|
+
"command": "npx",
|
|
215
|
+
"args": ["--ignore-existing", "-y", "@cplace/mcp-server@1.0.2"],
|
|
216
|
+
"env": {
|
|
217
|
+
"CPLACE_URL": "https://your-cplace-instance.com/your-tenant",
|
|
218
|
+
"API_TOKEN": "your-api-token"
|
|
219
|
+
}
|
|
214
220
|
}
|
|
215
|
-
|
|
216
|
-
}
|
|
221
|
+
}
|
|
217
222
|
}
|
|
218
223
|
```
|
|
219
224
|
|
|
@@ -243,16 +248,16 @@ The MCP server will automatically upgrade to the latest version on the next rest
|
|
|
243
248
|
Example for Claude Desktop (auto-upgrade to latest):
|
|
244
249
|
```json
|
|
245
250
|
{
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
"mcpServers": {
|
|
252
|
+
"cplace": {
|
|
253
|
+
"command": "npx",
|
|
254
|
+
"args": ["--ignore-existing", "-y", "@cplace/mcp-server@latest"],
|
|
255
|
+
"env": {
|
|
256
|
+
"CPLACE_URL": "https://your-cplace-instance.com/your-tenant",
|
|
257
|
+
"API_TOKEN": "your-api-token"
|
|
258
|
+
}
|
|
253
259
|
}
|
|
254
|
-
|
|
255
|
-
}
|
|
260
|
+
}
|
|
256
261
|
}
|
|
257
262
|
```
|
|
258
263
|
|
|
@@ -260,7 +265,38 @@ Close and reopen Claude Desktop to apply the changes, then run the version check
|
|
|
260
265
|
|
|
261
266
|
## Changing the cplace System
|
|
262
267
|
|
|
263
|
-
|
|
268
|
+
There are two approaches for working with multiple cplace systems:
|
|
269
|
+
|
|
270
|
+
**Option A: Edit and restart**
|
|
271
|
+
Update the `CPLACE_URL` and/or `API_TOKEN` values in the Claude Desktop configuration, then close & reopen Claude Desktop.
|
|
272
|
+
|
|
273
|
+
**Option B: Multiple labeled entries (recommended for frequent switching)**
|
|
274
|
+
Define a separate entry per system under `mcpServers`, each with a distinct key (e.g., `cplace-dev`, `cplace-prod`). Disable unused entries by removing them or commenting them out — Claude Desktop does not support disabling entries without removing them from the config.
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"mcpServers": {
|
|
279
|
+
"cplace-dev": {
|
|
280
|
+
"command": "npx",
|
|
281
|
+
"args": ["--ignore-existing", "-y", "@cplace/mcp-server@latest"],
|
|
282
|
+
"env": {
|
|
283
|
+
"CPLACE_URL": "https://dev.cplace.io/tenant",
|
|
284
|
+
"API_TOKEN": "dev-token"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"cplace-prod": {
|
|
288
|
+
"command": "npx",
|
|
289
|
+
"args": ["--ignore-existing", "-y", "@cplace/mcp-server@latest"],
|
|
290
|
+
"env": {
|
|
291
|
+
"CPLACE_URL": "https://prod.cplace.io/tenant",
|
|
292
|
+
"API_TOKEN": "prod-token"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Keep only the entry for the system you are currently working with active. Remove or comment out the others to avoid loading unused tools into Claude's context.
|
|
264
300
|
|
|
265
301
|
## Profile System
|
|
266
302
|
|
|
@@ -463,6 +499,10 @@ Schedule analysis and cross-schedule dependencies.
|
|
|
463
499
|
|
|
464
500
|
- `cplace_get_schedule_links` - Get schedule dependencies and links between work packages
|
|
465
501
|
|
|
502
|
+
## Troubleshooting
|
|
503
|
+
|
|
504
|
+
For common issues and solutions, see [TROUBLESHOOTING.md](TROUBLESHOOTING.md).
|
|
505
|
+
|
|
466
506
|
## Development
|
|
467
507
|
|
|
468
508
|
For development setup, contribution guidelines, and extending the server, see [DEVELOPMENT.md](DEVELOPMENT.md).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional-registration.d.ts","sourceRoot":"","sources":["../src/conditional-registration.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"conditional-registration.d.ts","sourceRoot":"","sources":["../src/conditional-registration.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAqE3C,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GACxB,IAAI,CAeN"}
|
|
@@ -27,6 +27,7 @@ import { registerBoardWidgetTools } from './tools/board-widget.js';
|
|
|
27
27
|
import { registerUrlResolutionTools } from './tools/url-resolution.js';
|
|
28
28
|
import { registerLayoutTools } from './tools/layout.js';
|
|
29
29
|
import { registerSolutionPackageTools } from './tools/solution-packages.js';
|
|
30
|
+
import { registerLintingTools } from './tools/linting.js';
|
|
30
31
|
const MODULE_REGISTRY = {
|
|
31
32
|
'workspace-core': registerWorkspaceCoreTools,
|
|
32
33
|
'workspace-admin': registerWorkspaceAdminTools,
|
|
@@ -54,7 +55,8 @@ const MODULE_REGISTRY = {
|
|
|
54
55
|
'board-widget': registerBoardWidgetTools,
|
|
55
56
|
'url-resolution': registerUrlResolutionTools,
|
|
56
57
|
'layout': registerLayoutTools,
|
|
57
|
-
'solution-packages': registerSolutionPackageTools
|
|
58
|
+
'solution-packages': registerSolutionPackageTools,
|
|
59
|
+
'linting': registerLintingTools,
|
|
58
60
|
};
|
|
59
61
|
export function registerActiveTools(server, client, activeGroups) {
|
|
60
62
|
const requiredModules = getRequiredModules(activeGroups);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional-registration.js","sourceRoot":"","sources":["../src/conditional-registration.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,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ACN,eAAe,CAAC,KAAK,EAAE,uDAAuD,UAAU,GAAG,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/linter.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface LintMessage {
|
|
2
|
+
line: number;
|
|
3
|
+
column: number;
|
|
4
|
+
severity: 'error' | 'warning';
|
|
5
|
+
message: string;
|
|
6
|
+
ruleId: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface LintResult {
|
|
9
|
+
errors: LintMessage[];
|
|
10
|
+
warnings: LintMessage[];
|
|
11
|
+
summary: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function lintScript(script: string): LintResult;
|
|
14
|
+
//# sourceMappingURL=linter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../src/linter.ts"],"names":[],"mappings":"AA+FA,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACnB;AAgCD,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CASrD"}
|
package/dist/linter.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Linter } from 'eslint';
|
|
2
|
+
const linter = new Linter({ configType: 'flat' });
|
|
3
|
+
const CPLACE_GLOBALS = {
|
|
4
|
+
attributeMappingPage: 'readonly',
|
|
5
|
+
attributeName: 'readonly',
|
|
6
|
+
changeEvent: 'readonly',
|
|
7
|
+
Components: 'readonly',
|
|
8
|
+
context: 'readonly',
|
|
9
|
+
cplace: 'readonly',
|
|
10
|
+
CustomAttributeConditions: 'readonly',
|
|
11
|
+
customAttribute: 'readonly',
|
|
12
|
+
DateTime: 'readonly',
|
|
13
|
+
Days: 'readonly',
|
|
14
|
+
embeddingPage: 'readonly',
|
|
15
|
+
Filters: 'readonly',
|
|
16
|
+
HashSet: 'readonly',
|
|
17
|
+
importValues: 'readonly',
|
|
18
|
+
info: 'readonly',
|
|
19
|
+
interfaceDefinitionPage: 'readonly',
|
|
20
|
+
Iterables: 'readonly',
|
|
21
|
+
jobParameters: 'readonly',
|
|
22
|
+
log: 'readonly',
|
|
23
|
+
messages: 'readonly',
|
|
24
|
+
page: 'readonly',
|
|
25
|
+
pages: 'readonly',
|
|
26
|
+
permissionPropagator: 'readonly',
|
|
27
|
+
report: 'readonly',
|
|
28
|
+
request: 'readonly',
|
|
29
|
+
Search: 'readonly',
|
|
30
|
+
searchResults: 'readonly',
|
|
31
|
+
state: 'readonly',
|
|
32
|
+
wizard: 'readonly',
|
|
33
|
+
writersAssignment: 'readonly',
|
|
34
|
+
additionalData: 'writable',
|
|
35
|
+
selectedActiveLayout: 'writable',
|
|
36
|
+
selectedLayouts: 'writable',
|
|
37
|
+
};
|
|
38
|
+
const CPLACE_RULES = {
|
|
39
|
+
'no-cond-assign': ['error', 'always'],
|
|
40
|
+
'no-const-assign': 'error',
|
|
41
|
+
'no-unsafe-finally': 'off',
|
|
42
|
+
'no-unmodified-loop-condition': 'error',
|
|
43
|
+
'no-unreachable-loop': 'error',
|
|
44
|
+
'no-use-before-define': ['error', { functions: false }],
|
|
45
|
+
'block-scoped-var': 'error',
|
|
46
|
+
'camelcase': ['error', { ignoreGlobals: true }],
|
|
47
|
+
'no-mixed-operators': 'error',
|
|
48
|
+
'no-param-reassign': 'error',
|
|
49
|
+
'no-useless-return': 'error',
|
|
50
|
+
'curly': 'error',
|
|
51
|
+
'no-var': 'error',
|
|
52
|
+
'prefer-const': 'warn',
|
|
53
|
+
'no-duplicate-imports': 'error',
|
|
54
|
+
'no-console': 'warn',
|
|
55
|
+
'no-debugger': 'warn',
|
|
56
|
+
'no-unused-vars': ['error', {
|
|
57
|
+
varsIgnorePattern: '^_',
|
|
58
|
+
argsIgnorePattern: '^_',
|
|
59
|
+
caughtErrorsIgnorePattern: '^_',
|
|
60
|
+
}],
|
|
61
|
+
};
|
|
62
|
+
const CPLACE_CONFIG = [
|
|
63
|
+
{
|
|
64
|
+
languageOptions: {
|
|
65
|
+
ecmaVersion: 'latest',
|
|
66
|
+
sourceType: 'commonjs',
|
|
67
|
+
parserOptions: {
|
|
68
|
+
ecmaFeatures: { globalReturn: true },
|
|
69
|
+
},
|
|
70
|
+
globals: CPLACE_GLOBALS,
|
|
71
|
+
},
|
|
72
|
+
rules: CPLACE_RULES,
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
function toLintMessage(msg) {
|
|
76
|
+
return {
|
|
77
|
+
line: msg.line,
|
|
78
|
+
column: msg.column,
|
|
79
|
+
severity: msg.severity === 2 ? 'error' : 'warning',
|
|
80
|
+
message: msg.message,
|
|
81
|
+
ruleId: msg.ruleId,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function formatSummary(errors, warnings) {
|
|
85
|
+
if (errors.length === 0 && warnings.length === 0) {
|
|
86
|
+
return 'No lint issues found.';
|
|
87
|
+
}
|
|
88
|
+
const lines = [];
|
|
89
|
+
if (errors.length > 0) {
|
|
90
|
+
lines.push(`${errors.length} error(s):`);
|
|
91
|
+
for (const e of errors) {
|
|
92
|
+
lines.push(` Line ${e.line}:${e.column} — ${e.message} (${e.ruleId})`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (warnings.length > 0) {
|
|
96
|
+
lines.push(`${warnings.length} warning(s):`);
|
|
97
|
+
for (const w of warnings) {
|
|
98
|
+
lines.push(` Line ${w.line}:${w.column} — ${w.message} (${w.ruleId})`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return lines.join('\n');
|
|
102
|
+
}
|
|
103
|
+
export function lintScript(script) {
|
|
104
|
+
const messages = linter.verify(script, CPLACE_CONFIG);
|
|
105
|
+
const errors = messages.filter(m => m.severity === 2).map(toLintMessage);
|
|
106
|
+
const warnings = messages.filter(m => m.severity === 1).map(toLintMessage);
|
|
107
|
+
return {
|
|
108
|
+
errors,
|
|
109
|
+
warnings,
|
|
110
|
+
summary: formatSummary(errors, warnings),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=linter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../src/linter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;AAGlD,MAAM,cAAc,GAA4C;IAE5D,oBAAoB,EAAE,UAAU;IAChC,aAAa,EAAE,UAAU;IACzB,WAAW,EAAE,UAAU;IACvB,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,UAAU;IAClB,yBAAyB,EAAE,UAAU;IACrC,eAAe,EAAE,UAAU;IAC3B,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,UAAU;IAChB,aAAa,EAAE,UAAU;IACzB,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,UAAU;IACxB,IAAI,EAAE,UAAU;IAChB,uBAAuB,EAAE,UAAU;IACnC,SAAS,EAAE,UAAU;IACrB,aAAa,EAAE,UAAU;IACzB,GAAG,EAAE,UAAU;IACf,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,oBAAoB,EAAE,UAAU;IAChC,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,UAAU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AAU,CAAC,MAAc;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3E,OAAO;QACH,MAAM;QACN,QAAQ;QACR,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC;KAC3C,CAAC;AACN,CAAC"}
|
package/dist/profiles.js
CHANGED
|
@@ -23,7 +23,7 @@ export const TOOL_GROUPS = {
|
|
|
23
23
|
},
|
|
24
24
|
'low-code': {
|
|
25
25
|
description: "Validators, change listeners, workflow management, script logs, script execution, and job monitoring",
|
|
26
|
-
modules: ['validators', 'change-listeners', 'workflow', 'workflow-scripts', 'script-logs', 'script']
|
|
26
|
+
modules: ['validators', 'change-listeners', 'workflow', 'workflow-scripts', 'script-logs', 'script', 'linting']
|
|
27
27
|
},
|
|
28
28
|
'jobs': {
|
|
29
29
|
description: "Job monitoring",
|
package/dist/profiles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAWrD,MAAM,CAAC,MAAM,WAAW,GAA8B;IACpD,IAAI,EAAE;QACJ,WAAW,EAAE,qGAAqG;QAClH,OAAO,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,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Y,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;QACzC,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAC/B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-metadata.d.ts","sourceRoot":"","sources":["../src/tool-metadata.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-metadata.d.ts","sourceRoot":"","sources":["../src/tool-metadata.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAwBvE,CAAC"}
|
package/dist/tool-metadata.js
CHANGED
|
@@ -20,6 +20,7 @@ import { GET_OPERATIONS_TOOL_DEFINITIONS } from './tools/get-operations.js';
|
|
|
20
20
|
import { JOBS_TOOL_DEFINITIONS } from './tools/jobs.js';
|
|
21
21
|
import { LAYOUT_TOOL_DEFINITIONS } from './tools/layout.js';
|
|
22
22
|
import { SOLUTION_PACKAGE_TOOL_DEFINITIONS } from './tools/solution-packages.js';
|
|
23
|
+
import { LINTING_TOOL_DEFINITIONS } from './tools/linting.js';
|
|
23
24
|
export const MODULE_TOOL_DEFINITIONS = {
|
|
24
25
|
'profile-management': PROFILE_MANAGEMENT_TOOL_DEFINITIONS,
|
|
25
26
|
'workspace-core': WORKSPACE_CORE_TOOL_DEFINITIONS,
|
|
@@ -42,6 +43,7 @@ export const MODULE_TOOL_DEFINITIONS = {
|
|
|
42
43
|
'get-operations': GET_OPERATIONS_TOOL_DEFINITIONS,
|
|
43
44
|
'jobs': JOBS_TOOL_DEFINITIONS,
|
|
44
45
|
'layout': LAYOUT_TOOL_DEFINITIONS,
|
|
45
|
-
'solution-packages': SOLUTION_PACKAGE_TOOL_DEFINITIONS
|
|
46
|
+
'solution-packages': SOLUTION_PACKAGE_TOOL_DEFINITIONS,
|
|
47
|
+
'linting': LINTING_TOOL_DEFINITIONS,
|
|
46
48
|
};
|
|
47
49
|
//# sourceMappingURL=tool-metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-metadata.js","sourceRoot":"","sources":["../src/tool-metadata.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,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AgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAM9D,MAAM,CAAC,MAAM,uBAAuB,GAAwC;IAC1E,oBAAoB,EAAE,mCAAmC;IACzD,gBAAgB,EAAE,+BAA+B;IACjD,iBAAiB,EAAE,gCAAgC;IACnD,OAAO,EAAE,qBAAqB;IAC9B,YAAY,EAAE,0BAA0B;IACxC,YAAY,EAAE,2BAA2B;IACzC,UAAU,EAAE,yBAAyB;IACrC,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,uBAAuB;IACjC,iBAAiB,EAAE,gCAAgC;IACnD,YAAY,EAAE,0BAA0B;IACxC,kBAAkB,EAAE,gCAAgC;IACpD,YAAY,EAAE,2BAA2B;IACzC,SAAS,EAAE,uBAAuB;IAClC,cAAc,EAAE,4BAA4B;IAC5C,oBAAoB,EAAE,kCAAkC;IACxD,iBAAiB,EAAE,gCAAgC;IACnD,UAAU,EAAE,yBAAyB;IACrC,gBAAgB,EAAE,+BAA+B;IACjD,MAAM,EAAE,qBAAqB;IAC7B,QAAQ,EAAE,uBAAuB;IACjC,mBAAmB,EAAE,iCAAiC;IACtD,SAAS,EAAE,wBAAwB;CACpC,CAAC"}
|
|
@@ -128,11 +128,11 @@ Most values are wrapped in single-element arrays:
|
|
|
128
128
|
- String: {"title": ["My Widget"]}
|
|
129
129
|
- Number: {"height": [800]}
|
|
130
130
|
- Boolean: {"showFooter": [true]}
|
|
131
|
-
- Complex JSON: {"config": ["{
|
|
131
|
+
- Complex JSON: {"config": ["{\\"key\\": \\"value\\"}"]}
|
|
132
132
|
|
|
133
133
|
EXCEPTIONS — these types must NOT be array-wrapped:
|
|
134
134
|
- LocalizedString: pass as plain map → {"localizedHeading": {"en": "Title", "de": "Titel"}}
|
|
135
|
-
- Search definitions: pass as plain JSON string → {"search": "{
|
|
135
|
+
- Search definitions: pass as plain JSON string → {"search": "{\\"filters\\":{...}}"}
|
|
136
136
|
|
|
137
137
|
When unsure whether a property accepts an array wrapper, call cplace_get_widget_definition to check the property type.`)
|
|
138
138
|
},
|
|
@@ -155,7 +155,7 @@ Most values are wrapped in single-element arrays:
|
|
|
155
155
|
|
|
156
156
|
EXCEPTIONS — these types must NOT be array-wrapped:
|
|
157
157
|
- LocalizedString: pass as plain map → {"localizedHeading": {"en": "Title", "de": "Titel"}}
|
|
158
|
-
- Search definitions: pass as plain JSON string → {"search": "{
|
|
158
|
+
- Search definitions: pass as plain JSON string → {"search": "{\\"filters\\":{...}}"}
|
|
159
159
|
|
|
160
160
|
When unsure whether a property accepts an array wrapper, call cplace_get_widget_definition to check the property type.`)
|
|
161
161
|
},
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { CplaceApiClient } from '../api.js';
|
|
4
|
+
export declare const LINTING_TOOL_DEFINITIONS: {
|
|
5
|
+
readonly cplace_lint_script: {
|
|
6
|
+
readonly description: "Lint a cplace low-code script (change listener, validator, or workflow script) using the cplace ESLint rules. Returns errors and warnings. Does not modify the script. Use this to check script quality before or after saving.";
|
|
7
|
+
readonly inputSchema: {
|
|
8
|
+
readonly script: z.ZodString;
|
|
9
|
+
};
|
|
10
|
+
readonly annotations: {
|
|
11
|
+
readonly title: "Lint cplace Script";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function registerLintingTools(server: McpServer, _client: CplaceApiClient): void;
|
|
16
|
+
//# sourceMappingURL=linting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linting.d.ts","sourceRoot":"","sources":["../../src/tools/linting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAI5C,eAAO,MAAM,wBAAwB;;;;;;;;;;CAQ3B,CAAC;AAEX,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,QAW/E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { lintScript } from '../linter.js';
|
|
3
|
+
const TOOL_LINT_SCRIPT = 'cplace_lint_script';
|
|
4
|
+
export const LINTING_TOOL_DEFINITIONS = {
|
|
5
|
+
[TOOL_LINT_SCRIPT]: {
|
|
6
|
+
description: "Lint a cplace low-code script (change listener, validator, or workflow script) using the cplace ESLint rules. Returns errors and warnings. Does not modify the script. Use this to check script quality before or after saving.",
|
|
7
|
+
inputSchema: {
|
|
8
|
+
script: z.string().describe("The full JavaScript source code of the cplace script to lint"),
|
|
9
|
+
},
|
|
10
|
+
annotations: { title: "Lint cplace Script" },
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export function registerLintingTools(server, _client) {
|
|
14
|
+
server.registerTool(TOOL_LINT_SCRIPT, LINTING_TOOL_DEFINITIONS[TOOL_LINT_SCRIPT], async ({ script }) => {
|
|
15
|
+
const result = lintScript(script);
|
|
16
|
+
return {
|
|
17
|
+
content: [{ type: "text", text: result.summary }],
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=linting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linting.js","sourceRoot":"","sources":["../../src/tools/linting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAE9C,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,CAAC,gBAAgB,CAAC,EAAE;QAChB,WAAW,EAAE,iOAAiO;QAC9O,WAAW,EAAE;YACT,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8DAA8D,CAAC;SAC9F;QACD,WAAW,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE;KAC/C;CACK,CAAC;AAEX,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,OAAwB;IAC5E,MAAM,CAAC,YAAY,CACf,gBAAgB,EAChB,wBAAwB,CAAC,gBAAgB,CAAC,EAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO;YACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SAC7D,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -31,11 +31,11 @@ Most values are wrapped in single-element arrays:
|
|
|
31
31
|
- String: {"title": ["My Widget"]}
|
|
32
32
|
- Number: {"height": [800]}
|
|
33
33
|
- Boolean: {"showFooter": [true]}
|
|
34
|
-
- Complex JSON: {"config": ["{
|
|
34
|
+
- Complex JSON: {"config": ["{\\"key\\": \\"value\\"}"]}
|
|
35
35
|
|
|
36
36
|
EXCEPTIONS — these types must NOT be array-wrapped:
|
|
37
37
|
- LocalizedString: pass as plain map → {"localizedHeading": {"en": "Title", "de": "Titel"}}
|
|
38
|
-
- Search definitions: pass as plain JSON string → {"search": "{
|
|
38
|
+
- Search definitions: pass as plain JSON string → {"search": "{\\"filters\\":{...}}"}
|
|
39
39
|
|
|
40
40
|
When unsure whether a property accepts an array wrapper, call cplace_get_widget_definition to check the property type.`)
|
|
41
41
|
},
|
|
@@ -55,11 +55,11 @@ Most values are wrapped in single-element arrays:
|
|
|
55
55
|
- String: {"title": ["Updated Widget"]}
|
|
56
56
|
- Number: {"height": [900]}
|
|
57
57
|
- Boolean: {"showFooter": [true]}
|
|
58
|
-
- Complex JSON: {"config": ["{
|
|
58
|
+
- Complex JSON: {"config": ["{\\"key\\": \\"value\\"}"]}
|
|
59
59
|
|
|
60
60
|
EXCEPTIONS — these types must NOT be array-wrapped:
|
|
61
61
|
- LocalizedString: pass as plain map → {"localizedHeading": {"en": "Title", "de": "Titel"}}
|
|
62
|
-
- Search definitions: pass as plain JSON string → {"search": "{
|
|
62
|
+
- Search definitions: pass as plain JSON string → {"search": "{\\"filters\\":{...}}"}
|
|
63
63
|
|
|
64
64
|
When unsure whether a property accepts an array wrapper, call cplace_get_widget_definition to check the property type.`)
|
|
65
65
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cplace/mcp-server",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "MCP server that provides Claude Desktop with tools to interact with cplace APIs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"start:dev": "node dist/index.js --remote",
|
|
16
16
|
"test": "vitest",
|
|
17
17
|
"clean": "rm -rf dist",
|
|
18
|
-
"lint": "eslint src
|
|
18
|
+
"lint": "eslint src/**/*.ts",
|
|
19
19
|
"format": "prettier --write src/**/*.ts",
|
|
20
20
|
"prepare": "npm run clean && npm run build"
|
|
21
21
|
},
|
|
@@ -46,11 +46,13 @@
|
|
|
46
46
|
"node": ">=18.0.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
+
"@eslint/js": "^9.28.0",
|
|
49
50
|
"@modelcontextprotocol/sdk": "^1.17.4",
|
|
50
51
|
"axios": "^1.6.0",
|
|
51
52
|
"cors": "^2.8.5",
|
|
52
53
|
"dot-prop": "^8.0.2",
|
|
53
54
|
"dotenv": "^16.3.0",
|
|
55
|
+
"eslint": "^9.28.0",
|
|
54
56
|
"express": "^5.1.0",
|
|
55
57
|
"semver": "^7.6.0",
|
|
56
58
|
"zod": "^3.25.67"
|
|
@@ -59,12 +61,11 @@
|
|
|
59
61
|
"@types/cors": "^2.8.19",
|
|
60
62
|
"@types/express": "^5.0.3",
|
|
61
63
|
"@types/node": "^20.0.0",
|
|
62
|
-
"@
|
|
63
|
-
"@typescript-eslint/parser": "^6.0.0",
|
|
64
|
-
"eslint": "^8.0.0",
|
|
64
|
+
"@types/semver": "^7.5.0",
|
|
65
65
|
"prettier": "^3.0.0",
|
|
66
66
|
"tsx": "^4.0.0",
|
|
67
67
|
"typescript": "^5.5.0",
|
|
68
|
+
"typescript-eslint": "^8.33.1",
|
|
68
69
|
"vitest": "^1.0.0"
|
|
69
70
|
}
|
|
70
71
|
}
|