Skip to main content
Glama
sap-abap-mcp

sap-abap-mcp

by JayGandhi285

sap-abap-mcp

一个自定义的 MCP 服务器,通过 SOAP/RFC 和 SAP WebGUI (ITS) 将 IBM Bob 连接到任何 SAP ABAP 系统。

没有硬编码任何 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 中,将命令从 npx 改为 node,并将参数改为 ["./build/index.js"]。

3. 将您的 SAP 连接详细信息设置为环境变量

这五个变量告诉服务器要连接到哪个 SAP 系统以及如何登录。 每个人设置自己的——切勿共享凭据。

变量

必需

描述

示例

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"

⚠️ 如果缺少任何必需变量,服务器将拒绝启动并打印清晰的错误消息。

4. 在 Bob 中打开 sap-abap-mcp 文件夹

Bob 会自动检测工作区根目录中的 .bob/mcp.json 并连接到服务器。 SAP 工具将立即出现在 Bob 的工具列表中。


可用工具

工具

描述

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):通过 SOAP 使用 RFC_READ_TABLE,采用 HTTP 基本认证——无状态,无需登录会话。

  • 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.

    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
      A
      maintenance
      An MCP server that enables AI assistants to interact with SAP GUI for Windows through the SAP GUI Scripting API.
      61
      553 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