@sap-ux/fiori-mcp-server 0.0.1 → 0.0.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/README.md +3 -0
- package/dist/constant.d.ts +1 -0
- package/dist/constant.js +2 -1
- package/dist/tools/functionalities/controller-extension/index.js +2 -1
- package/dist/tools/functionalities/functionalities.js +5 -4
- package/dist/tools/functionalities/generate-fiori-ui-app/command.js +6 -1
- package/dist/tools/functionalities/generate-fiori-ui-app/generate-fiori-ui-app.js +6 -6
- package/dist/tools/get-functionality-details.d.ts +2 -2
- package/dist/tools/output-schema/get-functionality-details.json +29 -5
- package/dist/types.d.ts +10 -6
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -26,6 +26,8 @@ Configure your MCP client to start the server with command `fiori-mcp`. Here is
|
|
|
26
26
|
{
|
|
27
27
|
"mcpServers": {
|
|
28
28
|
"fiori-mcp": {
|
|
29
|
+
"type": "stdio",
|
|
30
|
+
"timeout": 600,
|
|
29
31
|
"command": "npx",
|
|
30
32
|
"args": ["--yes","@sap-ux/fiori-mcp-server@latest", "fiori-mcp"]
|
|
31
33
|
}
|
|
@@ -44,6 +46,7 @@ Then, configure your MCP client to start the server with command `fiori-mcp`. He
|
|
|
44
46
|
"mcpServers": {
|
|
45
47
|
"fiori-mcp": {
|
|
46
48
|
"type": "stdio",
|
|
49
|
+
"timeout": 600,
|
|
47
50
|
"command": "fiori-mcp"
|
|
48
51
|
}
|
|
49
52
|
}
|
package/dist/constant.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export declare const LATEST_UI5_VERSION = "1.136.7";
|
|
|
2
2
|
export declare const GENERATE_FIORI_UI_APP_ID = "generate-fiori-ui-app";
|
|
3
3
|
export declare const ADD_PAGE = "add-page";
|
|
4
4
|
export declare const DELETE_PAGE = "delete-page";
|
|
5
|
+
export declare const CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID = "create-controller-extension";
|
|
5
6
|
//# sourceMappingURL=constant.d.ts.map
|
package/dist/constant.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DELETE_PAGE = exports.ADD_PAGE = exports.GENERATE_FIORI_UI_APP_ID = exports.LATEST_UI5_VERSION = void 0;
|
|
3
|
+
exports.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID = exports.DELETE_PAGE = exports.ADD_PAGE = exports.GENERATE_FIORI_UI_APP_ID = exports.LATEST_UI5_VERSION = void 0;
|
|
4
4
|
exports.LATEST_UI5_VERSION = '1.136.7';
|
|
5
5
|
exports.GENERATE_FIORI_UI_APP_ID = 'generate-fiori-ui-app';
|
|
6
6
|
exports.ADD_PAGE = 'add-page';
|
|
7
7
|
exports.DELETE_PAGE = 'delete-page';
|
|
8
|
+
exports.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID = 'create-controller-extension';
|
|
8
9
|
//# sourceMappingURL=constant.js.map
|
|
@@ -5,6 +5,7 @@ const src_1 = require("@sap/ux-specification/dist/types/src");
|
|
|
5
5
|
const page_editor_api_1 = require("../../../page-editor-api");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const path_1 = require("path");
|
|
8
|
+
const constant_1 = require("../../../constant");
|
|
8
9
|
/**
|
|
9
10
|
* Retrieves the parameter definitions for creating a controller extension.
|
|
10
11
|
*
|
|
@@ -34,7 +35,7 @@ function getParameters() {
|
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
exports.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY = {
|
|
37
|
-
functionalityId:
|
|
38
|
+
functionalityId: constant_1.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID,
|
|
38
39
|
name: 'Add new controller extension by creating javascript or typescript file and updates manifest.json with entry',
|
|
39
40
|
description: 'Add new controller extension by creating javascript or typescript file and updates manifest.json with entry. Controller extensions allow users to extensiate default behaviour with custom controllers code.',
|
|
40
41
|
parameters: Object.values(getParameters())
|
|
@@ -4,6 +4,7 @@ exports.FUNCTIONALITIES_HANDLERS = exports.FUNCTIONALITIES_DETAILS = void 0;
|
|
|
4
4
|
const page_1 = require("./page");
|
|
5
5
|
const controller_extension_1 = require("./controller-extension");
|
|
6
6
|
const generate_fiori_ui_app_1 = require("./generate-fiori-ui-app");
|
|
7
|
+
const constant_1 = require("../../constant");
|
|
7
8
|
exports.FUNCTIONALITIES_DETAILS = [
|
|
8
9
|
page_1.ADD_PAGE_FUNCTIONALITY,
|
|
9
10
|
generate_fiori_ui_app_1.GENERATE_FIORI_UI_APP,
|
|
@@ -11,9 +12,9 @@ exports.FUNCTIONALITIES_DETAILS = [
|
|
|
11
12
|
controller_extension_1.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY
|
|
12
13
|
];
|
|
13
14
|
exports.FUNCTIONALITIES_HANDLERS = new Map([
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
15
|
+
[constant_1.ADD_PAGE, page_1.addPageHandlers],
|
|
16
|
+
[constant_1.DELETE_PAGE, page_1.deletePageHandlers],
|
|
17
|
+
[constant_1.GENERATE_FIORI_UI_APP_ID, generate_fiori_ui_app_1.generateFioriUIAppHandlers],
|
|
18
|
+
[constant_1.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID, controller_extension_1.createControllerExtensionHandlers]
|
|
18
19
|
]);
|
|
19
20
|
//# sourceMappingURL=functionalities.js.map
|
|
@@ -105,6 +105,11 @@ async function command(params) {
|
|
|
105
105
|
if (!projectPath || typeof projectPath !== 'string') {
|
|
106
106
|
throw new Error('Please provide a valid path to the CAP project folder.');
|
|
107
107
|
}
|
|
108
|
+
if (generatorConfig?.service.servicePath) {
|
|
109
|
+
generatorConfig.service.servicePath = generatorConfig?.service.servicePath?.startsWith('/')
|
|
110
|
+
? generatorConfig?.service.servicePath
|
|
111
|
+
: `/${generatorConfig?.service.servicePath}`;
|
|
112
|
+
}
|
|
108
113
|
const appName = generatorConfig?.project.name ?? 'default';
|
|
109
114
|
const appPath = (0, path_1.join)(projectPath, 'app', appName);
|
|
110
115
|
const targetDir = projectPath;
|
|
@@ -120,7 +125,7 @@ async function command(params) {
|
|
|
120
125
|
const content = JSON.stringify(generatorConfig, null, 4);
|
|
121
126
|
await fs_1.promises.mkdir((0, path_1.dirname)(outputPath), { recursive: true });
|
|
122
127
|
await fs_1.promises.writeFile(outputPath, content, { encoding: 'utf8' });
|
|
123
|
-
const command = `npx -y yo@4 @sap/fiori:headless ${configPath} --force
|
|
128
|
+
const command = `npx -y yo@4 @sap/fiori:headless ${configPath} --force`.trim();
|
|
124
129
|
const { stdout, stderr } = await exec(command, { cwd: targetDir });
|
|
125
130
|
console.log(stdout);
|
|
126
131
|
if (stderr) {
|
|
@@ -112,13 +112,13 @@ exports.GENERATE_FIORI_UI_APP = {
|
|
|
112
112
|
id: 'servicePath',
|
|
113
113
|
type: 'string',
|
|
114
114
|
examples: [
|
|
115
|
-
'odata/v4/<servicename>/',
|
|
116
|
-
'odata/v4/MyRiskService/',
|
|
117
|
-
'odata/v2/MyOdataV2Service/',
|
|
118
|
-
'odata/v4/MyOdataV4Service/',
|
|
119
|
-
"odata/v4/<relative '@path' annotation from service cds file>/",
|
|
115
|
+
'/odata/v4/<servicename>/',
|
|
116
|
+
'/odata/v4/MyRiskService/',
|
|
117
|
+
'/odata/v2/MyOdataV2Service/',
|
|
118
|
+
'/odata/v4/MyOdataV4Service/',
|
|
119
|
+
"/odata/v4/<relative '@path' annotation from service cds file>/",
|
|
120
120
|
"<absolute '@path' annotation from service cds file>/",
|
|
121
|
-
'myAbsolutePathFromServiceCdsFile/'
|
|
121
|
+
'/myAbsolutePathFromServiceCdsFile/'
|
|
122
122
|
],
|
|
123
123
|
description: 'The odata endpoint as provided by the cds mcp or as fallback in case that tool is not available from the service cds file.',
|
|
124
124
|
required: true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetFunctionalityDetailsInput, GetFunctionalityDetailsOutput } from '../types';
|
|
1
|
+
import type { FunctionalityId, GetFunctionalityDetailsInput, GetFunctionalityDetailsOutput } from '../types';
|
|
2
2
|
import type { PropertyPath } from '../page-editor-api';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves functionality details based on the provided input parameters.
|
|
@@ -17,7 +17,7 @@ export declare function getFunctionalityDetails(params: GetFunctionalityDetailsI
|
|
|
17
17
|
* @returns An object containing the resolved page name (if applicable) and property path.
|
|
18
18
|
* @throws Error if the functionalityId parameter has an invalid format.
|
|
19
19
|
*/
|
|
20
|
-
export declare function resolveFunctionality(functionalityId:
|
|
20
|
+
export declare function resolveFunctionality(functionalityId: FunctionalityId): {
|
|
21
21
|
pageName?: string;
|
|
22
22
|
propertyPath: PropertyPath;
|
|
23
23
|
};
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"properties": {
|
|
4
4
|
"functionalityId": {
|
|
5
5
|
"anyOf": [
|
|
6
|
+
{
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
6
9
|
{
|
|
7
10
|
"type": "array",
|
|
8
11
|
"items": {
|
|
9
12
|
"type": ["string", "number"]
|
|
10
13
|
}
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "string"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
16
|
"description": "Identifier to pass as the `functionalityId` parameter when calling `get-functionality-details` or `execute-functionality`"
|
|
@@ -61,11 +61,23 @@
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"not": {}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"type": "null"
|
|
64
67
|
}
|
|
65
68
|
]
|
|
66
69
|
}
|
|
67
70
|
},
|
|
68
71
|
"currentValue": {},
|
|
72
|
+
"examples": {
|
|
73
|
+
"type": "array",
|
|
74
|
+
"items": {
|
|
75
|
+
"type": "string"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"pattern": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
69
81
|
"parameters": {
|
|
70
82
|
"type": "array",
|
|
71
83
|
"items": {
|
|
@@ -103,11 +115,23 @@
|
|
|
103
115
|
},
|
|
104
116
|
{
|
|
105
117
|
"not": {}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"type": "null"
|
|
106
121
|
}
|
|
107
122
|
]
|
|
108
123
|
}
|
|
109
124
|
},
|
|
110
|
-
"currentValue": {}
|
|
125
|
+
"currentValue": {},
|
|
126
|
+
"examples": {
|
|
127
|
+
"type": "array",
|
|
128
|
+
"items": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"pattern": {
|
|
133
|
+
"type": "string"
|
|
134
|
+
}
|
|
111
135
|
},
|
|
112
136
|
"required": ["id", "type"],
|
|
113
137
|
"additionalProperties": false
|
|
@@ -137,6 +161,6 @@
|
|
|
137
161
|
"type": "string"
|
|
138
162
|
}
|
|
139
163
|
},
|
|
140
|
-
"required": ["
|
|
164
|
+
"required": ["functionalityId", "name", "description", "parameters"],
|
|
141
165
|
"additionalProperties": false
|
|
142
166
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -39,14 +39,14 @@ export interface GetFunctionalityDetailsInput {
|
|
|
39
39
|
/** Path to the Fiori application */
|
|
40
40
|
appPath: string;
|
|
41
41
|
/** ID or array of IDs of the functionality(ies) */
|
|
42
|
-
functionalityId:
|
|
42
|
+
functionalityId: FunctionalityId;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Output interface for the 'get-functionality-details' functionality
|
|
46
46
|
*/
|
|
47
47
|
export interface GetFunctionalityDetailsOutput {
|
|
48
48
|
/** ID of the functionality */
|
|
49
|
-
functionalityId:
|
|
49
|
+
functionalityId: FunctionalityId;
|
|
50
50
|
/** Name of the functionality */
|
|
51
51
|
name: string;
|
|
52
52
|
/** Description of the functionality */
|
|
@@ -69,7 +69,7 @@ export interface GetFunctionalityDetailsOutput {
|
|
|
69
69
|
*/
|
|
70
70
|
export interface ExecuteFunctionalitiesInput {
|
|
71
71
|
/** ID or array of IDs of the functionality(ies) to execute */
|
|
72
|
-
functionalityId:
|
|
72
|
+
functionalityId: FunctionalityId;
|
|
73
73
|
/** Parameters for the functionality execution */
|
|
74
74
|
parameters: {
|
|
75
75
|
[key: string]: unknown;
|
|
@@ -82,7 +82,7 @@ export interface ExecuteFunctionalitiesInput {
|
|
|
82
82
|
*/
|
|
83
83
|
export interface ExecuteFunctionalityOutput {
|
|
84
84
|
/** ID or array of IDs of the executed functionality(ies) */
|
|
85
|
-
functionalityId:
|
|
85
|
+
functionalityId: FunctionalityId;
|
|
86
86
|
/** Status of the execution */
|
|
87
87
|
status: string;
|
|
88
88
|
/** Message describing the execution result */
|
|
@@ -116,10 +116,14 @@ export interface FioriApp {
|
|
|
116
116
|
*/
|
|
117
117
|
export interface Functionality {
|
|
118
118
|
/** ID or array of IDs for the functionality */
|
|
119
|
-
functionalityId:
|
|
119
|
+
functionalityId: FunctionalityId;
|
|
120
120
|
/** Description of the functionality */
|
|
121
121
|
description: string;
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Type for functionality id
|
|
125
|
+
*/
|
|
126
|
+
export type FunctionalityId = Array<string | number> | string;
|
|
123
127
|
/**
|
|
124
128
|
* Interface representing a parameter
|
|
125
129
|
*/
|
|
@@ -137,7 +141,7 @@ export interface Parameter {
|
|
|
137
141
|
/** Default value of the parameter */
|
|
138
142
|
defaultValue?: unknown;
|
|
139
143
|
/** Possible options for the parameter */
|
|
140
|
-
options?: Array<string | number | boolean | undefined>;
|
|
144
|
+
options?: Array<string | number | boolean | undefined | null>;
|
|
141
145
|
/** Current value of the parameter */
|
|
142
146
|
currentValue?: unknown;
|
|
143
147
|
/** Examples for the parameter */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fiori-mcp-server",
|
|
3
3
|
"description": "SAP Fiori - Model Context Protocol (MCP) server",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"SAP Fiori tools",
|
|
7
7
|
"SAP Fiori elements",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@types/json-schema": "7.0.5",
|
|
32
32
|
"@types/mem-fs": "1.1.2",
|
|
33
33
|
"@sap-ux/i18n": "0.3.3",
|
|
34
|
-
"@sap-ux/
|
|
34
|
+
"@sap-ux/odata-entity-model": "0.3.1",
|
|
35
35
|
"@sap-ux/odata-annotation-core-types": "0.4.5",
|
|
36
|
-
"@sap-ux/
|
|
36
|
+
"@sap-ux/text-document-utils": "0.3.1"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@modelcontextprotocol/sdk": "1.17.4",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"@sap-ux/annotation-converter": "0.10.3",
|
|
42
42
|
"i18next": "25.3.0",
|
|
43
43
|
"zod": "4.1.5",
|
|
44
|
-
"@sap-ux/
|
|
44
|
+
"@sap-ux/fiori-annotation-api": "0.6.17",
|
|
45
45
|
"@sap-ux/nodejs-utils": "0.2.3",
|
|
46
|
-
"@sap-ux/
|
|
46
|
+
"@sap-ux/project-access": "1.30.13"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=20.x"
|