Skip to main content
Glama
sap-abap-mcp

sap-abap-mcp

by JayGandhi285

sap-abap-mcp

IBM Bob を SOAP/RFC および SAP WebGUI (ITS) 経由で任意の SAP ABAP システムに接続するカスタム MCP サーバーです。

SAP システムの詳細は一切ハードコードされておらず、すべて環境変数で設定されます。各ユーザーは自分の資格情報で自分のシステムに接続します。


前提条件

  • Node.js v18 以降

  • Git(クローン用)

  • IBM Bob IDE 拡張機能がインストールされていること

  • 対象システムで有効な SAP ユーザーアカウントを持っていること


Related MCP server: MCP SAP GUI Server

セットアップ(初回)

オプション A — npx 経由(最も簡単、クローン不要)

インストールは不要です。環境変数を設定し(下記の手順 3)、Bob でフォルダを開くだけです — npx が最新版を自動的にダウンロードして実行します。

オプション B — GitHub クローン経由(開発用 / オフライン用)

git clone https://github.com/JayGandhi285/sap-abap-mcp.git
cd sap-abap-mcp
npm install
npm run build

次に .bob/mcp.json で、command を npx から node に、args を ["./build/index.js"] に変更します。

3. SAP 接続情報を環境変数として設定する

これら 5 つの変数は、サーバーに対し、どの SAP システムに接続してどのようにログインするかを指示します。 各人が自分の情報を設定してください — 資格情報を共有してはなりません。

Variable

Required

Description

Example

SAP_WEBGUI_URL

✅ 必須

お使いの SAP システムの完全な WebGUI URL

https://your-sap-host/sap/bc/gui/sap/its/webgui

SAP_CLIENT

✅ 必須

SAP クライアント番号

100

SAP_USERNAME

✅ 必須

お使いの SAP ユーザー名

JSMITH

SAP_PASSWORD

✅ 必須

お使いの SAP パスワード

MyPass123

SAP_LANGUAGE

❌ 任意

ログオン言語(デフォルト: EN)

EN

Windows PowerShell — 永続化するには $PROFILE に追加します:

$env:SAP_WEBGUI_URL = "https://your-sap-host/sap/bc/gui/sap/its/webgui"
$env:SAP_CLIENT     = "100"
$env:SAP_USERNAME   = "your_sap_username"
$env:SAP_PASSWORD   = "your_sap_password"
$env:SAP_LANGUAGE   = "EN"

Mac / Linux — ~/.zshrc または ~/.bashrc に追加します:

export SAP_WEBGUI_URL="https://your-sap-host/sap/bc/gui/sap/its/webgui"
export SAP_CLIENT="100"
export SAP_USERNAME="your_sap_username"
export SAP_PASSWORD="your_sap_password"
export SAP_LANGUAGE="EN"

⚠️ 必須の変数が 1 つでも欠けている場合、サーバーは起動を拒否し、明確なエラーメッセージを出力します。

4. Bob で sap-abap-mcp フォルダを開く

Bob はワークスペースのルートにある .bob/mcp.json を自動的に検出し、サーバーに接続します。 SAP ツールは Bob のツールリストにすぐに表示されます。


利用可能なツール

Tool

Description

sap_login

SAP WebGUI 経由でログインします(セッションを確立します)

sap_navigate

任意の SAP トランザクションコード (SE16、SM30、SU01、…) に移動します

sap_se16_browse

任意の透過 SAP テーブルを参照します — ログインは不要です

sap_rfc_read_table

本格的なテーブルリーダー: フィールド選択、WHERE フィルター、ページネーション

sap_run_report

SA38 経由で ABAP レポート / プログラムを実行します

sap_execute_command

現在の WebGUI セッションに OK コード / トランザクションコマンドを送信します

sap_get_page

任意の SAP WebGUI URL を取得し、レンダリングされたページテキストを返します


Bob でのプロンプト例

Show me all users in the SAP system
Read table T001 and show the company codes
Show me all failed background jobs
List all transport requests owned by RAJAT

仕組み

  • SOAP/RFC(sap_rfc_read_table、sap_se16_browse): HTTP ベーシック認証による SOAP 経由で RFC_READ_TABLE を使用します — ステートレスで、ログインセッションは不要です。

  • WebGUI セッション(sap_login、sap_navigate など): SAP ITS WebGUI 経由で完全なログインを実行し、セッション Cookie をローカルの一時ファイルに保持します。


プロジェクト構成

sap-abap-mcp/
├── src/
│   └── index.ts          ← MCP server source (TypeScript)
├── build/
│   └── index.js          ← Compiled output (generated — not in Git)
├── .bob/
│   └── mcp.json          ← Bob MCP config (all placeholders — safe to share)
├── .gitignore
├── package.json
├── tsconfig.json
└── README.md

ソース変更後の再ビルド

npm run build

次に Bob で: 設定 → MCP → サーバーを再起動。


最新版への更新

git pull
npm install
npm run build

セキュリティに関する注意事項

  • ✅ ソースのどこにも資格情報やシステム URL はハードコードされていません。

  • ✅ .gitignore は build/、node_modules/、セッションファイル、データダンプを除外します。

  • ✅ .bob/mcp.json には ${ENV_VAR} プレースホルダーのみが含まれています — Git へのコミットは安全です。

  • ⚠️ Git にコミットされるファイルに実際の資格情報を決して追加しないでください。

Available Tools

7 tools
sap_execute_commandA

Submit an arbitrary command string (OK code / transaction) to the current SAP WebGUI session, as if typed in the command field.

Inputs: command (required).

sap_get_pageC

Fetch any SAP WebGUI URL and return the rendered page text.

Inputs: url_path (required).

sap_loginA

Log in to the SAP system via WebGUI. Must be called before using any other SAP tool. Returns the welcome screen text on success.

Inputs: password, username.

sap_navigateB

Navigate to an SAP transaction code (e.g. SE11, SE16, SM30, SU01). Returns the HTML page text of the resulting screen.

Inputs: transaction (required).

sap_rfc_read_tableA

Read data from any SAP transparent database table using RFC_READ_TABLE over SOAP. Supports field selection, WHERE filters, row limits and offsets. No session required — uses Basic Auth directly.

Inputs: table_name (required), where, fields, max_rows, +1 more.

sap_run_reportC

Run an ABAP report or program via the SA38 / SE38 transaction.

Inputs: program (required), parameters.

sap_se16_browseA

Browse a database table via SE16 (Data Browser). Returns the first page of table contents as text.

Inputs: table_name (required), max_rows.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 7 tools

    Disambiguation2/5

    Several tools have fuzzy boundaries: sap_se16_browse and sap_rfc_read_table both read table data, while sap_navigate, sap_execute_command, and sap_get_page all retrieve rendered SAP pages and can be used to reach transactions. An agent would need to read descriptions very carefully to reliably pick the right tool.

    Naming Consistency3/5

    All tools share a sap_ prefix and snake_case style, which helps, but the internal pattern is inconsistent: sap_navigate is a bare verb, sap_se16_browse leads with a transaction code, and sap_rfc_read_table mixes technical context with the action. It is readable but not a uniform verb_noun convention.

    Tool Count4/5

    Seven tools is a reasonable size for an SAP interaction server and not bloated overall. However, the set could be tightened because some tools are near-duplicates in functionality, such as the two table-reading paths and the multiple page-fetching mechanisms.

    Completeness3/5

    Core workflows like login, navigation, table reads, and running reports are covered, but there is no logout or explicit session-management tool, and report output is only exposed as raw page text. Agents can work around some gaps via execute_command or get_page, but the surface is not fully lifecycle-complete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      Not graded
      maintenance
      An MCP server that enables AI assistants to interact with SAP systems via the ABAP Development Tools (ADT) REST API. It allows users to read ABAP source code, inspect DDIC objects, and execute SQL queries directly.
      66
      -
    • A
      license
      A
      quality
      B
      maintenance
      An MCP server that enables AI assistants to interact with SAP GUI for Windows through the SAP GUI Scripting API.
      61
      505 PyPI
      61
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that connects AI assistants to SAP systems via the ADT REST API, enabling read, write, syntax-check, and activation of ABAP code directly from the chat.
      3
      MIT