-
Notifications
You must be signed in to change notification settings - Fork 66
feat: Add ADP specific tools #4670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nikmace
wants to merge
103
commits into
main
Choose a base branch
from
feat/unified-flex-flow-for-adp-mcp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
103 commits
Select commit
Hold shift + click to select a range
22e1127
feat(fiori-mcp-server): promote static functionalities to top-level M…
devinea b71dbf9
test(fiori-mcp-server): add unit tests for new top-level tools
devinea 2c75540
Linting auto fix commit
github-actions[bot] 0c84470
fix(fiori-mcp-server): address PR review feedback on top-level tool p…
devinea 305ceac
Merge remote-tracking branch 'origin/main' into refactor_fiori_mcp_tools
devinea b49b289
Merge branch 'main' into refactor_fiori_mcp_tools
devinea 099d224
fix(fiori-mcp-server): resolve merge conflicts and fix build/test fai…
devinea 88c0328
chore(fiori-mcp-server): fix Prettier formatting in new test files
devinea 0aca2ba
refactor(fiori-mcp-server): add .js ESM extensions and broader refact…
devinea f9ec385
Merge remote-tracking branch 'origin/main' into refactor_fiori_mcp_tools
devinea fb27f5f
Merge remote-tracking branch 'origin/main' into refactor_fiori_mcp_tools
devinea 3ede6ae
fix(fiori-mcp-server): address PR review and implement #4652
devinea 8ee6455
Merge branch 'main' into refactor_fiori_mcp_tools
devinea 040050c
refactor(fiori-mcp-server): use original functionality names as tool …
devinea 995939a
Fix bundle scripts
IainSAP fe11c9c
Merge remote-tracking branch 'origin/main' into refactor_fiori_mcp_tools
IainSAP 9ac0dc6
Merge branch 'main' into refactor_fiori_mcp_tools
IainSAP 3fb9135
Merge branch 'main' into refactor_fiori_mcp_tools
IainSAP 96e60e9
Remove not needed rename
IainSAP 227e17d
Merge remote-tracking branch 'origin/refactor_fiori_mcp_tools' into r…
IainSAP cced4d5
Merge branch 'main' into refactor_fiori_mcp_tools
IainSAP bb35d05
Merge branch 'main' into refactor_fiori_mcp_tools
devinea a7df677
Merge branch 'main' into refactor_fiori_mcp_tools
devinea 3e6a966
Merge branch 'main' into refactor_fiori_mcp_tools
devinea 7a528f2
fix: address PR review comments
devinea 92c0d31
Merge branch 'main' into refactor_fiori_mcp_tools
devinea 8bcdac5
Merge remote-tracking branch 'origin/main' into refactor_fiori_mcp_tools
devinea a985287
Merge remote-tracking branch 'origin/refactor_fiori_mcp_tools' into r…
devinea cdd6b4a
chore: update changeset to reflect all current changes
devinea ea93875
refactor: move promoted tool implementations out of functionalities/
devinea 7cc7e6e
refactor: remove dead services/indexer-simple.ts and services/filesto…
devinea f63d88d
refactor: remove dead code in fiori-mcp-server
devinea 044ce8a
Linting auto fix commit
github-actions[bot] d1169a1
Merge branch 'main' into refactor_fiori_mcp_tools
IainSAP 4b8eb07
Adds destination support for generation of apps in BAS
IainSAP 9e26a66
feat: centralize template path resolution via getTemplatePath helper …
815are 9afb4c3
test: update list-functionalities tests after removing CAP from FUNCT…
devinea 8eb9c42
Fixes incorrect entity name wrapping causing preview to fail, adds tests
IainSAP 90eb530
Merge branch 'main' into refactor_fiori_mcp_tools
devinea 13f4d75
Adds dest support - todo: filter dests that may require basic auth
IainSAP c8b59c0
Merge remote-tracking branch 'origin/refactor_fiori_mcp_tools' into r…
IainSAP a8c1c5d
Add more dest related tests
IainSAP f60c3c2
Merge branch 'main' into refactor_fiori_mcp_tools
IainSAP b2395bc
Linting auto fix commit
github-actions[bot] 779b921
Merge branch 'main' into refactor_fiori_mcp_tools
IainSAP bc04fa5
Remove noAuth and generic dests to align with SC MCP
IainSAP fe1f6c1
Merge remote-tracking branch 'origin/refactor_fiori_mcp_tools' into r…
IainSAP 5363d39
Merge branch 'main' into refactor_fiori_mcp_tools
IainSAP dc0d3e8
Merge branch 'main' into refactor_fiori_mcp_tools
IainSAP caab304
chore: update changeset to reflect BAS/destination support and entity…
devinea 9b8f238
feat: add adp specific tools
nikmace 8e9dc6a
feat: add skills
nikmace 74b2305
feat: update skills
nikmace caf9e7c
Introduce frontend action calls (#4704)
StefanBlamberg c4d0774
refactor: move frontend actions to tool folder
nikmace c7508c6
feat: format tool description
nikmace f70de04
fix: start playwright browser window max size
nikmace ef4ed31
refactor: improve code
nikmace 01a133a
refactor: change folder and file names
nikmace 107b7f8
refactor: improve code
nikmace 5443811
refactor: improve code
nikmace 4d572ac
refactor: jsdocs
nikmace 3646387
refactor: move switch check
nikmace 083651c
refactor: improve controller extension tool
nikmace 2f04966
feat: install chromium if not installed, change skill name
nikmace ef3b120
feat: update skill
nikmace f6b9cb2
chore: update pnpm-lock.yaml after rebase onto refactor_fiori_mcp_tools
nikmace f099228
chore: update cset
nikmace 03ed6c4
fix: migrate new ADP/RTA tool files to ESM imports and fix test suite
nikmace 60f6f3e
refactor: change text
nikmace 28029cf
fix(fiori-mcp-server): restore working playwright-bridge with newCont…
nikmace 3a2469d
Merge remote-tracking branch 'origin/main' into feat/unified-flex-flo…
nikmace 198f906
Linting auto fix commit
github-actions[bot] 20e4d63
Merge remote-tracking branch 'origin/main' into feat/unified-flex-flo…
nikmace e3eef67
fix(fiori-mcp-server): strip credentials from response, surface spawn…
nikmace 573a8ff
fix(fiori-mcp-server): close BrowserContext after page close to preve…
nikmace 398876b
Linting auto fix commit
github-actions[bot] 69733d6
fix(fiori-mcp-server): rename adp skill to sap-fiori-* prefix, add au…
nikmace b9e553b
fix(fiori-mcp-server): make sap-fiori-adp-controller-extension-flow s…
nikmace 6aaf4d3
fix(fiori-mcp-server): rename adp-project-setup skill to sap-fiori-* …
nikmace 861358e
fix(fiori-mcp-server): fix parser fence matching, warn on unclosed bl…
nikmace ad0f73f
Linting auto fix commit
github-actions[bot] f81daf5
test(fiori-mcp-server): add tests for generate-adaptation-project, op…
nikmace 2157272
Merge branch 'feat/unified-flex-flow-for-adp-mcp' of https://github.c…
nikmace 0be5bae
Linting auto fix commit
github-actions[bot] 9561342
fix(fiori-mcp-server): use platform-agnostic path check in generate-a…
nikmace 1c78410
Merge branch 'feat/unified-flex-flow-for-adp-mcp' of https://github.c…
nikmace f59fd6d
test(fiori-mcp-server): improve coverage for server, run-rta-workflow…
nikmace 1f7f2c0
fix(fiori-mcp-server): reduce parser cognitive complexity and use Reg…
nikmace 93d0c14
Linting auto fix commit
github-actions[bot] 1bf241f
Merge branch 'feat/unified-flex-flow-for-adp-mcp' of https://github.c…
nikmace 2862f56
fix(fiori-mcp-server): use replaceAll instead of replace with global …
nikmace 21f8169
fix(fiori-mcp-server): reduce getPortFromPid cognitive complexity by …
nikmace 4008336
fix(fiori-mcp-server): use Number.parseInt and Number.isNaN instead o…
nikmace 7cef784
fix(fiori-mcp-server): reduce openAdaptationEditor cognitive complexi…
nikmace 00b1397
fix(fiori-mcp-server): move constants and interface to top of open-ad…
nikmace 57b3b08
Linting auto fix commit
github-actions[bot] 7ad24b1
test(fiori-mcp-server): add missing coverage for server CallTool hand…
nikmace 782c682
Merge branch 'feat/unified-flex-flow-for-adp-mcp' of https://github.c…
nikmace 93be6c6
test(fiori-mcp-server): improve coverage for optional fields, null va…
nikmace 0e0a7ee
test(fiori-mcp-server): add port-detection tests by mocking execAsync…
nikmace efafe89
test(fiori-mcp-server): extend coverage for port detection, optional …
nikmace f1e6cae
Linting auto fix commit
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@sap-ux/fiori-mcp-server": minor | ||
| --- | ||
|
|
||
| FEAT: add ADP top-level tools (generate_adaptation_project, open_adaptation_editor, adp_controller_extension) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
389 changes: 389 additions & 0 deletions
389
packages/fiori-mcp-server/skills/sap-fiori-adp-controller-extension-flow/SKILL.md
Large diffs are not rendered by default.
Oops, something went wrong.
114 changes: 114 additions & 0 deletions
114
packages/fiori-mcp-server/skills/sap-fiori-adp-project-setup/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| --- | ||
| name: sap-fiori-adp-project-setup | ||
| author: sap-fiori-tools | ||
| version: 0.0.1 | ||
| description: Use when creating a new SAP Fiori adaptation project, setting up an adaptation editor, or adapting an existing Fiori app on an SAP system | ||
| --- | ||
|
|
||
| # ADP Project Setup | ||
|
|
||
| End-to-end workflow for creating a SAP Fiori adaptation project and launching the adaptation editor. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - fiori-mcp server connected (provides `mcp__fiori-mcp__*` tools) | ||
| - User knows which SAP system and application to adapt (or will be guided) | ||
|
|
||
| ### Installing fiori-mcp | ||
|
|
||
| This skill requires the `@sap-ux/fiori-mcp-server` MCP server. It is part of the [SAP UX Tools](https://github.com/SAP/open-ux-tools) open-source project. | ||
|
|
||
| **Install via npm:** | ||
|
|
||
| ```bash | ||
| npm install -g @sap-ux/fiori-mcp-server | ||
| ``` | ||
|
|
||
| **Configure in your MCP client** (e.g. Claude Desktop `claude_desktop_config.json`, or VS Code `settings.json`): | ||
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "fiori-mcp": { | ||
| "command": "npx", | ||
| "args": ["-y", "@sap-ux/fiori-mcp-server"] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| After adding the server, restart your MCP client. The `mcp__fiori-mcp__*` tools should appear in the available tools list. | ||
|
|
||
| ## Workflow | ||
|
|
||
| ### Step 1: Discover Available Systems | ||
|
|
||
| Call `mcp__fiori-mcp__list_sap_systems` to retrieve the list of configured SAP systems. | ||
|
|
||
| Present the systems to the user. If no systems are found, inform the user they need to configure a system first (via SAP Fiori tools system store or BAS destinations). | ||
|
|
||
| ### Step 2: Gather Parameters | ||
|
|
||
| Ask the user for: | ||
| 1. **System** — which SAP system to use (from the list) | ||
| 2. **Application** — the application ID to adapt (e.g., `sap.ui.demoapps.rta.fe`) | ||
| 3. **Target folder** — where to create the project (default: current working directory) | ||
| 4. **Project name** — optional, defaults to `app.variant` | ||
|
|
||
| If the user does not know the application ID, suggest they check the Fiori Apps Library or their system's app index. | ||
|
|
||
| ### Step 3: Generate the Adaptation Project | ||
|
|
||
| Call `mcp__fiori-mcp__generate_adaptation_project` with: | ||
| - `system`: selected system name | ||
| - `application`: the application ID | ||
| - `appPath`: current working directory or user-specified path | ||
| - `targetFolder`: where to generate (absolute path) | ||
| - `projectName`: user's choice or default | ||
|
|
||
| Optional parameters if user provides them: `namespace`, `applicationTitle`, `client`, `username`, `password`. | ||
|
|
||
| Wait for completion. Report success or failure. | ||
|
|
||
| ### Step 4: Patch ui5.yaml for Local Proxy (DEMO ONLY) | ||
|
|
||
| **Only if the user explicitly requests demo/local mode or mentions localhost proxy.** | ||
|
|
||
| Read the generated `ui5.yaml` in the project root. In the `fiori-tools-proxy` middleware config, change: | ||
| - `url` → `http://localhost:8080` | ||
| - `version` → leave empty (remove the value) | ||
| - Keep `path` as-is | ||
|
|
||
| ### Step 5: Launch the Adaptation Editor | ||
|
|
||
| Call `mcp__fiori-mcp__open_adaptation_editor` with: | ||
| - `appPath`: absolute path to the generated adaptation project root (where `package.json` resides) | ||
|
|
||
| The tool returns: | ||
| - `editorUrl` — full URL to open the adaptation editor | ||
| - `processId` — background server PID | ||
| - `port` — server port | ||
|
|
||
| ### Step 6: Report Success | ||
|
|
||
| Present to the user: | ||
| - Project location (absolute path) | ||
| - Editor URL | ||
| - Server PID and port (for cleanup) | ||
| - Next step: "Use the `sap-fiori-adp-controller-extension-flow` skill to make RTA changes, or open the URL in your browser." | ||
|
|
||
| ## Error Handling | ||
|
|
||
| - **No systems found:** User must configure systems first | ||
| - **Generation fails:** Check credentials, application ID validity, system connectivity | ||
| - **Editor launch fails:** Verify project path is correct and `package.json` exists | ||
| - **ui5.yaml not found:** Skip patch, warn user | ||
|
|
||
| ## Cleanup | ||
|
|
||
| The editor server runs in background. To stop it later: | ||
| ```bash | ||
| kill <processId> | ||
| # or by port: | ||
| lsof -ti:<port> | xargs kill | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/fiori-mcp-server/src/tools/adp-controller-extension/ai-response/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export { extractFilesFromResponse, isChangeFile } from './parser.js'; | ||
| export { processAiResponse } from './processor.js'; | ||
| export { PathTraversalError, resolveWithinAppPath, writeExtractedFile } from './writer.js'; |
79 changes: 79 additions & 0 deletions
79
packages/fiori-mcp-server/src/tools/adp-controller-extension/ai-response/parser.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import type { ExtractedFile } from '../types.js'; | ||
| import { logger } from '../../../utils/logger.js'; | ||
|
|
||
| const PATH_MARKER = /\*\*Path:\*\*\s*(.+)/; | ||
| const FENCE_OPEN = /^```(\w+)?/; | ||
| const FENCE_CLOSE = /^```\s*$/; | ||
|
|
||
| function processOutsideBlock( | ||
| line: string, | ||
| state: { inCodeBlock: boolean; currentPath: string; currentCode: string } | ||
| ): void { | ||
| const pathMatch = PATH_MARKER.exec(line); | ||
| if (pathMatch) { | ||
| state.currentPath = pathMatch[1].trim(); | ||
| return; | ||
| } | ||
| if (FENCE_OPEN.test(line)) { | ||
| state.inCodeBlock = true; | ||
| state.currentCode = ''; | ||
| } | ||
| } | ||
|
|
||
| function processInsideBlock( | ||
| line: string, | ||
| state: { inCodeBlock: boolean; currentPath: string; currentCode: string }, | ||
| codeBlocks: ExtractedFile[] | ||
| ): void { | ||
| if (FENCE_CLOSE.test(line)) { | ||
| state.inCodeBlock = false; | ||
| if (state.currentPath && state.currentCode.trim()) { | ||
| codeBlocks.push({ path: state.currentPath, code: state.currentCode.trim() }); | ||
| } | ||
| state.currentPath = ''; | ||
| state.currentCode = ''; | ||
| return; | ||
| } | ||
| state.currentCode += line + '\n'; | ||
| } | ||
|
|
||
| /** | ||
| * Parses an AI response containing markdown code blocks preceded by | ||
| * `**Path:** <fullFilePath>` markers and returns the extracted files. Lines | ||
| * outside fenced blocks are ignored. A code block without a preceding path | ||
| * marker is dropped. | ||
| * | ||
| * @param content Raw AI response text. | ||
| * @returns Files declared in the response. | ||
| */ | ||
| export function extractFilesFromResponse(content: string): ExtractedFile[] { | ||
| const codeBlocks: ExtractedFile[] = []; | ||
| const state = { inCodeBlock: false, currentPath: '', currentCode: '' }; | ||
|
|
||
| for (const line of content.split('\n')) { | ||
| if (!state.inCodeBlock) { | ||
| processOutsideBlock(line, state); | ||
| } else { | ||
| processInsideBlock(line, state, codeBlocks); | ||
| } | ||
| } | ||
|
|
||
| if (state.inCodeBlock) { | ||
| logger.warn( | ||
| `AI response ended with an unclosed code block — content discarded for path: "${state.currentPath || '(no path)'}"` | ||
| ); | ||
| } | ||
|
|
||
| return codeBlocks; | ||
| } | ||
|
|
||
| /** | ||
| * Returns `true` for `.change` files. The AI may emit those alongside code | ||
| * files but they are persisted by a separate flow, so the writer skips them. | ||
| * | ||
| * @param filePath Candidate file path or filename. | ||
| * @returns Whether the path looks like a flexibility change file. | ||
| */ | ||
| export function isChangeFile(filePath: string): boolean { | ||
| return filePath.toLowerCase().endsWith('.change'); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.