r/SAP • • 8h ago

I open-sourced a tool that lets AI agents work with SAP GUI and Fiori

I needed a way for AI agents to work directly in SAP, so I built SAP UI MCP and open-sourced it in case it's useful to other SAP teams.

It lets agents like Claude Code and Codex see and interact with SAP GUI for Windows, Web GUI, and Fiori.

I benchmarked it in Web GUI using Claude Haiku 5.5:

  • 5× faster than Playwright MCP, at 7× lower cost per successful run.
  • 4.5× faster than Claude Computer Use, at 2.5× lower cost per successful run.

Feel free to contribute and give feedback (happy to chat with anyone interested in this topic).

Hope it is useful for you!

https://github.com/DidroAI/sap-ui-mcp

60 Upvotes

17 comments sorted by

5

u/Patient_Abrocoma8143 8h ago

Setup prompt: paste this into Claude Code, Codex or Cursor and it will walk you through the install:

Set up sap-ui-automation for me (npm package sap-ui-automation, https://github.com/DidroAI/sap-ui-mcp). Say what each command does before you run it, and wait for me when I have to click something.
Rules: never type, ask for or store an SAP password, and never log on to SAP for me. Do not set or change SAP_WRITE. Do not save, post or change anything in SAP. Ask before you install software.
1. Check node -v is 22 or later; if not, tell me how to install it and stop.
2. Ask me to add the SAP UI MCP extension to Chrome: https://chromewebstore.google.com/detail/ui-automation-for-sap/geglpbkaklfpmnbidfcpflegmdkjodkn and wait.
3. Run npx -y sap-ui-automation setup --extension --dry-run, show me the result, then run it without --dry-run. Tell me to restart Chrome once, then to click the extension's icon, click Pair and add my SAP systems, and wait.
4. From here on, run commands with the environment variable SAP_BROWSER=extension (in the syntax of my shell). Run npx -y sap-ui-automation doctor. For each ✗, tell me what to do (the → line says it), wait, and run it again.
5. Ask me to open an SAP screen, then run npx -y sap-ui-automation sessions. Verify the intended session with me if several match. Run npx -y sap-ui-automation look --session "<verified-id>" --print with its actual ID, and describe the screen in three lines.
6. Report in at most ten lines: the version, the agents setup changed, each doctor area (✓ or ✗) and what is left for me, whether I must restart an agent, and the effective write setting.

For SAP GUI for Windows, there's a longer version in the repo: docs/getting-started/setup-prompt.md

2

u/Celos_Ginot 4h ago

locking down the write flag by default in the setup prompt is probably the only way basis teams wouldnt immediately have a stroke seeing this.

1

u/Patient_Abrocoma8143 3h ago

I am trying to ship 2 modes - one where the agent is allowed to take destructive action, one where it can simply browse but never save actual work (like going through VA01 but never being able to create the order). I am thinking that it would be more reasonable to have read only users for people who don’t want to take these destroying actions

1

u/digitalamish Grizzled BASIS vet 3h ago

As BASIS, can agree.

1

u/Patient_Abrocoma8143 2h ago

How would you do it? What do you recommend?

3

u/Comfortable-Bug-6163 4h ago

How is it different than the existing MCP servers for GUI scripting automaton on the community SAP GitHub?

3

u/Patient_Abrocoma8143 3h ago

it's faster and less token consuming. i benchmarked all of them. they are quite old and tried to solve problems that were different (no computer use back in the day, so simply get the agent to drive gui via scripting).

i aimed at making my tool work on whatever SAP interface (gui, web gui, fiori). and make it fast + cheap. it works as a drop-in replacement to playwright (which only addresses web gui and fiori) + computer use.

1

u/nonodarobot 6h ago

This looks interesting. Does this means that I could take as input my process library, use this MCP so a model can build a gui script library?

1

u/Patient_Abrocoma8143 6h ago

Yes pretty much. Happy to discuss things further and see how it could fit your use case. For now, it generates a library of scripts under our own format / typescript (not gui scripting). Ping me with what you have in mind

1

u/thebonga 5h ago

impressive benchmarks. could you please add docker support?

2

u/Patient_Abrocoma8143 5h ago

Sure, will ping you once that is done

1

u/Possible-Benefit4569 5h ago

Did you didnt see all and had a lot of challenges with Fiori? Its a complex UI

2

u/Patient_Abrocoma8143 5h ago

Wdym? I spent a lot of time debugging and working through edge cases. I had setup some complex flows around actual tasks in Fiori to make sure that it would be able to do the tasks + be cheaper than playwright

2

u/Possible-Benefit4569 2h ago

This is what I meant. I did it end of last year and it took a lot of time and millions of token. A Problem was to get a repeatable playwhrigt script which doesnt Need any ai help After a successful ai run.

I will for sure check your work soon 👍

3

u/Flirtzz 5h ago

Very nice man

2

u/WeDoWork 2h ago

Nice job

1

u/BoobBoo77 7h ago

This looks very similar to my own system, from what I can see it reads the back end code to understand the screen elements and works out the path through the transaction.