MCP SAP GUI Server
MCP SAP GUI 서버
SAP GUI 자동화를 위한 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 SAP GUI와의 상호작용을 자동화하는 도구를 제공하여 SAP 트랜잭션을 프로그래밍 방식으로 제어할 수 있도록 합니다.
요구 사항
Python 3.8 이상
SAP GUI 설치 및 구성
유효한 SAP 자격 증명(시스템, 클라이언트, 사용자, 비밀번호)
Node.js(npx용)
Related MCP server: sapgui-mcp
설치
github 폴더를 복제하고 설치 스크립트를 사용하여 자동화된 설치를 실행합니다.
지엑스피1
이렇게 하면 빌드 과정을 안내받고, 선택한 경우 Cline이나 Roo에 직접 통합됩니다.
또는 빌드 스크립트를 사용하여 수동 설치..:
build.batSAP 자격 증명을 구성하세요.
.env.example``.env로 복사합니다.SAP 자격 증명으로 값을 업데이트하세요.
mcp inspector를 사용한 테스트 서버:
run.bat debug통합 스크립트를 사용하여 MCP 설정을 자동으로 구성합니다.
integrate.bat cline # Configure for Cline
integrate.bat roo # Configure for Roo스크립트는 다음을 수행합니다.
자동으로 올바른 설정 파일 경로를 결정합니다
변경하기 전에 백업을 만드세요
MCP 구성을 안전하게 업데이트하세요
부패 방지를 위해 변경 사항 검증
수동 구성(필요한 경우):
"mcp-sap-gui": {
"command": "python",
"args": [
"-m",
"sap_gui_server.server"
],
"cwd": "PATH_TO_YOUR_FOLDER/mcp-sap-gui",
"disabled": false,
"autoApprove": []
}이 프롬프트를 사용하여 AI 모델에 도구를 설명하세요.
**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사용 가능한 도구
MCP SAP GUI 서버는 SAP 자동화를 위해 다음과 같은 도구를 제공합니다.
거래 관리
launch_transaction: 특정 SAP 트랜잭션 코드를 실행합니다.end_transaction: 현재 SAP 트랜잭션을 종료합니다.
인터페이스 상호작용
sap_click: SAP GUI 창에서 특정 좌표를 클릭합니다.sap_move_mouse: 마우스 커서를 특정 좌표로 이동합니다.sap_type: 현재 커서 위치에 텍스트를 입력합니다.sap_scroll: SAP GUI 화면을 위/아래로 스크롤합니다.
화면 캡처
save_last_screenshot: SAP GUI 창의 마지막 스크린샷을 저장합니다. 저장된 이미지의 절대 파일 경로를 반환합니다.
스크린샷 반환 형식
SAP GUI 창과 상호 작용하는 모든 도구(launch_transaction, sap_click, sap_move_mouse, sap_type, sap_scroll)는 return_screenshot 매개변수로 제어되는 다양한 스크린샷 반환 형식을 지원합니다.
none(기본값): 성공/오류 메시지만 반환합니다.
{
"type": "text",
"text": "Status: success"
}as_file: 스크린샷을 지정된 대상 폴더에 저장하고 경로를 반환합니다.
{
"type": "text",
"text": "Screenshot saved as C:/path/to/file/screenshot.png"
}참고: as_file 사용할 때는 as_file_target_folder 매개변수를 사용하여 대상 폴더를 지정해야 합니다. 폴더가 없으면 자동으로 생성됩니다.
as_base64: 원시 base64 문자열을 반환합니다.
{
"type": "text",
"text": "base64_encoded_string_here"
}as_imagecontent: MCP ImageContent 객체를 반환합니다.
{
"type": "image",
"data": "base64_encoded_string_here",
"mimeType": "image/png"
}as_imageurl: 데이터 URL이 포함된 내장 리소스를 반환합니다.
{
"type": "resource",
"resource": {
"uri": "application:image",
"mimeType": "image/png",
"text": "data:image/png;base64,..."
}
}사용 예:
# Default - no screenshot
result = await client.call_tool("launch_transaction", {
"transaction": "VA01"
})
# Save to specific folder
result = await client.call_tool("launch_transaction", {
"transaction": "VA01",
"return_screenshot": "as_file",
"as_file_target_folder": "C:/screenshots"
})
# Get base64 string
result = await client.call_tool("launch_transaction", {
"transaction": "VA01",
"return_screenshot": "as_base64"
})도구 매개변수 요약:
도구 | 매개변수 | 유형 | 기본 | 설명 |
|
|
| 실행할 SAP 트랜잭션 코드(예: VA01, ME21N, MM03) | |
|
|
| 스크린샷 반환 형식( | |
|
| 'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로 | ||
|
|
| 클릭이 발생해야 하는 수평 픽셀 좌표(0-1920) | |
|
| 클릭이 발생해야 하는 수직 픽셀 좌표(0-1080) | ||
|
|
| 스크린샷 반환 형식( | |
|
| 'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로 | ||
|
|
| 커서를 이동할 수평 픽셀 좌표(0-1920) | |
|
| 커서를 이동할 수직 픽셀 좌표(0-1080) | ||
|
|
| 스크린샷 반환 형식( | |
|
| 'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로 | ||
|
|
| SAP GUI 창의 현재 커서 위치에 입력할 텍스트 | |
|
|
| 스크린샷 반환 형식( | |
|
| 'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로 | ||
|
|
| 화면을 스크롤하는 방향('위'는 콘텐츠를 아래로 이동하고, '아래'는 위로 이동) | |
|
|
| 스크린샷 반환 형식( | |
|
| 'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로 | ||
| ||||
|
|
| 스크린샷이 저장될 경로 |
개발
테스트 실행
mcp inspector를 사용한 테스트 서버(빌드 + 디버그):
./run.bat full또는 테스트 모음을 사용하세요. 테스트 모음에는 SAP GUI와 상호 작용하는 라이브 테스트가 포함되어 있습니다. 테스트를 실행하기 전에 SAP GUI가 설치 및 구성되어 있는지 확인하세요.
테스트 실행:
run.bat test server테스트 모음에는 다음이 포함됩니다.
SapGuiServer 테스트(test_server.py)
도구 등록
요청 처리
응답 형식
오류 처리
프로젝트 구조
mcp-sap-gui/
├── src/
│ └── sap_gui_server/
│ ├── __init__.py
│ ├── sap_controller.py # SAP GUI interaction logic
│ └── server.py # MCP server implementation
├── tests/
│ ├── __init__.py
│ ├── test_sap_controller.py
│ └── test_server.py
├── build.bat # Build and test script
├── integrate.bat # Integration script for Cline/Roo
├── integrate.py # Python script for safe MCP settings updates
├── requirements.txt # Production dependencies
└── requirements-dev.txt # Development dependencies특허
[MIT 라이센스]
Available Tools
12 toolsend_transactionA
End only the configured session's current transaction. Unsaved work in that transaction can be lost.
Inputs: no named parameters.
launch_transactionC
Start a transaction in the configured session; preserves unrelated SAP sessions.
Inputs: transaction (required), return_screenshot, as_file_target_folder.
sap_clickC
Click physical screenshot pixels relative to the selected SAP window.
Inputs: x (required), y (required), return_screenshot, as_file_target_folder.
sap_get_screenARead-only
Read up to 300 SAP COM controls and text (password fields redacted), optionally with screenshot.
Inputs: return_screenshot, as_file_target_folder.
sap_move_mouseC
Move within the selected SAP window using physical screenshot pixels.
Inputs: x (required), y (required), return_screenshot, as_file_target_folder.
sap_pressC
Press a SAP GUI button through its COM interface.
Inputs: element_id (required).
sap_run_guixt_scriptA
Submit a preinstalled GuiXT InputScript to this exact SAP window; requires configured GuiXT opt-in. Completion is asynchronous.
Inputs: script (required).
sap_scrollC
Scroll the selected SAP window.
Inputs: direction (required), return_screenshot, as_file_target_folder.
sap_send_vkeyC
Send a documented SAP virtual key (0 is Enter) to the configured session.
Inputs: key (required).
sap_set_fieldC
Set literal text through SAP GUI ActiveX/COM scripting, scoped to wnd[N] in this session.
Inputs: text (required), element_id (required).
sap_typeA
Type WScript SendKeys text/special keys in the selected SAP window. Use sap_set_field for literal text.
Inputs: text (required), return_screenshot, as_file_target_folder.
save_last_screenshotB
Save the last requested screenshot under SAP_OUTPUT_ROOT without overwriting a file.
Inputs: filename (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools target distinct actions (pixel click, mouse move, scroll, transaction lifecycle, COM field set, button press, virtual key, screenshot). Two pairs overlap somewhat: sap_type vs sap_set_field for entering text, and sap_press vs sap_send_vkey for triggering controls; descriptions mitigate by recommending COM for literal text and documenting vkey behavior.
All names use snake_case and mostly follow a verb_noun pattern, with a consistent sap_ prefix on interaction tools. However, three lifecycle/screenshot tools (launch_transaction, end_transaction, save_last_screenshot) omit the sap_ prefix, a minor inconsistency.
Twelve tools is well-scoped for a GUI automation server: transaction lifecycle, screen reading, several input modalities, screenshots, and GuiXT scripting each earn a place without obvious redundancy.
The surface covers core GUI automation: transaction start/end, screen scraping, pixel and COM input, scrolling, screenshots, and GuiXT scripting. Minor gaps remain for explicit window selection, waiting for screen readiness, and targeted field value extraction, but agents can work around these with existing tools.
Maintenance
Related MCP Connectors
Browser automation MCP for whole web tasks in a cloud browser: saved logins, bot checks, replays.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server that enables AI assistants to interact with SAP GUI for Windows through the SAP GUI Scripting API.61505 PyPI61MIT
- AlicenseAqualityBmaintenanceEnables AI agents to execute SAP tasks through a cost-routing MCP server that tries API, recorded scripts, WebGUI, and computer-use vision in cheapest-first order, falling back only when needed. It can also promote an interactive GUI routine into a reusable recorded script to make repeat runs nearly free.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables Windows GUI automation through the Model Context Protocol, providing tools, workflows, and generative capabilities for natural language-driven interaction with desktop applications.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to drive SAP GUI for Windows through the SAP GUI Scripting API — connecting to systems, running transactions, reading and writing screen fields, extracting ALV grid, table, tree, and report-list data, and capturing screenshots. Includes server-enforced confirmation points and previews so nothing is written to SAP without explicit user approval.MIT