MCP SAP GUI Server
About
MCP server that allows simple SAP GUI interaction for LLM models using simulated mouse clicks and keyboard input.
Details
- License
- MIT
Explore
- Launch and end SAP transactions programmatically
- Click, move mouse, and type at exact coordinates
- Scroll the SAP GUI screen up or down
- Capture and save screenshots or return them as image data
- Multiple screenshot return formats: none, file, base64, ImageContent, or data URL
- Integrates with Cline and Roo MCP clients
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP SAP GUI ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
- Python 3.8 or higher
- SAP GUI installed and configured
- Valid SAP credentials (system, client, user, password)
- Node.js (for npx)
1. Test server using mcp inspector (build + debug):
./run.bat full
2. Or use test suite:
The test suite includes live tests that interact with SAP GUI. Make sure you have SAP GUI installed and configured before running tests.
Run tests:
run.bat test server
The test suite includes:
- SapGuiServer tests (test_server.py)
Tool registration
Request handling
Response formatting
Error handling
The MCP SAP GUI Server provides the following tools for SAP automation:
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp sap gui server": {
"mcp-sap-gui": {
"command": "python",
"args": [
"-m",
"sap_gui_server.server"
]
}
}
}
}
McpServers
{
"mcp-sap-gui": {
"command": "python",
"args": [
"-m",
"sap_gui_server.server"
]
}
}
A Model Context Protocol (MCP) server for SAP GUI automation. This server provides tools to automate interactions with SAP GUI, enabling programmatic control of SAP transactions.
Requirements
- Python 3.8 or higher
- SAP GUI installed and configured
- Valid SAP credentials (system, client, user, password)
- Node.js (for npx)
Installation
0. Clone github folder and run the automated Install using setup script:setup.bat
This will guide you through the build process and will integrate this directly in Cline or Roo, if you select so.
1. OR Manual Install using build script..:
build.bat
2. Configure SAP credentials:
- Copy .env.example to .env
- Update the values with your SAP credentials
3. Test server using mcp inspector:
run.bat debug
4. Use the integration script to automatically configure MCP settings:
integrate.bat cline # Configure for Cline
integrate.bat roo # Configure for Roo
The script will:
- Automatically determine the correct settings file path
- Create a backup before making any changes
- Safely update the MCP configuration
- Validate changes to prevent corruption
Manual Configuration (if needed):
"mcp-sap-gui": {
"command": "python",
"args": [
"-m",
"sap_gui_server.server"
],
"cwd": "PATH_TO_YOUR_FOLDER/mcp-sap-gui",
"disabled": false,
"autoApprove": []
}
5. Use this prompt to explain the Tool to your AI Model:
Important Safety Notice:
SAP is a highly sensitive system where incorrect interactions can have serious consequences. Every action must be performed with utmost precision and care. When in doubt about any action, STOP immediately and request user assistance.
Available Tools:
The mcp-sap-gui server provides tools for SAP GUI interaction:
launch_transaction: Start a new transaction
sap_click: Click at specific coordinates
sap_move_mouse: Move mouse to coordinates
sap_type: Enter text into fields
end_transaction: Close the current transaction
Technical Limitations and Requirements:
1. You will receive only screenshot images of the SAP GUI window after each action
2. No direct access to screen element metadata or technical representation
3. You must use image recognition to:
Identify UI elements (fields, buttons, etc.)
Determine precise x/y coordinates for interactions
Verify element sizes and positions
4. All coordinates must be exact - approximate clicking is not acceptable
Step-by-Step Process:
1. Start SAP GUI Session:
Call launch_transaction with desired transaction code
Analyze the returned screenshot carefully
2. Interact with Screen:
Use image recognition to identify needed elements
Calculate exact coordinates for interaction
Execute appropriate action (sap_click, sap_type, etc.)
Verify result in next screenshot
3. Capture Screenshots:
Save screenshots at key points in the process
4. End Session:
Call end_transaction when finished
Best Practices:
1. Always verify screen state before any action
2. Double-check coordinates before clicking
3. Document each step with clear annotations
4. If uncertain about any element position, request user verification
5. Maintain consistent screenshot naming convention
Available Tools
The MCP SAP GUI Server provides the following tools for SAP automation:
Transaction Management
-launch_transaction: Launch a specific SAP transaction code
- end_transaction: End the current SAP transaction
Interface Interaction
-sap_click: Click at specific coordinates in the SAP GUI window
- sap_move_mouse: Move mouse cursor to specific coordinates
- sap_type: Type text at the current cursor position
- sap_scroll: Scroll the SAP GUI screen (up/down)
Screen Capture
-save_last_screenshot: Save the last captured screenshot of the SAP GUI window. Returns the absolute file path of the saved image.
Screenshot Return Formats
All tools that interact with the SAP GUI window (launch_transaction, sap_click, sap_move_mouse, sap_type, sap_scroll) support different screenshot return formats controlled by the return_screenshot parameter:
1. none (Default): Only returns success/error messages
{
"type": "text",
"text": "Status: success"
}
2. as_file: Saves screenshot to the specified target folder and returns the path
{
"type": "text",
"text": "Screenshot saved as C:/path/to/file/screenshot.png"
}
Note: When using as_file, you must specify the target folder using the as_file_target_folder parameter. The folder will be created if it doesn't exist.
3. as_base64: Returns the raw base64 string
{
"type": "text",
"text": "base64_encoded_string_here"
}
4. as_imagecontent: Returns MCP ImageContent object
{
"type": "image",
"data": "base64_encoded_string_here",
"mimeType": "image/png"
}
5. as_imageurl: Returns embedded resource with data URL
{
"type": "resource",
"resource": {
"uri": "application:image",
"mimeType": "image/png",
"text": "data:image/png;base64,..."
}
}
Example usage:
```python
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



