Skip to main content
Glama
kts982

MCP SAP GUI Server

by kts982

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SAP_USERNoSAP username for connection via sap_connect
SAP_CLIENTNoSAP client (e.g., 800) for connection via sap_connect
SAP_LANGUAGENoSAP language code (e.g., EN) for connection via sap_connect
SAP_PASSWORDNoSAP password for connection via sap_connect

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
sap_connectA

Connect to an SAP system by its name in SAP Logon Pad.

Credentials are resolved from a .env file (SAP_USER, SAP_PASSWORD, SAP_CLIENT, SAP_LANGUAGE) so passwords never appear in MCP tool calls. Parameters provided here override the .env values (except password). If SAP is already open and logged in, use sap_connect_existing instead.

sap_connect_existingA

Connect to an already open SAP session. Use this when SAP is already logged in.

This is the most common starting point. connection_index=0 and session_index=0 connect to the first open session. Also attaches to SAP Business Client / embedded SAP GUI sessions. Indexes come from sap_list_connections; a connection with scripting_disabled=true cannot be attached.

sap_list_connectionsA

List all open SAP connections and sessions.

Covers SAP Logon plus SAP Business Client / embedded SAP GUI sessions (host: saplogon | sapguiserver). A connection with no sessions and scripting_disabled: true means the server parameter sapgui/user_scripting is off, so no session can be read.

sap_get_session_infoA

Get information about the current SAP session (system, client, user, transaction, screen).

Also the SAP GUI release (sap_gui_version) and scripting_read_only: when true, the SAP server allows read-only scripting and write tools refuse.

sap_execute_transactionA

Execute (start/run) an SAP transaction code (tcode), e.g. MM03, VA01, SM30.

Navigates to the transaction's initial screen. Always check the screen info in the response to understand what screen you landed on. Some transactions require /n prefix for SCWM (e.g., /n/SCWM/MON). A bare /n leaves the current transaction (unsaved data is lost).

Subject to transaction blocklist/allowlist. Use sap_get_session_info to see the current transaction before navigating away.

sap_send_keyA

Press a keyboard key / function key in the SAP window (sendVKey).

Common keys: Enter (confirm), F1 (Help), F3 (Back), F4 (search help / value help), F5 (Refresh), F8 (Execute), F11 (Save), F12 (Cancel/Escape). Also supports Shift+F1..F9 and Ctrl+F, Ctrl+G, Ctrl+P.

A key that is not active on the screen is not sent: the response has an error and available_keys, the keys this screen accepts.

F11 / Save requires user confirmation via elicitation before proceeding; the response then has confirmed_by_user: true.

sap_get_screen_infoA

Get current SAP screen info: transaction, program, screen number, window title, and status bar message (success/error/warning text).

Reads from session.ActiveWindow so the response always reflects what the user sees. The active_window field tells you which window is in focus (e.g. wnd[0] for the main screen, wnd[1] for a popup). The title comes from the active window.

Every action tool (press_button, send_key, select_menu, etc.) returns this same screen info, so you always know when a popup appears. Use sap_get_popup_window for full popup content (texts, buttons).

Present only when true: message_has_long_text (sap_press_button on 'wnd[0]/sbar' opens it) and message_as_popup (the message also sits in a popup that must be closed first).

Present only when set: subscreens, the sub-screens on the active window as "program:dynnr", outer first (program / screen_number name only the main screen, so an RF step, a tab page or a detail area that changes shows only here), and cursor, the ID of the field the cursor is in. A screen redisplayed without a message, e.g. for an empty required field, still moves the cursor to that field.

sap_read_fieldA

Read the value of a field on the current SAP screen.

Returns value, type, changeable status, and labels (left/right). For a dropdown, value is the selected entry's text and key its key. Use sap_get_screen_elements to discover field IDs on unknown screens.

sap_set_fieldA

Set (type/enter) a value into an input field on the current SAP screen.

Works on GuiTextField and GuiCTextField input fields, and on dropdowns (GuiComboBox, ID prefix cmb): there value picks the entry by its key or its text, and the response reports the key and text selected. For filling in multiple fields of a form at once, use sap_set_batch_fields instead. After setting a field, you may need to press Enter to trigger validation.

sap_press_buttonA

Press (click) a pushbutton or toolbar button on the current SAP screen.

Returns screen info after the press so you can detect navigation or popups. Use sap_get_toolbar_buttons to discover toolbar button IDs. Use sap_get_screen_elements to find on-screen button IDs. When screen info has message_has_long_text, pressing 'wnd[0]/sbar' opens that long text (Diagnosis / Procedure), usually as a list popup: read it with sap_read_list(window_id='wnd[1]').

A popup button is checked like sap_handle_popup's press: a press that may save, or any answer but Cancel to a popup question the tool cannot read, asks the user first (confirmed_by_user: true when accepted).

sap_select_menuA

Select a menu item from the menu bar or a submenu.

Example: 'wnd[0]/mbar/menu[1]/menu[0]'. Use sap_get_screen_elements on 'wnd[0]/mbar' to discover menu structure. Returns screen info after selection so you can detect navigation.

sap_select_checkboxA

Select or deselect a checkbox on the current SAP screen.

Set selected=false to uncheck. Use sap_get_screen_elements with type_filter='GuiCheckBox' to find checkbox IDs.

sap_select_radio_buttonA

Select a radio button on the current SAP screen.

Use sap_get_screen_elements with type_filter='GuiRadioButton' to find radio button IDs on the current screen.

sap_select_combobox_entryA

Select an entry in a combobox/dropdown by its key or display value text.

Accepts either the technical key or the visible display text. Use sap_get_combobox_entries first to see all valid options. F4 opens nothing on a dropdown; sap_set_field selects entries the same way.

sap_select_tabA

Select a tab in a tab strip control.

Returns screen info after selection (tab content changes). Tab IDs typically look like 'wnd[0]/usr/tabsTABSTRIP/tabpTAB01'.

sap_get_combobox_entriesA

List all entries in a combobox/dropdown.

Returns key-value pairs so you know which values are valid.

sap_set_batch_fieldsA

Fill in multiple input fields at once (dict of field_id to value).

Use this to fill a form or selection screen in one call — more efficient than repeated sap_set_field calls. Table-control cells work too: take the cell_id template of each column from sap_read_table(columns_only=true) and replace {row}. A dropdown (cmb) takes an entry's key or text, as in sap_set_field.

The result gives counts; results lists only the fields that did NOT succeed (all of them with verbose=true).

sap_read_texteditA

Read the content of a multiline text editor (GuiTextedit) — long texts, notes, comments, document text.

Returns full text and line count. Use max_lines to cap output for large text editors (0 = all lines).

sap_set_texteditA

Write text into a multiline text editor (GuiTextedit) — long texts, notes, comments, document text.

sap_set_focusA

Set focus to any screen element by its ID.

Some SAP actions require focus on a specific element before they work (e.g., F4 search help on a field). Use this to set focus before sending keys with sap_send_key.

sap_read_tableA

Read rows from a table on the current screen — ALV grid (report/list output) or TableControl (SM30 maintenance view, customizing screens).

Auto-detects the table type. The response includes a 'table_type' field ('GuiGridView' for ALV or 'GuiTableControl') so you know which type-specific tools to use next (e.g., sap_get_alv_toolbar for ALV, sap_scroll_table_control for TableControl).

Use columns_only=true for schema discovery (returns column metadata only, no data). For a TableControl it also gives each column's cell_type and a cell_id template ({row} = zero-based visible row) for sap_set_batch_fields. Use columns to fetch only specific columns (CSV). Use start_row to paginate through large tables. On a TableControl a start_row (0 included) scrolls there first; without one the read starts where the table is scrolled now (e.g. after Position...). first_visible_row says which row is on top.

A TableControl's total_rows counts its empty lines too (SM30 pads the view). When the read reaches the first empty row, the response has empty_rows_from, that row's absolute index: the data ends there.

sap_get_alv_toolbarA

Get all toolbar buttons from an ALV grid.

Returns button IDs, texts, and types. Use this to discover available actions (sort, filter, export, etc.) before pressing them with sap_press_alv_toolbar_button. Only works on GuiGridView (ALV), not GuiTableControl.

sap_press_alv_toolbar_buttonA

Press a toolbar button on an ALV grid (e.g., sort, filter, export).

Use sap_get_alv_toolbar to find button IDs. A menu button (Menu / ButtonAndMenu) opens its menu and the response lists menu_items (text and function_code); pick one with sap_select_alv_context_menu_item.

sap_select_alv_context_menu_itemA

Select an item from an opened ALV context menu.

First use sap_press_alv_toolbar_button on a Menu button to open it, then use this to select an item. Alternatively, pass toolbar_button_id to open the menu and select in one atomic call (recommended).

menu_item_id can be a technical function code (for example @M00006), visible menu text (for example Confirm WT in Foreground), or a position descriptor. You can pass human-readable menu text directly. The menu_items of sap_press_alv_toolbar_button list what a menu offers.

select_by controls how selection is performed:

  • auto (default): heuristic based on whether menu_item_id has spaces

  • id: function code

  • text: visible menu text

  • position: position descriptor

sap_select_table_rowA

Select a row in a table/grid.

Works on both ALV grids and table controls. Row index is zero-based. For ALV: uses absolute row index. For TableControl: scrolls to make the row visible first if needed.

sap_double_click_cellA

Double-click a cell in a table/grid (often opens details or drills down).

Row is zero-based. Column is the column name (from sap_read_table or sap_get_column_info). Works on both ALV and TableControl.

sap_modify_cellA

Modify the value of a cell in an ALV grid or table control.

Only works on editable cells. Use sap_get_cell_info to check if a cell is changeable before attempting to modify it.

sap_set_current_cellA

Set the current (focused) cell in an ALV grid or table control.

Useful before pressing toolbar buttons that act on the current cell.

sap_get_column_infoA

Get detailed column info from an ALV grid or table control.

Returns column names, titles and tooltips; for an ALV grid also each column's data_type (string, date, decimal, ...) and key flag, for a table control each column's cell_type and cell_id template. For a lighter alternative, use sap_read_table with columns_only=true.

sap_get_current_cellB

Get the currently focused cell position in an ALV grid or table control.

sap_scroll_table_controlA

Scroll a GuiTableControl to a specific row position.

Does NOT work on ALV grids (they handle scrolling internally). For reading data at a specific offset, prefer sap_read_table with start_row parameter — it handles scrolling automatically.

position in the response is the row SAP actually put at the top, which can differ from the one asked for (then requested_position and a note say so). Cell IDs ([col,row]) count visible rows from that row.

sap_get_table_control_row_infoA

Get row metadata (selectable, selected) from a GuiTableControl.

If rows is omitted, queries all visible rows. Does NOT work on ALV grids.

sap_select_all_table_control_columnsA

Select or deselect all columns in a GuiTableControl. Does NOT work on ALV grids.

sap_get_cell_infoA

Get detailed cell metadata from an ALV grid.

Returns value, changeable, cell_type (Normal, CheckBox, ValueList, Button, ...), state (Normal, Error, Warning, Info: why a cell was rejected), f4_help, hotspot, color, tooltip, max_length; plus checked for a checkbox and list_box_count (entries) for a dropdown cell. Does NOT work on GuiTableControl.

sap_press_column_headerA

Click a column header in an ALV grid (triggers sort). Does NOT work on GuiTableControl.

sap_select_all_rowsA

Select all rows in an ALV grid. Does NOT work on GuiTableControl.

sap_select_multiple_rowsB

Select multiple rows at once in an ALV grid or table control.

Pass a list of row indices (e.g., [0, 2, 5]).

sap_get_popup_windowA

Check if a popup/modal dialog is open (wnd[1], wnd[2], etc.).

Returns the popup's title, text content, and available buttons so you know how to respond. Also classifies the popup and suggests a safe next action. Returns {popup_exists: false} if no popup.

sap_handle_popupA

Read and optionally act on the current popup/modal dialog.

Use when active_window shows wnd[1] or higher. Combines popup inspection and response in a single call.

Actions:

  • read: return popup content without acting (default)

  • confirm: press OK/Yes/Continue/Enter on the popup

  • cancel: press Cancel (or F12) on the popup; never No, which on a save prompt drops the changes

  • press: press a specific button by its text or tooltip

  • auto: take only a clearly safe action; otherwise return the popup read-only

A press that may save (a Save button, or Yes/OK on a popup about saving, e.g. "Save the changes first?") asks the user first, like F11 in sap_send_key. So does any answer but Cancel when the popup's question cannot be read (question_readable: false; SAP GUI's Edge browser control). On such a popup, confirm never falls back to Enter, and auto only reads. An accepted press reports confirmed_by_user: true.

Returns the popup contents plus classification, requested action, and post-action screen/popup state when something was pressed.

sap_get_toolbar_buttonsA

List all buttons on the system toolbar (tbar[0]) and app toolbar (tbar[1]).

Returns button IDs, text, tooltip, and enabled state. This is for standard SAP toolbars, NOT ALV (use sap_get_alv_toolbar for ALV).

sap_read_shell_contentA

Read content from a GuiShell subtype (e.g., HTMLViewer).

An HTML viewer's page text and URL are readable only with the Internet Explorer browser control; with the Edge control (SAP GUI 7.70+ default, e.g. the F1 Performance Assistant) the response says so in note. Use sap_get_screen_elements first to find shell element IDs.

sap_read_listA

Read a classic ABAP list (WRITE output of a report) as lines of text.

Use it when a report shows a plain list rather than an ALV grid (program SAPMSSY0, screen 120), and for F4 hit lists in a popup (window_id= 'wnd[1]'). Such a list has no table object: every word is its own label, so sap_get_screen_elements leaves the cells out and reports it under 'lists'. This returns the page as the lines the user sees, with no screenshot needed.

  • colors: rows whose text has a semantic list colour, e.g. 'negative' (red, errors), 'positive' (green), 'total', 'heading'

  • scroll: present when the list is longer than the page; pass scroll_to=position+page_size to read the next page

  • with_ids=true adds the ID of each line's first label, to set the focus on a line (sap_set_focus) before F2 / double-click

  • is_list=false means this screen has no list: use sap_read_table

sap_read_treeA

Read data from a tree control (TableTreeControl, ColumnTreeControl, etc.).

Returns node hierarchy with texts and column values. For large trees (e.g., SPRO with 1000+ nodes), use sap_get_tree_node_children for step-by-step navigation instead. Use sap_search_tree_nodes to find specific nodes by text.

sap_expand_tree_nodeA

Expand a folder node in a tree control to reveal its children.

After expanding, use sap_get_tree_node_children or sap_read_tree to see the newly visible child nodes.

sap_collapse_tree_nodeC

Collapse a folder node in a tree control (e.g. SPRO/customizing tree).

sap_select_tree_nodeA

Select a node in a tree control.

Highlights the node without opening it. For SPRO-style trees, use sap_click_tree_link on the execute icon column instead.

sap_double_click_tree_nodeA

Double-click a node in a tree control (often opens details or drills down).

In SPRO/customizing trees, this may open documentation (hypertext) rather than executing the activity. Use sap_click_tree_link on the execute column (typically column '2') for SPRO activities.

sap_double_click_tree_itemA

Double-click a specific item (column cell) in a tree node row.

item_name is the column name (e.g., 'Column1', 'Column2'). Use sap_read_tree to discover column names for the tree.

sap_click_tree_linkA

Click a hyperlink in a tree node item.

For SPRO/customizing trees, click on the execute icon column (typically item_name='2') to run an activity. Use sap_read_tree to see which columns have link-type items.

sap_find_tree_node_by_pathB

Find a tree node key by its path.

E.g., '2\1\2' = 2nd child of root, then 1st child, then 2nd.

sap_search_tree_nodesA

Search for tree nodes by text. Returns matches with full ancestor paths.

Useful for finding nodes in deep trees where the same label appears in multiple branches. Case-insensitive substring match. Optionally pass column to search in a specific column instead of node text.

Important limitation: Only searches nodes that are already loaded (expanded) in the tree. Collapsed subtrees are not searched. If you don't find what you expect, expand parent nodes first using sap_get_tree_node_children with expand=true, then search again.

sap_get_tree_node_childrenA

Get direct children of a tree node. Much faster than read_tree for step-by-step navigation of deep trees (e.g., SPRO).

Omit node_key or pass empty string for root-level nodes. Set expand=true to expand the node first (requires write permission).

sap_get_screen_elementsA

Discover all elements on the current SAP screen.

Useful for finding field IDs when working with a new screen.

Use type_filter and changeable_only to reduce response size on complex screens (e.g. type_filter="GuiTextField,GuiCTextField" to find only input fields).

max_depth controls how deep to recurse into containers (default 2). Use max_depth=1 for a quick overview, max_depth=3+ for deeply nested layouts (splitter containers, tab strips with sub-containers).

Pass container_id='wnd[0]/mbar' to discover the menu bar structure.

A table control (SM30-style) is ONE element here, not one per cell: use sap_read_table(columns_only=true) for its columns and cell_id templates. A classic list (report WRITE output, SE16 standard list, F4 hit list) is left out and reported under 'lists': read it with sap_read_list. expand_tables=true lists every visible cell of both (large).

Docking containers sit BESIDE the user area, not inside it: the dialog-structure tree of a view cluster (SM34, most IMG activities) and the SE80 tree are under 'wnd[0]/shellcont'. When the window has any, the response lists them as docking_containers; discover them with that id, or pass container_id='wnd[0]' (max_depth=1) for all top-level areas.

sap_screenshotA

Take a screenshot of the current SAP window.

Use as a fallback when structured tools (sap_get_screen_elements, sap_read_field, sap_read_table) return empty or confusing results, e.g., on Web Dynpro screens where the element tree is non-standard.

To put a screenshot into a document, pass save_path (must end in .png, directory must exist, existing files are never overwritten). The file keeps SAP GUI's full resolution; the inline image is capped at 1920px. The response then also reports the absolute path and pixel size. Set inline=False to skip the image when only the file is needed.

sap_previewA

Render a preview card of the current SAP screen for the user: screenshot, session/transaction info, status bar, and the values the agent is about to write (pending_fields). Call before significant writes (batch fills, F11 save) or whenever the user asks to see what's about to happen. Read-only: nothing is written or saved.

sap_set_policy_profileA

Switch the active policy profile for this session.

Profiles control which tools are visible:

  • exploration: read-only tools (discover, inspect, screenshot)

  • operator: read + write tools (normal SAP interaction)

  • full: all tools including destructive (transaction execution)

A session can only restrict, never widen: if the server was started with --profile, a request above that floor is capped to the floor. Default profile is 'full' unless the server was started with --profile.

sap_set_confirmation_pointsA

Choose which SAP operations need the user's explicit approval first.

Replaces this session's set of confirmation points. When a point is active, every matching tool call pauses and asks the user to approve it (MCP elicitation) before anything reaches SAP; declining returns an error and nothing is executed.

Points:

  • transactions: sap_execute_transaction

  • batch_fields: sap_set_batch_fields

  • field_writes: sap_set_field, sap_modify_cell, sap_set_textedit, sap_select_checkbox, sap_select_radio_button, sap_select_combobox_entry

  • all_writes: every write-tagged tool. Strict and noisy — many write tools only select, scroll or navigate, and they will all prompt. Under all_writes, sap_send_key("F11") asks twice: once for the category and once for the unchanged save gate.

'save' (F11 / Save key, Save toolbar button) is always on and cannot be turned off. Points set by the server's --confirm flag cannot be removed either. Adding a point is silent; removing one asks the user first, and a declined removal keeps the point.

Confirmation prompts block until the user answers, and on clients without elicitation support the gated call fails instead of running unconfirmed (same fail-closed rule as the save gate). On such a client points also cannot be removed, so activating one there blocks that whole category for the rest of the session. Call sap_preview before a gated action so the user can see the screen and pending values first.

sap_get_workflow_guideA

Return step-by-step guidance for a common SAP workflow.

Available workflows:

  • search_help: F4 search help on a field. target = field ID.

  • table_export: Paginated table export. target = table element ID.

  • spro_navigate: SPRO customizing navigation. target = activity name.

sap_get_transaction_guideA

Return a generic, read-first guide for a supported SAP transaction.

Available transactions:

  • /SCWM/MON: EWM Warehouse Monitor with tree navigation and ALV results.

  • SM30: table/view maintenance and view clusters (SM34) - also what most IMG activities open: reading the table, the docked dialog-structure tree, new entries, saving and the customizing request prompt.

Aliases accepted: SCWM/MON, warehouse monitor, ewm warehouse monitor, SM34, table maintenance, view maintenance, view cluster.

sap_disconnectA

Disconnect from the current SAP session and release the binding.

Sessions opened by this MCP session (via sap_connect) are closed. Sessions that were attached (via sap_connect_existing) are detached but left open so the user can continue working manually.

Prompts

Interactive templates invoked by user choice

NameDescription
sap_search_helpOpen F4 search help on a field, browse results, and select a value. Use this when you need to pick a value from a dropdown or search help dialog (F4) for a specific field.
sap_table_exportRead all rows from a large SAP table with proper pagination. Use this when you need to export or analyze the complete contents of an ALV grid or TableControl.
sap_spro_navigateNavigate the SPRO customizing tree to find and execute an activity. Use this when you need to reach a specific customizing activity in SPRO (e.g., "Define Storage Types", "Maintain Number Ranges").

Resources

Contextual data attached and managed by the client

NameDescription
sap_gui_guideDetailed SAP GUI navigation reference for AI agents. Covers element types, ID patterns, transaction conventions, table type comparison, SPRO navigation, and troubleshooting.

TDQS

A3.7/5.0

Scored across 60 tools

Disambiguation4/5

Most tools target clearly distinct SAP GUI controls or actions (ALV vs TableControl vs tree vs list vs popup), and descriptions explicitly note incompatibilities. However, with 60 tools there remains some overlap, e.g. sap_set_field vs sap_select_combobox_entry for dropdowns, and sap_get_popup_window vs sap_handle_popup, which could cause occasional misselection.

Naming Consistency5/5

All tools use a consistent sap_ prefix and snake_case verb_noun naming. Minor semantic variation between read_* for content and get_* for metadata is predictable, not chaotic.

Tool Count1/5

60 tools is an extreme mismatch for a single MCP server, far beyond the 3-15 well-scoped range. Even though SAP GUI automation is broad, the surface is too large for an agent to navigate efficiently and risks tool-choice overload.

Completeness5/5

The set covers connection management, screen and session inspection, fields, tables/ALV grids, tree controls, lists, popups, text editors, toolbars, guided workflows, policy profiles, screenshots, previews, and gated writes. No obvious CRUD or lifecycle operation for the stated SAP GUI automation domain is missing.

Maintenance

ActivityMaintained
ResponsivenessWithin a week