sapient-mcpのロゴ

sapient-mcp

コミュニティ
toni-ramchandani

Intelligent SAP GUI automation for AI agents, MCP server powered by RoboSAPiens

公開者toni-ramchandani
リポジトリsapient-mcp
言語Python
フォーク
4
スター
13
利用可能なツール
0
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    sapient-mcpは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには13件のスターと4件のフォークがあります。

SAPient MCP

Intelligent SAP GUI automation for AI agents

A production-ready Model Context Protocol (MCP) server that enables LLMs (Claude, Copilot, Cursor, etc.) to automate SAP GUI using the RoboSAPiens library.

Compatible MCP Clients

ClientModeNotes
Claude DesktopstdioFull support
Claude CodestdioFull support
Cursorstdio or SSEFull support
VS Code (GitHub Copilot)stdio or SSERequires Copilot agent mode
Windsurfstdio or SSEFull support
Any MCP clientSSE/HTTPVia --port flag

Prerequisites

RequirementDetails
OSWindows 10/11 only (SAP GUI is Windows-only)
Python3.10 or newer
SAP GUISAP GUI for Windows installed
SAP ScriptingMust be enabled on server (RZ11: sapgui/user_scripting=TRUE) AND in SAP Logon client settings

Enable SAP GUI Scripting (one-time setup)

  1. Open SAP Logon → Customize Local Layout (Alt+F12) → Options
  2. Go to Accessibility & Scripting → Scripting
  3. ✅ Enable scripting
  4. ❌ Disable "Notify when a script attaches to a running SAP GUI session"
  5. ❌ Disable "Notify when a script opens a connection"
  6. Ask BASIS admin to run transaction RZ11 → set sapgui/user_scripting = TRUE

Installation

bash
# Clone the repo
git clone https://github.com/yourorg/sapient-mcp.git
cd sapient-mcp

# Install (using pip or uv)
pip install -e .

# Or with uv (recommended)
uv pip install -e .

Quick Start

Option A — stdio mode (local clients)

SAPient MCP works with any MCP-compatible client. Pick yours below.


Claude Desktop

Edit %APPDATA%\Claude\claude_desktop_config.json:

json
{
  "mcpServers": {
    "sapient": {
      "command": "python",
      "args": ["-m", "sapient_mcp"],
      "env": {
        "SAPIENT_MCP_SAPLOGON_PATH": "C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.exe",
        "SAPIENT_MCP_CAPS": "screenshot,codegen,advanced",
        "SAPIENT_MCP_OUTPUT_DIR": "C:\\sapient_output"
      }
    }
  }
}

Claude Code (CLI)

bash
claude mcp add sapient python -m sapient_mcp \
  -- --caps screenshot,codegen,advanced

Or edit ~/.claude/mcp.json / .claude/mcp.json in your project root:

json
{
  "mcpServers": {
    "sapient": {
      "command": "python",
      "args": ["-m", "sapient_mcp", "--caps", "screenshot,codegen,advanced"],
      "env": {
        "SAPIENT_MCP_SAPLOGON_PATH": "C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.exe",
        "SAPIENT_MCP_OUTPUT_DIR": "C:\\sapient_output"
      }
    }
  }
}

Cursor

Go to Cursor Settings → MCP → Add new MCP Server → type command, then enter:

python -m sapient_mcp --caps screenshot,codegen,advanced

Or edit ~/.cursor/mcp.json:

json
{
  "mcpServers": {
    "sapient": {
      "command": "python",
      "args": ["-m", "sapient_mcp", "--caps", "screenshot,codegen,advanced"],
      "env": {
        "SAPIENT_MCP_SAPLOGON_PATH": "C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.exe",
        "SAPIENT_MCP_OUTPUT_DIR": "C:\\sapient_output"
      }
    }
  }
}

VS Code (GitHub Copilot)

Install the MCP server via VS Code CLI:

bash
code --add-mcp '{"name":"sapient","command":"python","args":["-m","sapient_mcp","--caps","screenshot,codegen,advanced"]}'

Or add to .vscode/mcp.json in your workspace:

json
{
  "servers": {
    "sapient": {
      "type": "stdio",
      "command": "python",
      "args": ["-m", "sapient_mcp", "--caps", "screenshot,codegen,advanced"],
      "env": {
        "SAPIENT_MCP_SAPLOGON_PATH": "C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.exe",
        "SAPIENT_MCP_OUTPUT_DIR": "C:\\sapient_output"
      }
    }
  }
}

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json:

json
{
  "mcpServers": {
    "sapient": {
      "command": "python",
      "args": ["-m", "sapient_mcp", "--caps", "screenshot,codegen,advanced"],
      "env": {
        "SAPIENT_MCP_SAPLOGON_PATH": "C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.exe",
        "SAPIENT_MCP_OUTPUT_DIR": "C:\\sapient_output"
      }
    }
  }
}

Note: In stdio mode, SAPient MCP never writes to stdout or stderr — all logs go to the log file only. This is required for clean JSON-RPC communication across all clients.

Option B — SSE/HTTP mode (remote / CI / multi-user)

Best when the SAP machine is separate from where the AI client runs, or when multiple developers want to share one SAPient instance.

Run the server on your Windows SAP machine:

bash
python -m sapient_mcp --port 8765 --caps screenshot,codegen,advanced

Then point any MCP client at the HTTP endpoint:

json
{
  "mcpServers": {
    "sapient": {
      "url": "http://sap-windows-machine:8765/mcp"
    }
  }
}

This works identically in Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, and any other MCP-compatible client.

Option C — Config file

bash
python -m sapient_mcp --config C:\sap_config.json

Environment Variables

All settings can be provided as env vars with the ROBOSAP_MCP_ prefix:

VariableDefaultDescription
ROBOSAP_MCP_SAPLOGON_PATHC:\...\saplogon.exePath to SAP Logon executable
ROBOSAP_MCP_SAP_SERVERnullServer description for auto-connect
ROBOSAP_MCP_SAP_CLIENTnullSAP client for auto-login
ROBOSAP_MCP_SAP_USERnullSAP user for auto-login
ROBOSAP_MCP_SAP_PASSWORDnullSAP password (never logged)
ROBOSAP_MCP_PORTnull (stdio)Port for SSE mode
ROBOSAP_MCP_CAPS""Comma-separated caps: screenshot,codegen,advanced
ROBOSAP_MCP_OUTPUT_DIR./sap_outputScreenshots and logs directory
ROBOSAP_MCP_SCREENSHOT_ON_ERRORtrueAuto-screenshot on tool failures

Available Tools

Core (always loaded)

ToolDescription
sap_openLaunch SAP Logon
sap_connect_to_serverConnect to SAP server
sap_connect_to_runningAttach to running SAP session
sap_get_session_infoRead-only: current state & title
sap_closeClose SAP
sap_execute_transactionRun a transaction code
sap_activate_tabClick a tab by label
sap_get_window_titleRead-only: current window title
sap_select_menu_itemNavigate menu bar
sap_send_keySend keyboard key (Enter, F3, etc.)
sap_fill_text_fieldFill a field by its label
sap_clear_text_fieldClear a field
sap_set_checkboxCheck a checkbox
sap_unset_checkboxUncheck a checkbox
sap_select_radio_buttonSelect a radio button
sap_push_buttonClick a button by label
sap_button_existsRead-only: check if button exists
sap_read_text_fieldRead-only: read field value
sap_read_textRead-only: read any text element
sap_read_status_barRead-only: SAP status bar message
sap_count_table_rowsRead-only: table row count
sap_select_table_rowSelect a table row
sap_read_table_cellRead-only: read a cell value
sap_fill_cellFill a table cell
sap_double_click_cellDouble-click a table cell
sap_scroll_tableScroll table up/down

--caps screenshot

ToolDescription
sap_take_screenshotCapture SAP window screenshot

--caps codegen

ToolDescription
sap_get_generated_scriptGet accumulated Robot Framework script
sap_clear_scriptClear script buffer

--caps advanced

ToolDescription
sap_get_snapshotStructured JSON snapshot of current window

Example LLM Conversation

You: Create a purchase order for vendor 100001, company code 1000, with 50 units of material ABC-001

SAPient will guide the LLM to:

  1. Call sap_execute_transaction("/nME21N")
  2. Call sap_get_window_title() → "Create Purchase Order"
  3. Call sap_fill_text_field("Vendor", "100001")
  4. Call sap_fill_text_field("Company Code", "1000")
  5. Call sap_send_key("Enter") to accept header
  6. Call sap_activate_tab("Item Overview")
  7. Call sap_fill_cell("1", "Material", "ABC-001")
  8. Call sap_fill_cell("1", "Quantity", "50")
  9. Call sap_push_button("Save")
  10. Call sap_read_status_bar() → "Purchase order 4500001234 created"

Project Structure

sapient-mcp/
├── pyproject.toml
├── README.md
├── sap_config.json              # Example config file
├── claude_desktop_config.json   # Example Claude Desktop config
└── src/
    └── sapient_mcp/
        ├── __init__.py
        ├── __main__.py          # Entry point + CLI arg parsing
        ├── config.py            # Pydantic settings (env/file/CLI)
        ├── session.py           # SAPSessionManager singleton
        └── server.py            # FastMCP server + all 27 tool definitions

Logs

Logs are written to {output_dir}/sapient_mcp.log.

In stdio mode, logs never go to stdout/stderr (would break JSON-RPC). In SSE mode, logs also appear on stderr.

sapient-mcpのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度sapient-mcpに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

sapient-mcpをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. sapient-mcpのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "sapient-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてsapient-mcpのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. sapient-mcpのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
sapient-mcpを使ってこのタスクを手伝ってもらえますか?
sapient-mcp
はい、読みました。
sapient-mcpで調べた結果をお伝えします。

よくある質問

sapient-mcp MCPサーバーは何に使いますか?

sapient-mcpは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでsapient-mcp MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでsapient-mcpを利用できます。

TypingMindでsapient-mcp MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。sapient-mcpを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

sapient-mcp MCPをTypingMindに接続するにはどうすればよいですか?

sapient-mcpはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでsapient-mcp MCPのどのようなツールを利用できますか?

sapient-mcpはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

sapient-mcp MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。sapient-mcpで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇