Skip to content

feat: Add ADP specific tools#4670

Open
nikmace wants to merge 103 commits into
mainfrom
feat/unified-flex-flow-for-adp-mcp
Open

feat: Add ADP specific tools#4670
nikmace wants to merge 103 commits into
mainfrom
feat/unified-flex-flow-for-adp-mcp

Conversation

@nikmace

@nikmace nikmace commented May 13, 2026

Copy link
Copy Markdown
Contributor

feat(fiori-mcp-server): Add ADP-Specific MCP Tools

New Features

✨ Introduces three new top-level MCP tools for SAP Fiori Adaptation Projects (ADP) in the fiori-mcp-server package:

  • generate_adaptation_project — Scaffolds a new SAP Fiori adaptation project by invoking the @sap-ux/adp Yeoman generator with configurable options (system, application, namespace, title, credentials, etc.).
  • open_adaptation_editor — Spawns the adaptation editor server (npx fiori run /test/adaptation-editor.html) in the background, extracts the editor URL and process ID from its output, and returns instructions on how to stop the process.
  • adp_controller_extension — Processes AI-generated controller extension code and XML fragments for adaptation projects using a progressive disclosure pattern: the first call (without aiResponse) returns detailed generation rules and existing project context; a subsequent call with aiResponse writes the generated files to disk.

Changes

  • constant.ts: Added constants for the three new tool IDs (GENERATE_ADAPTATION_PROJECT_ID, ADP_CONTROLLER_EXTENSION_FUNCTIONALITY_ID, OPEN_ADAPTATION_EDITOR_ID).
  • tools/generate-adaptation-project.ts: New tool that invokes @sap-ux/adp via npx yo with a JSON configuration. Includes a default project name helper to avoid directory collisions.
  • tools/open-adaptation-editor.ts: New tool that spawns the adaptation editor process, monitors stdout for the server URL and editor path, detects the listening port cross-platform (Windows/Mac/Linux), and returns kill commands.
  • tools/adp-controller-extension/index.ts: New tool implementing progressive disclosure — returns a rich knowledge base and project context on first call, then extracts and writes code files from an AI-generated markdown response on subsequent calls. Skips .change files and validates file paths are within the project boundary.
  • tools/adp-controller-extension/utils.ts: Utility functions for parsing AI markdown responses (file extraction), detecting adaptation projects, reading manifest.appdescr_variant, scanning existing project files (webapp/changes), and path helpers.
  • tools/index.ts: Exports the three new tools and registers them in the tools list with full descriptions and inputSchema definitions. Also updates the list_sap_systems description to reference generate_adaptation_project.
  • types/input.ts: Added Zod schemas (GenerateAdaptationProjectInputSchema, OpenAdaptationEditorInputSchema, AdpControllerExtensionInputSchema) and their inferred TypeScript types.
  • types/index.ts: Exports the three new input types.
  • server.ts: Wires the new tools into the MCP server's CallTool handler and updates the unknown-tool error message.
  • package.json / tsconfig.json: Added @sap-ux/adp-tooling as a workspace dependency and TypeScript project reference.
  • test/unit/server.test.ts: Updated tool list assertions and unknown-tool error message snapshots to include the three new tools.
  • pnpm-lock.yaml: Updated lock file with new @sap-ux/adp-tooling dependency and minor transitive dependency version resolutions.
  • .changeset/fiori-mcp-server-adp-tools.md: Changeset entry marking this as a minor release.
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.20.47

  • Output Template: Default Template
  • Correlation ID: b309b5cb-fd08-42c1-bb56-06353159ac6a
  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.opened
  • Summary Prompt: Default Prompt
  • File Content Strategy: Full file content

devinea and others added 3 commits May 8, 2026 14:29
…CP tools

Promotes generate-fiori-ui-application, generate-fiori-ui-application-cap,
fetch-service-metadata to dedicated top-level tools (generate_fiori_app_odata,
generate_fiori_app_cap, download_odata_service_metadata, list_sap_systems),
removing them from the 3-step list/get_details/execute workflow.
Reduces round-trips for generation workflows from 3 calls to 1.
Updates list_functionality description to reflect its focused scope on
app-modification operations only.
Adds tests for list_sap_systems, download_odata_service_metadata,
generate_fiori_app_odata and generate_fiori_app_cap to meet 80% coverage threshold.
@nikmace nikmace self-assigned this May 13, 2026
@nikmace nikmace added the fiori-mcp @sap-ux/fiori-mcp label May 13, 2026
@changeset-bot

changeset-bot Bot commented May 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f1e6cae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sap-ux/fiori-mcp-server Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…romotion

- Remove duplicate DownloadODataServiceMetadataInput type from input.ts (defined once in types/index.ts)
- Add FETCH_SERVICE_METADATA_ID and GENERATE_FIORI_UI_APPLICATION_ID constants to constant.ts
- Use constants instead of string literals in download-odata-service-metadata.ts and generate-fiori-app-odata.ts
- Add generatorConfigOData.parse() and generatorConfigCAP.parse() for early Zod validation in generator tools
- Remove no-op required:[] from list_sap_systems input schema
- Update tests to mock Zod schemas and assert parse is called before execute
@cla-assistant

cla-assistant Bot commented May 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

devinea and others added 2 commits May 21, 2026 19:31
* origin/main: (77 commits)
  chore: apply latest changesets
  feat(create): add flp embedded mode (#4641)
  chore: apply latest changesets
  fix: When we get the service uri from the ui5.yaml > adp > target object we use the context to determine whether to use the destination in the target or the url. (#4667)
  chore: apply latest changesets
  feat(`ui5-application-inquirer`): Adds default name pattern (#4698)
  chore: apply latest changesets
  fix: update guidance for fiori extension development (#4696)
  chore: apply latest changesets
  Feat: add sap-description-column-label ESLint rule (#4542)
  chore: adjust AGENTS.md (#4703)
  chore: apply latest changesets
  feat(project-access): add method `getUsedEntitiesFromManifest` returning used entitySets (V4) by page and views from manifest.json (#4697)
  chore: apply latest changesets
  feat(ui5-test-writer): Generate tests for Actions on the Object Page (#4632)
  chore: apply latest changesets
  fix(deploy-tooling): skip ATO prefix enforcement for on-premise systems (#4687)
  chore: apply latest changesets
  chore: bump used versions in adaptation project for Cloud Foundry (#4685)
  chore: apply latest changesets
  ...
@@ -0,0 +1,362 @@
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General:

  • please prefix skills with sap-fiori-* because they we prefer to have our skills grouped when installed locally or globally (all installed skills will be in a flat list in .agents/skills)
  • please add author (sap-fiori-tools) and version (0.0.1?) to the frontmatter of each skill
  • Please make sure the skill is self-contained. This skill seems to have an installed fiori-mcp as prerequisite but does not mention it (including instructions how to install or where to find instructions how to install). This will cause issues if the skill has been found e.g. on skills.sh and was installed using cli command npx skills add <skill url> w/o having the fiori-mcp installed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 69733d6

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed for this skill. Note that sap-fiori-add-visual-filter, sap-fiori-analytical-chart, and sap-fiori-opa5-test-development have the same gap — they reference fiori-mcp tools without installation instructions.

devinea and others added 18 commits June 5, 2026 13:59
…lures

- Resolve merge conflicts in server.ts, tools/index.ts, types/index.ts, and
  functionalities/functionalities.ts, merging .js ESM extensions from main with
  new tools (listSapSystems, downloadODataServiceMetadata, generateFioriAppOData,
  generateFioriAppCap, DownloadODataServiceMetadataInput) from HEAD
- Add .js extensions to imports in new tool files (download-odata-service-metadata,
  generate-fiori-app-cap, generate-fiori-app-odata, list-sap-systems)
- Remove unused imports from functionalities.ts to fix lint errors
- Update tests to use jest.unstable_mockModule (ESM-compatible) pattern for new
  tool test files (list-sap-systems, download-odata-service-metadata,
  generate-fiori-app-odata, generate-fiori-app-cap)
- Update server.test.ts to add new mock functions for new tools
- Update list-functionalities.test.ts to include generate-fiori-ui-application-cap
  functionality and update snapshot
…oring

Add explicit .js file extensions to all relative imports throughout src/ and
test/ to comply with Node16/NodeNext module resolution requirements. Also
includes additional refactoring changes accumulated on this branch.
* origin/main:
  fix(fiori-mcp-server): download ONNX model at runtime to reduce tgz below npm 100 MB limit (#4782)
  chore: apply latest changesets
* origin/main:
  fix(fiori-mcp-server): switch to onnxruntime-web (WASM) to reduce tgz to ~9 MB (#4784)
  chore: apply latest changesets
  feat(eslint-plugin-fiori-tools): lint flex change files (#4706)
  Converting the ADP int test to ESM (#4764)
  chore(workflows): apply OSPO GitHub hardening controls (OIDC + environments) (#4763)
  chore: apply latest changesets
  fix(fiori-mcp-server): exclude Windows GPU DLLs to reduce tgz below npm publish limit (#4783)
  chore: apply latest changesets
- Add GeneratorConfigOData/GeneratorConfigCAP to ToolArgs union in server.ts
- Update README with new top-level tools and corrected list_functionality description
- Wrap fetch-service-metadata execute handler in try/catch to return structured error responses instead of throwing (fixes #4652)
- Update tests to assert structured error responses instead of rejects.toThrow
…names

Rename promoted tools to match their underlying functionality IDs:
- download_odata_service_metadata → fetch-service-metadata
- generate_fiori_app_odata → generate-fiori-ui-application
- generate_fiori_app_cap → generate-fiori-ui-application-cap
nikmace and others added 21 commits July 21, 2026 21:18
…en-adaptation-editor, and parser fixes

- generate-adaptation-project: validation errors, success path, runCmd failure,
  password stripping, getDefaultProjectName off-by-one cases
- open-adaptation-editor: spawn error, timeout, missing PID, success path
- parser: language-tagged fence inside block, Path marker inside block, unclosed EOF
…-step, knowledge-base, processor

- server.ts: add generate_adaptation_project, open_adaptation_editor,
  adp_controller_extension call-tool tests
- knowledge-base.ts: add test for existingFiles branch (lines 142-147)
- processor.ts: add test for non-PathTraversal write error (lines 55-59)
- run-rta-workflow-step/index.ts: new test suite covering all 7 steps,
  session management, unknown step, and FrontendActionError propagation
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fiori-mcp @sap-ux/fiori-mcp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants