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: SAP RFC MCP Server
インストール
github フォルダーを複製し、セットアップ スクリプトを使用して自動インストールを実行します。
setup.batこれにより、ビルド プロセスがガイドされ、選択した場合は Cline または Roo に直接統合されます。
またはビルド スクリプトを使用して手動でインストールします。
build.batSAP 資格情報を構成します。
.env.exampleを.envにコピーするSAP資格情報で値を更新します
mcp インスペクタを使用したテストサーバー:
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 インスペクタを使用したテスト サーバー (ビルド + デバッグ):
./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ライセンス]
This server cannot be installed
Maintenance
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with SAP systems through RESTful APIs via MCP protocol. Supports calling SAP functions like BAPI with parameters and returns structured responses for SAP data operations.2
- AlicenseNot gradedqualityNot gradedmaintenanceAn enterprise-grade MCP server that enables AI agents to execute SAP RFC functions and read business data securely through the Model Context Protocol.
- AlicenseAqualityAmaintenanceAn MCP server that enables AI assistants to interact with SAP GUI for Windows through the SAP GUI Scripting API.5724MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI to execute RPA applications and workflows through the Model Context Protocol, supporting both local and cloud modes.91MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
BGG MCP provides access to the BoardGameGeek API through the Model Context Protocol, enabling retr…
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/mario-andreschak/mcp-sap-gui'
If you have feedback or need assistance with the MCP directory API, please join our Discord server