sap-abap-mcp
Provides tools for interacting with SAP ABAP systems via ADT over HTTP or RFC, including searching and reading ABAP objects, running syntax checks and ATC checks, inspecting transport requests, executing guarded SQL queries, and performing guarded write/activation operations.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
sap-abap-mcp
English | ภาษาไทย (Thai)
Lightweight, safe SAP ABAP ADT MCP server written in Rust (stdio transport) with dual HTTP/HTTPS & dynamic RFC connectivity, ABAP Test Cockpit (ATC) integration, Transport inspection, and built-in write guardrails.
Licensed under the MIT License.
Why Rust?
Single static binary: No Node.js, Python, or runtime dependencies to install or version-manage.
Minimal footprint: Typically < 15 MB RAM with instant startup over MCP
stdio.HTTP + dynamic RFC in one binary: Switch between modern S/4HANA HTTP(S) ADT and ECC / legacy BASIS
SADT_REST_RFC_ENDPOINTusing--connection-type.Same binary across all systems: Point one compiled executable at DEV, QAS, or sandbox
.envprofiles with distinct safety flags per environment.
Related MCP server: dassian-adt
Features
Dual ADT Transport (
http/rfc):http: Native async HTTP/HTTPS (reqwest, using Windows Schannel on Windows andrustlson Linux/macOS), cookie/CSRF handling, and optional--insecurefor self-signed dev systems.rfc: Dynamic runtime loading of the SAP NetWeaver RFC SDK (SADT_REST_RFC_ENDPOINT) for ECC, legacy BASIS releases, or RFC-only endpoints with reliable stateful lock sessions.
Built-in Safety Controls (
SafetyPolicy):--readonly: Completely disables and omits all write/activation tools from the MCP tool list.--write-packages: Glob-filtered package allowlist (default:Z*,Y*,$TMP).--require-transport: Enforces a transport request number for non-local (non-$) packages (default:true).Standard SAP Namespace Protection: Modifications to standard SAP objects outside customer namespaces (
Z*,Y*, or/NAMESPACE/) are always blocked.Safe Write Pipeline:
WriteSourcevalidatesSafetyPolicy-> runsSyntaxCheck-> acquiresLOCK-> uploads source (PUT) -> guaranteesUNLOCK-> optionally activates.
Rich ATC Integration:
AtcRunCheckandAtcGetWorklistenrich findings with surrounding source code snippets (include_code_snippets), syntax details, and#EC/##pseudo-comment suppress hints parsed from ADT documentation (include_doc_hints).
Transport Inspection & Pre-Release Gate:
TransportList(E070/E07T) andTransportGet(tasks,E071objects, lock flags, and inactive object warnings).AtcRunTransportruns ATC checks across all ATC-checkable ABAP code objects inside a transport request or task before release.
SAP NW RFC SDK Notice: SAP NetWeaver RFC SDK binaries (
sapnwrfc.dllon Windows,libsapnwrfc.soon Linux,libsapnwrfc.dylibon macOS, and accompanying ICU libraries) are proprietary to SAP SE. They are NOT bundled in this repository or in release binaries, and are loaded dynamically at runtime (libloading) only when--connection-type=rfcis selected.
Installation
Option 1: Prebuilt Binary (GitHub Releases)
Download the archive for your platform from the Releases page, verify its .sha256 checksum, and extract sap-abap-mcp (or sap-abap-mcp.exe on Windows) to a directory on your PATH:
Windows:
x86_64-pc-windows-msvc(.zip)Linux:
x86_64-unknown-linux-gnu(.tar.gz)macOS (Apple Silicon):
aarch64-apple-darwin(.tar.gz)
Option 2: Build from Source
Requires a stable Rust toolchain (1.75+ recommended):
cargo build --releaseThe binary is output to target/release/sap-abap-mcp (target\release\sap-abap-mcp.exe on Windows).
Prerequisites for Optional RFC Mode (--connection-type=rfc)
HTTP/HTTPS mode (--connection-type=http) works out of the box with zero external native libraries.
To use --connection-type=rfc:
Obtain the SAP NetWeaver RFC SDK from the SAP Support Portal (requires a valid SAP license).
Make the shared libraries (
sapnwrfc.dll/libsapnwrfc.so/libsapnwrfc.dyliband the bundled ICU libraries) discoverable by either:Setting
SAPNWRFC_HOMEto the SDK directory (containinglib/), orAdding the SDK
libdirectory toPATH(Windows),LD_LIBRARY_PATH(Linux), orDYLD_LIBRARY_PATH(macOS).
Ensure the SAP user has authorization for
S_RFConSADT_REST_RFC_ENDPOINTas well as standard ADT/ATC/CTS authorizations.
Configuration
Create a .env file outside your repository (see .env.example):
SAP_URL=http://sap-host.example.com:8000
SAP_CLIENT=100
SAP_USERNAME=DEVELOPER
SAP_PASSWORD=CHANGE_ME
SAP_LANGUAGE=EN
# Transport layer: "http" or "rfc"
SAP_CONNECTION_TYPE=http
# Optional explicit SAP system number for RFC (derived from port 80XX -> XX if omitted)
# SAP_SYSNR=00Never commit
.envfiles or real credentials. See SECURITY.md for best practices.
CLI Flags
All flags match src/config.rs:
Flag | Env Var | Default | Description |
|
| — | Path to |
|
|
| Connection transport layer: |
|
| Derived from port ( | Explicit 2-digit SAP system number for RFC mode |
| — |
| Enforce read-only mode; write and activation tools are disabled and omitted from |
| — |
| Comma-separated allowed packages for write operations (supports |
| — |
| Require a transport request number for non-local (non- |
| — |
| Skip TLS certificate verification for self-signed HTTPS SAP servers |
| — |
| HTTP request timeout in seconds (minimum |
|
|
| Optional SE24 |
| — |
| Opt-in flag to expose |
|
|
| Disable |
|
| (empty = all) | Comma-separated allowed table patterns for |
|
| (empty) | Comma-separated blocked table patterns for |
MCP Tools (19 Total)
Read-Only, Search, ATC & Transport Tools (16 — Always Registered)
Tool | Description | Parameters |
| Search ABAP objects via ADT |
|
| Read ABAP source code of a program, class (or class include: |
|
| Find where-used references of an ABAP object |
|
| List objects inside an ABAP package |
|
| Execute a read-only Open SQL |
|
| Read any |
|
| Run ABAP syntax check ( |
|
| List currently inactive ABAP objects for the logged-in user | (none) |
| Read ATC system customizing ( | (none) |
| List available ATC / Code Inspector check variants (custom |
|
| Run an ATC check on an ABAP object or package and return findings enriched with source lines, syntax details, and |
|
| Retrieve findings from an existing ATC worklist ID |
|
| List transport requests ( |
|
| Inspect a transport request or task (metadata, tasks, |
|
| Run ATC across all ATC-checkable ABAP code objects inside a transport request or task before release |
|
| Read/dump customer |
|
⚠️ Data Privacy Warning (
RunSqlQuery):RunSqlQueryis enabled by default (read-onlySELECTvia ADT Data Preview), which means the AI client can query any SAP table that the configuredSAP_USERNAMEis authorized to read — including sensitive HR, financial, customer, or patient/PII data on systems containing real records. On QAS, PRD, or systems with real data, choose whether to disable SQL completely (--disable-sql) or restrict accessible tables (--sql-allowed-tables/--sql-blocked-tables) according to your security policy.
Write & Activation Tools (2 Standard + 1 Opt-In ENHO — Omitted Under --readonly)
Tool | Description | Parameters |
| Safely write ABAP source ( |
|
| Activate an inactive ABAP object (gated by |
|
| DEV-only tool to update an existing |
|
Optional: Source-Code Enhancement (ENHO) Read & Edit via ZCL_ENH_SOURCE_RUN
Standard SAP ADT APIs do not provide direct source-code PUT editing for implicit/explicit ENHO hook implementations. To support inspecting and updating ENHO hooks cleanly, this repository ships abap/ZCL_ENH_SOURCE_RUN.abap.
Manual Setup Required in SE24
Important:
ZCL_ENH_SOURCE_RUNis NOT automatically installed on your SAP system. All other 15 tools (SearchObject,GetSource,AtcRunCheck,WriteSource, etc.) work without it, butEnhancementReadandEnhancementUpdaterequire you to create the helper class yourself first:
Open transaction
SE24in your DEV SAP GUI.Create class
ZCL_ENH_SOURCE_RUN(Public,Final) and save it in package$TMP(Local Object) — never assign it to a transportable package or transport it to QAS/PRD.Switch to Source Code-Based editor mode, paste the entire contents of
abap/ZCL_ENH_SOURCE_RUN.abap, Save, and Activate (Ctrl+F3).Verify in read-only mode by asking your AI client to run
EnhancementRead.
Critical Safety Warnings Before Enabling --enable-enho-write
DEV systems only: Never enable
--enable-enho-writeor installZCL_ENH_SOURCE_RUNon QAS or PRD.Direct impact on SAP standard programs:
ENHOhook code is injected inside standard SAP programs/classes. A syntax error or bad runtime change inside anENHOcan trigger short dumps in standard SAP transactions (e.g., ME21N, MIGO, VA01). Always start withdry_run: true(the default), inspect the diff carefully, run syntax/ATC checks, and test in SAP GUI immediately after activation.Strict
$TMPrequirement:EnhancementUpdaterefuses to run ifZCL_ENH_SOURCE_RUNis in any package other than$*(to prevent temporary dispatch code from ever entering a Transport Request).Avoid concurrent ENHO updates on the same class: Two simultaneous
EnhancementUpdatecalls sharing the sameZCL_ENH_SOURCE_RUNclass can race. If multiple developers share a DEV client, give each developer their own$TMPclass (e.g.--enho-runner-class=ZCL_ENH_SOURCE_RUN_DEV1).Automatic restore guardrail:
EnhancementUpdatepatches only between*>>MCP_DISPATCH_STARTand*<<MCP_DISPATCH_END, runsIF_OO_ADT_CLASSRUN, and unconditionally restoresdump_all( out ).afterward. If a catastrophic network drop interrupts restoration, reset those markers manually in SE24.Clean Core recommendation: For new enhancements, create the
ENHOonce in SAP GUI calling a single method on aZCL_*class, then maintain business logic in normal ABAP classes viaWriteSource.
Client Configuration Examples
Reuse one binary across multiple SAP systems (e.g., DEV with RFC write access + QAS in strict --readonly mode).
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"abap-dev": {
"command": "/path/to/sap-abap-mcp",
"args": [
"--env-path=/path/to/secrets/sap-dev.env",
"--connection-type=rfc",
"--sysnr=00",
"--write-packages=Z*,Y*,$TMP",
"--require-transport=true"
]
},
"abap-qas": {
"command": "/path/to/sap-abap-mcp",
"args": [
"--env-path=/path/to/secrets/sap-qas.env",
"--connection-type=rfc",
"--readonly",
"--disable-sql"
]
}
}
}On Windows, point "command" to C:\\Tools\\sap-abap-mcp\\sap-abap-mcp.exe and use Windows paths for --env-path.
Claude Code (.mcp.json or claude mcp add)
Add via CLI:
# DEV system (RFC mode with transport enforcement)
claude mcp add abap-dev -- /path/to/sap-abap-mcp \
--env-path=/path/to/secrets/sap-dev.env \
--connection-type=rfc \
--write-packages=Z*,Y*,$TMP \
--require-transport=true
# QAS system (strict read-only HTTP mode)
claude mcp add abap-qas -- /path/to/sap-abap-mcp \
--env-path=/path/to/secrets/sap-qas.env \
--connection-type=http \
--readonlyExample usage prompts in your AI client:
"Search for
ZMY_CLASSand check its source code.""Run
AtcRunCheckonZMY_PROGRAMand show any findings with suppress hints.""Inspect transport
DEVK900001withTransportGetand runAtcRunTransportbefore release."
Common Workflows
Read & Analyze ABAP Code Safely (
--readonly)SearchObject->GetPackageContents->GetSource/GetWhereUsed/RunSqlQuery
Fix ATC Findings End-to-End
AtcGetCustomizing/AtcListVariants->AtcRunCheck(returns surrounding source lines + syntax errors +#EC/##pseudo-comment suppress hints) ->SyntaxCheck->WriteSource-> re-runAtcRunCheck
Pre-Release Transport Gate
TransportList->TransportGet(verifies tasks,E071objects, locks, and flags inactive objects) ->AtcRunTransport(checks all ATC-checkable ABAP code inside the transport before release)
Troubleshooting
HTTP 423 (
Resource locked/ stateful lock error on write/check): Some SAP systems (especially ECC or behind certain proxies/ICM setups) drop stateful HTTP lock cookies across ADT requests. Switch to--connection-type=rfc(--sysnr=XX), whereSADT_REST_RFC_ENDPOINTkeeps locks inside the stateful RFC connection.SAP NW RFC SDK library not found (
rfcmode): Ensuresapnwrfc.dll(PATH/SAPNWRFC_HOME\lib) orlibsapnwrfc.so/libsapnwrfc.dylibplus its matching ICU libraries are on your library search path and match the 64-bit architecture ofsap-abap-mcp.Self-signed HTTPS certificates on dev SAP systems: Pass
--insecurewhen using--connection-type=httpagainst internal HTTPS endpoints without a public CA certificate.RFC system number (
--sysnr): IfSAP_URLuses a standard ICM port like:8000or:8081,--sysnrautomatically derives00or81. For reverse-proxied or non-standard ports, set--sysnr=XX(orSAP_SYSNR=XXin.env) explicitly.
Development & Testing
All tests run offline without a live SAP system or SAP NW RFC SDK binaries:
# Check formatting
cargo fmt --all -- --check
# Lint with Clippy
cargo clippy --all-targets -- -D warnings
# Run unit and integration tests
cargo testSee CONTRIBUTING.md for clean-room contribution rules and PR requirements.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
A MCP server built for developers enabling Git based project management with project and personal…
Primary-source MCP server with epistemic compiler, Audit.lean & offline veriscope-verify CLI.
An MCP server that provides Javelin Standalone Guardrails
Related MCP Servers
- AlicenseCqualityNot gradedmaintenanceAn MCP server that facilitates seamless interaction with SAP ABAP systems to manage development objects, transport requests, and source code. It provides a comprehensive suite of tools for performing syntax checks, object searches, and code modifications via the ADT API.100-

dassian-adtofficial
AlicenseNot gradedqualityCmaintenanceMCP server for SAP ABAP development via the ADT API. Connect AI assistants to your SAP system — read, write, test, and deploy ABAP code without SAP GUI.22MIT- AlicenseNot gradedqualityBmaintenanceMulti-system MCP server for reading and writing ABAP source via SAP ADT, with write safety controls and a local web admin.MIT
- AlicenseNot gradedqualityDmaintenanceA standalone MCP server for SAP ABAP development and customizing that connects directly to your SAP system via ADT REST API, enabling AI assistants to search, read, write, activate, transport, debug, and run quality checks on ABAP code, as well as manage customizing/IMG configurations with governed transport recording.MIT