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

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
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. Use sap_list_connections to see all sessions.

sap_list_connectionsA

List all open SAP connections and sessions

sap_get_session_infoA

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

sap_execute_transactionA

Execute an SAP transaction code (e.g., MM03, VA01, SE80).

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).

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

sap_send_keyA

Send a keyboard key.

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

F11 / Save requires user confirmation via elicitation before proceeding.

sap_get_screen_infoA

Get current SAP screen info (transaction, program, screen number, title, status).

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).

sap_read_fieldA

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

Returns value, type, changeable status, and labels (left/right). Use sap_get_screen_elements to discover field IDs on unknown screens.

sap_set_fieldA

Set a value in a field on the current SAP screen.

For setting multiple fields 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 a 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.

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.

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

Set multiple field values at once (dict of field_id to value).

More efficient than repeated sap_set_field calls.

Args: fields: Dict mapping field_id -> value. validate: Press Enter after setting fields and return status-bar feedback. Skipped when no fields were actually set. skip_readonly: Silently skip fields whose element reports Changeable == False instead of counting them as failures.

sap_read_texteditA

Read the content of a multiline text editor (GuiTextedit).

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

sap_set_texteditC

Set the content of a multiline text editor (GuiTextedit).

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 data from an ALV grid or table on the current screen.

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). Use columns to fetch only specific columns (CSV). Use start_row to paginate through large tables.

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.

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. SAP GUI does not expose a way to enumerate GuiGridView context menu items.

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, widths, and visibility. Useful for understanding table structure. 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.

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, color, tooltip, style, max_length. 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/No/F12 on the popup

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

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

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).

Extracts HTML, URL, or text depending on the shell type. Use sap_get_screen_elements first to find shell element IDs.

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

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.

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.

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)

Default profile is 'full' unless the server was started with --profile.

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_guideB

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

Available transactions:

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

Aliases accepted: SCWM/MON, warehouse monitor, ewm warehouse monitor.

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.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kts982/mcp-sap-gui'

If you have feedback or need assistance with the MCP directory API, please join our Discord server