Skip to content

Configuration ​

Every setting is an environment variable of the server process. Set it in your MCP client's env block, or in the shell before a CLI command:

sh
claude mcp add sap-ui-automation --scope user -e SAP_WRITE=off -- npx -y sap-ui-automation
SAP_ALLOW_SYSTEMS=ABA/800 npx -y sap-ui-automation sessions

A value the server cannot read (SAP_WRITE=yes, an unknown surface, an origin that is not http or https) is an error with a message that names the variable. SAP_WRITE, SAP_ALLOW_LOGOFF, SAP_SURFACES, SAP_VIEW and SAP_RECORD are read when the server starts: a wrong value there stops it.

Lists are separated by commas or spaces and are not case-sensitive.

Safety ​

VariableDefaultValuesEffect
SAP_WRITEonon, offwhat happens to actions that may write to SAP: run (on, also when empty; your MCP client's tool approval is the only question before them) or refused (off: read-only). confirm was removed and now means off: write refusals and the server's first answer say so. See Safety model
SAP_ALLOW_SYSTEMSallABA/800,S4Honly these systems, optionally with a client, are visible and usable. Checked on every tool call: a session that moves to another system is refused from then on
SAP_ALLOW_TCODESallVA03,MM03the only transactions the agent may open or work in. On Fiori, app intents (SalesOrder-display). A #Shell-startGUI?sap-ui2-tcode=VA03 address is checked by its app and by the transaction it starts, so list both: Shell-startGUI,VA03
SAP_BLOCK_TCODESnoneSE38,SM30transactions the agent may not open or work in, also as the sap-ui2-tcode of a Fiori Shell-startGUI address. While either list is set, such an address that does not decode is refused
SAP_ALLOW_ORIGINSallhttps://myhost:44300only browser tabs of these origins are looked at
SAP_ALLOW_LOGOFFoffoff, onon: the agent may end sessions or the logon (/nex, /nend, /i, Log Off, Yes on the Log Off popup). Off also with SAP_WRITE=on

Where the server looks ​

VariableDefaultValuesEffect
SAP_SURFACESsapgui,webgui,fiori on Windows, webgui,fiori elsewhereany of sapgui, webgui, fioriwhich kinds of session to look for, in any case
SAP_GUI_METHODautoauto, scripting, diaghow SAP GUI for Windows is read. auto: both SAP GUI scripting and the network reader (experimental) run, and the agent works in whichever session it needs; on a Remote Desktop, Citrix or SSH session the network reader runs only with SAP_DIAG_PORT set. scripting or diag: only that one, for setups where nobody watches the agent. Any other value is an error at start. See Network reader
SAP_CHROME_CDPnonehttp://127.0.0.1:9333a Chrome DevTools endpoint (http, https, ws or wss). When set, it wins over SAP_BROWSER and nothing else is tried. An http or ws endpoint named by a host name (http://host.docker.internal:9333) is looked up and asked at its address, since Chrome answers only to an IP address or localhost. See Chrome
SAP_BROWSERlaunchlaunch, attach, extensionlaunch: the server starts Google Chrome with a profile of its own (the SAP window) and looks only at its tabs. attach: your running Chrome or Edge, with remote debugging allowed in chrome://inspect. extension: your everyday Chrome through the SAP UI MCP extension. SAP_CHROME_CDP wins over it. See Choose a browser mode
SAP_CHROME_PATHfound: Google Chrome in the usual places (on Linux also Chromium)a program filelaunch: the Chrome to start
SAP_START_URLthe last SAP address the window showed, else an empty taban http or https addresslaunch: the address a new SAP window opens on
SAP_CHROME_PROFILEsap-ui-automation/chrome in the user's data foldera folderlaunch: the SAP window's profile folder
SAP_CHROME_ARGSnoneChrome switches, separated by spaceslaunch: extra switches for the Chrome it starts
SAP_CHROME_HEADLESSoff (on in the Docker image)on, offlaunch: start the SAP window headless, at 1440×900, for a machine or container with no screen. You then log on through SAP_CHROME_INSPECT. See Docker
SAP_CHROME_INSPECTnonea port (9222), or an IP address and a port (0.0.0.0:9222)launch: while the MCP server, the CLI daemon or browser --wait runs, the SAP window's DevTools on this address, for chrome://inspect in your own Chrome: how you log on in a headless window. The address is 127.0.0.1 unless named. Another one is refused outside a container, and in a container without a network of its own (--network host). Anything that reaches the port published on your machine's 127.0.0.1 controls the SAP window; on Docker Desktop that includes other containers. See Docker
SAP_EXTENSION_PORTfirst free of 47823–47830a portwith SAP_BROWSER=extension, the local port where the extension connects
SAP_EXTENSION_WAIT35secondswith SAP_BROWSER=extension, how long to wait for the extension to connect
SAP_EXTENSION_START_CHROMEon on macOS and Windows, off elsewhereon, offwith SAP_BROWSER=extension, start your Chrome when it is not running, so the extension can connect

Network reader ​

These apply when the network reader runs: with SAP_GUI_METHOD unset (auto) or diag, on Windows. On a machine several people log on to, give each user their own SAP_DIAG_PORT.

VariableDefaultValuesEffect
SAP_DIAG_PORT3298a portwhere the local SAProuter listens, on 127.0.0.1. Put /H/127.0.0.1/S/<port> at the start of the connection's SAProuter string in SAP Logon
SAP_DIAG_IDLE30minutes, 0how long the shared DIAG router waits with no SAP GUI connection and no reader before it exits. It never exits while a connection goes through it. 0: it never exits by itself
SAP_DIAG_ROUTERsharedshared, processshared: one router per user and port, a background process that outlives the servers that read through it (sap-ui-automation diag-router status|start|stop). process: the router runs inside the server, and its logons end with the server
SAP_DIAG_CELLfrom the trafficcw,ch[,x0,y0]the pixel size of SAP GUI's character cell, and the offset of the first one in the screen area. Set it when clicks miss on a theme or a display scaling. cw at least 3, ch at least 6
SAP_DIAG_REQUEST_MS3000millisecondshow long to wait for SAP GUI to send a request after a key or a click, before the answer says the input may have missed
SAP_DIAG_QUIET_MS60millisecondshow long the traffic must be quiet after SAP's answer before an action ends
SAP_DIAG_COMBOarrowstype, arrows+<n>how combo picks a dropdown entry. By default it goes to the entry's place in SAP GUI's cached list with the arrow keys (typing the text missed where entries share a first letter), and types the text when the list is not cached. type: always type the text. arrows+1 (a digit 0 to 9): count that many more lines above the cached entries, when the arrows land off by that many
SAP_DIAG_CAPTUREoffa folderkeeps a copy of the raw traffic, to debug the decoder. It holds everything SAP GUI sent and received, your logon included. The file is created readable by its owner only, where the system allows it. Keep it local and delete it after use

Answers and waits ​

VariableDefaultValuesEffect
SAP_VIEWdiffdiff, fullfull: every action answers with the whole screen. diff: only what changed, when the screen is the same and the changes are shorter
SAP_FIORI_WAITfull waitsbusyfaster Fiori waits: busy indicators only, without UI5's RecordReplay
SAP_CODEwhile recordingon, off (also true, 1, false, 0)the code: line in sap_act answers: the SDK call that repeats the action. Unset, it is there only while a recording is on. on: always. off: never, also while recording
SAP_STRUCTUREDoffon (also true, 1)answers that code reads (sap_sessions, sap_act, sap_replay, sap_record, sap_workflow_run) also carry structuredContent, and these tools declare output schemas. The text is the same. See MCP tools
SAP_TIMINGSoffon, true, 1every sap_act answer adds a line that says where the time went. One action can ask with "timing": true

Recording and files ​

VariableDefaultValuesEffect
SAP_RECORD_DIR./sap-tests (in the server's working directory)a folderwhere sap_record writes recordings and exports, and sap_workflow_save writes tests
SAP_RECORDoffoff, onon: record every session from its first action, without sap_record start
SAP_DOWNLOAD_DIRdownloads in SAP_RECORD_DIR when that is set, else ./sap-downloadsa folderWeb GUI: where a file SAP writes "to a local file" (List > Export > Local File) is copied. Web GUI keeps such a file inside the browser; the action's answer names the copy
SAP_CODE_TOOLSoffonenables sap_library, sap_workflow_save and sap_workflow_run: the agent can save a *.sap.ts test in SAP_RECORD_DIR and run it on this machine. Only on turns them on. Read Reusable workflows first

Recordings hold the values that were typed: treat them like the system's data.

Agent CLI ​

VariableDefaultEffect
SAP_CLI_DIR.sap-gui/screenswhere the agent CLI writes answers and screens
SAP_CLI_IDLE30minutes without a command before the daemon exits
SAP_CLI_SESSIONone daemon per directorya name: one daemon for every directory that sets it

See CLI for coding agents.

Read by exported tests, not by the server ​

The Playwright specs that export --to playwright writes read these when they run. The server itself never reads a password.

VariableEffect
SAP_WEBGUI_URLthe Web GUI address the spec logs on to
SAP_FIORI_URLthe launchpad address, for a Fiori recording
SAP_USER, SAP_PASSWORDthe user and password the spec logs on with
SAP_VAR_<NAME>the value of the test's variable <name> (upper case)

Other variables the server reads ​

These are standard variables of the operating system or of other tools. You do not normally set them for this server.

VariableUsed for
LOCALAPPDATA (Windows), XDG_CONFIG_HOME, CHROME_CONFIG_HOME (Linux)where Chrome's profile, and so its DevToolsActivePort file, is
SystemRoot, windirthe path to Windows PowerShell (powershell.exe)
APPDATAsetup: where Claude Desktop's config is on Windows
CODEX_HOMEsetup: where Codex's config.toml is (default ~/.codex)

For development only ​

VariableEffect
SAP_TEST_CHROMEthe repository's tests: a Chrome to run browser tests against
SAP_EXTENSION_CODEa fixed pairing code for the extension, for tests and CI; otherwise the code is kept in a file only you can read
SAP_CLI_STATE_DIRwhere the agent CLI keeps its daemon's state, for tests
SAP_TEST_STRIP_TYPESset by sap-ui-automation test itself when it runs again with --experimental-strip-types on a Node older than 22.18; do not set it

sap-ui-automation --help lists the commands and the main settings (CLI commands).

MIT licence. Independent open-source project, not affiliated with, endorsed by or sponsored by SAP SE. SAP and SAP Cloud ALM are trademarks of SAP SE.