MCP SAP GUI Server

by mario-andreschak
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides tools to automate interactions with SAP GUI, enabling programmatic control of SAP transactions including launching transactions, clicking at coordinates, moving the mouse, typing text, and scrolling the SAP GUI screen.

MCP SAP GUI 서버

SAP GUI 자동화를 위한 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 SAP GUI와의 상호작용을 자동화하는 도구를 제공하여 SAP 트랜잭션을 프로그래밍 방식으로 제어할 수 있도록 합니다.

요구 사항

  • Python 3.8 이상
  • SAP GUI 설치 및 구성
  • 유효한 SAP 자격 증명(시스템, 클라이언트, 사용자, 비밀번호)
  • Node.js(npx용)

설치

  1. github 폴더를 복제하고 설치 스크립트를 사용하여 자동화된 설치를 실행합니다.

지엑스피1

이렇게 하면 빌드 과정을 안내받고, 선택한 경우 Cline이나 Roo에 직접 통합됩니다.

  1. 또는 빌드 스크립트를 사용하여 수동 설치..:
build.bat
  1. SAP 자격 증명을 구성하세요.
  • .env.example``.env 로 복사합니다.
  • SAP 자격 증명으로 값을 업데이트하세요.
  1. mcp inspector를 사용한 테스트 서버:
run.bat debug
  1. 통합 스크립트를 사용하여 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": [] }
  1. 이 프롬프트를 사용하여 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 매개변수로 제어되는 다양한 스크린샷 반환 형식을 지원합니다.

  1. none (기본값): 성공/오류 메시지만 반환합니다.
{ "type": "text", "text": "Status: success" }
  1. as_file : 스크린샷을 지정된 대상 폴더에 저장하고 경로를 반환합니다.
{ "type": "text", "text": "Screenshot saved as C:/path/to/file/screenshot.png" }

참고: as_file 사용할 때는 as_file_target_folder 매개변수를 사용하여 대상 폴더를 지정해야 합니다. 폴더가 없으면 자동으로 생성됩니다.

  1. as_base64 : 원시 base64 문자열을 반환합니다.
{ "type": "text", "text": "base64_encoded_string_here" }
  1. as_imagecontent : MCP ImageContent 객체를 반환합니다.
{ "type": "image", "data": "base64_encoded_string_here", "mimeType": "image/png" }
  1. 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" })

도구 매개변수 요약:

도구매개변수유형기본설명
launch_transactiontransactionstring실행할 SAP 트랜잭션 코드(예: VA01, ME21N, MM03)
return_screenshotstringnone스크린샷 반환 형식( none , as_file , as_base64 , as_imagecontent , as_imageurl )
as_file_target_folderstring'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로
sap_clickxinteger클릭이 발생해야 하는 수평 픽셀 좌표(0-1920)
yinteger클릭이 발생해야 하는 수직 픽셀 좌표(0-1080)
return_screenshotstringnone스크린샷 반환 형식( none , as_file , as_base64 , as_imagecontent , as_imageurl )
as_file_target_folderstring'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로
sap_move_mousexinteger커서를 이동할 수평 픽셀 좌표(0-1920)
yinteger커서를 이동할 수직 픽셀 좌표(0-1080)
return_screenshotstringnone스크린샷 반환 형식( none , as_file , as_base64 , as_imagecontent , as_imageurl )
as_file_target_folderstring'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로
sap_typetextstringSAP GUI 창의 현재 커서 위치에 입력할 텍스트
return_screenshotstringnone스크린샷 반환 형식( none , as_file , as_base64 , as_imagecontent , as_imageurl )
as_file_target_folderstring'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로
sap_scrolldirectionstring화면을 스크롤하는 방향('위'는 콘텐츠를 아래로 이동하고, '아래'는 위로 이동)
return_screenshotstringnone스크린샷 반환 형식( none , as_file , as_base64 , as_imagecontent , as_imageurl )
as_file_target_folderstring'as_file' 반환 형식을 사용할 때 스크린샷을 저장하기 위한 대상 폴더 경로
end_transaction
save_last_screenshotfilenamestring스크린샷이 저장될 경로

개발

테스트 실행

  1. mcp inspector를 사용한 테스트 서버(빌드 + 디버그):
./run.bat full
  1. 또는 테스트 모음을 사용하세요. 테스트 모음에는 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 라이센스]

-
security - not tested
A
license - permissive license
-
quality - not tested

모델 컨텍스트 프로토콜을 사용하여 SAP GUI와의 상호작용을 자동화하여 클릭, 입력, 스크롤, 트랜잭션 관리와 같은 도구를 통해 SAP 트랜잭션을 정확하게 제어할 수 있습니다.

  1. Requirements
    1. Installation
      1. Available Tools
        1. Transaction Management
        2. Interface Interaction
        3. Screen Capture
        4. Screenshot Return Formats
      2. Development
        1. Running Tests
      3. Project Structure
        1. License
          ID: jrsv7188i3