sap-mcp-server
Summary: An MCP server that lets AI agents read and write SAP ABAP development objects via the ADT REST API, with policy guardrails, human approval gates and an audit log enforced server-side.
Check connectivity –
sap_test_connectionreports the logged-on user, client and number of available ADT resources.Search the repository –
sap_search_objectsfinds objects by name pattern (e.g.ZCL_MCP*) and returns name, type and package.Inspect objects –
sap_read_metadatareturns type, package, owner and version;sap_read_sourcereturns the source code.View transports –
sap_list_transportslists the logged-on user's open transport requests.Change source code –
sap_write_sourcereplaces the source of an existing object (lock, write, unlock), limited to allowed packages; the agent cannot create or delete objects.Activate objects –
sap_activatetriggers activation, but only after a human approves the request; the call itself executes nothing.Release transports –
sap_release_transportreleases a transport, subject to human approval and separation of duties (the developer cannot approve their own release).Stay within guardrails – every call is checked against an allow-list of packages, namespaces and object types, plus a read-only switch, with denials returned as named rules and reasons.
Leave a trail – each call writes a
decisionentry before execution and aresultentry after, as JSON Lines (secrets never logged), and a dry-run mode lets you test a policy before enforcing it.
Provides tools for reading and writing SAP ABAP development objects through the ADT REST API, with policy-based access control, human approval workflows, and audit logging.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sap-mcp-server List the ABAP classes in package ZMCP_SANDBOX"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sap-mcp-server
An MCP server that lets AI agents read and write SAP ABAP development objects through the ADT REST API, with guardrails that live in the server.
Every tool call is checked against a policy before anything reaches SAP: which packages, namespaces and object types the agent may touch, whether writes are enabled at all, and which actions need a human. Every decision is written to an audit log. The agent can't talk its way around the policy, because the rules are read from a file it has no access to, and object details are looked up in SAP instead of trusted from the agent.
Package, namespace and object type allow-lists.
$TMPand SAP standard objects are off-limits by default.Read-only switch. One setting turns off all writes.
Human approval for activation and transport release. The agent gets an approval request, nothing is executed.
Separation of duties. The developer can't approve their own transport.
Audit log of every decision and result as JSON Lines.
Dry-run mode to try a new policy before enforcing it.
Zero dependencies. Plain Node.js, runs via Docker or
npx.
Use this only against development or sandbox systems, never against production. SeeSecurity.
Contents
Related MCP server: abap-adt-mcp
Quick start
You need an SAP system with the ADT services active (/sap/bc/adt in transaction SICF)
and a development user. Create a .env file with your connection details:
curl -fsSL https://raw.githubusercontent.com/Maherd18/sap-mcp-server/main/.env.example -o .env
# edit .env: SAP_HOST, SAP_PORT, SAP_CLIENT, SAP_USER, SAP_PASSWORDDocker (recommended)
# check the connection
docker run --rm --env-file .env ghcr.io/maherd18/sap-mcp-server scripts/check-connection.mjs
# run the server (MCP over stdio, so -i is required)
docker run -i --rm --env-file .env -v sap-mcp-audit:/data ghcr.io/maherd18/sap-mcp-servernpx (Node.js 22 or later, credentials as environment variables)
npx -y github:Maherd18/sap-mcp-servernpx runs the server from the npm cache, so a .env file in your current directory is not
read and the default audit log would end up inside the cache. Pass the credentials as
environment variables and set SAP_MCP_AUDIT_FILE (and SAP_MCP_POLICY_FILE for your own
policy) to absolute paths, as in examples/claude_desktop_config.json.
From source
git clone https://github.com/Maherd18/sap-mcp-server.git
cd sap-mcp-server
cp .env.example .env # fill in your values
npm run check # step-by-step connection check
npm startNo npm install needed.
Create a sandbox package
The default policy only allows writes in the package ZMCP_SANDBOX. If it doesn't
exist yet, create it once:
npm run setup:sandbox # dry run
npm run setup:sandbox -- --create # create itOptions: --name, --swcomp (software component, default HOME), --layer (transport layer).
Client setup
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"sap-adt": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"--env-file", "/absolute/path/to/.env",
"-v", "sap-mcp-audit:/data",
"ghcr.io/maherd18/sap-mcp-server:latest"
]
}
}
}Claude Code
claude mcp add sap-adt -- docker run -i --rm --env-file /absolute/path/to/.env -v sap-mcp-audit:/data ghcr.io/maherd18/sap-mcp-server:latestVS Code (.vscode/mcp.json)
{
"servers": {
"sap-adt": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "--env-file", "${workspaceFolder}/.env", "ghcr.io/maherd18/sap-mcp-server:latest"]
}
}
}More variants (npx, local checkout) are in examples/.
Configuration
Variable | Default | Description |
| – | Application server host (required) |
|
| ICM port |
|
|
|
| – | Client, e.g. |
| – | Development user (required) |
|
| Logon language |
|
| HTTP timeout |
|
| Path to your own policy |
|
| Audit log target ( |
Settings are read from the environment first, then from .env in the project directory
(the directory containing src/, not your current working directory). The default audit
log logs/audit.jsonl is also placed in the project directory. Use absolute paths for
SAP_MCP_POLICY_FILE and SAP_MCP_AUDIT_FILE.
Policy
The policy is a JSON file, config/policy.json by default.
In Docker, mount your own: -v "$PWD/policy.json:/app/config/policy.json:ro".
{
"mode": "enforce",
"identity": { "developer": "", "approvers": ["LEAD_DEV"] },
"allowedNamespaces": ["Z", "Y"],
"allowedPackages": ["ZMCP_SANDBOX"],
"allowedObjectTypes": ["PROG/P", "CLAS/OC", "INTF/OI", "TABL/DT", "FUGR/F"],
"writeEnabled": true,
"tools": {
"sap_write_source": { "access": "write", "objectScoped": true },
"sap_activate": { "access": "write", "objectScoped": true, "requiresApproval": true }
}
}Key | Description |
|
|
| SAP user the agent works as. Empty means |
| Users allowed to approve a transport release. Must not include the developer. |
| Allowed name prefixes, e.g. |
| Packages the agent may read and write. Keep |
| ADT object types, e.g. |
|
|
| The tool allow-list. A tool that isn't listed doesn't exist. Per tool: |
|
|
Anything not explicitly allowed is denied, including objects that can't be found. When a call is denied, the agent gets the rule name and a reason:
Rule | When |
| The tool isn't in the policy |
| Write call while |
| Request outside |
| Object not found in the system |
| Object name outside |
| Object type outside |
| Package outside |
| Tool needs human approval |
| Separation of duties violated |
Tools
Tool | Access | Description |
| read | Checks the connection, reports user, client and ADT resources |
| read | Searches repository objects by pattern |
| read | Type, package, owner and version of an object |
| read | Source code of an object |
| read | Open transport requests of the user |
| write | Replaces the source of an existing object (lock, write, unlock) |
| write | Activates an object, requires approval |
| write | Releases a transport, requires approval and separation of duties |
There is intentionally no tool to delete or create objects. People create objects, the agent changes existing ones.
Audit log
Every call produces a decision entry before execution and a result entry afterwards:
{"time":"2026-09-26T10:15:02.114Z","run":"2026-09-26T10-14-58-001Z-4127","type":"decision","user":"DEV_USER","tool":"sap_write_source","params":{"requested":{"object_name":"ZCL_OTHER","lines":42},"resolved":{"found":true,"objectName":"ZCL_OTHER","objectType":"CLAS/OC","package":"ZOTHER_PACKAGE"}},"decision":"deny","effective":"deny","enforced":true,"rule":"package_not_allowed","reason":"Package \"ZOTHER_PACKAGE\" is not on the allow-list (ZMCP_SANDBOX).","mode":"enforce"}decision is what the policy concluded, effective is what actually happened. They only
differ in dry-run mode. Passwords, tokens and cookies are never logged.
# all denied calls
jq 'select(.type=="decision" and .effective!="allow")' logs/audit.jsonlSecurity
Development and sandbox systems only.
Use a dedicated SAP user with minimal authorizations (
S_DEVELOPrestricted to the sandbox package), not a personal developer account.Use HTTPS. With plain HTTP, basic auth sends credentials only base64-encoded.
Review
config/policy.jsonbefore the first start. Allow only the sandbox package.
The server has no dependencies on purpose: less supply-chain risk for something with write access to your development system. To report a vulnerability, see SECURITY.md.
Troubleshooting
Run npm run check (or the Docker variant from the quick start) first. It checks
configuration, network, login, search and source access step by step.
Symptom | Cause and fix |
| Wrong user or password, or the user is locked. |
| Logon works but authorizations are missing ( |
| ADT service not active. Activate |
TLS error with HTTPS | Self-signed or internal CA. Set |
Host not reachable from Docker | For a system on your own machine use |
| ADT's |
| Object is locked in another transport. The server always uses the transport from the lock response. |
Activation fails on a locked object | Activation takes its own lock. The server releases its edit lock before activation. |
HTTP 500 on create, but the object exists | ADT sometimes reports an error after creating the object. Check for the object before retrying. |
Limitations
Write path tested with ABAP classes; other object types may need adjustments.
Transport release is never executed; the tool exists to show that the policy stops it.
Separation of duties checks against
identity.approversin the policy, not against SAP authorizations.One SAP system per server instance.
Development
npm test # unit and integration tests, no SAP system neededThe tests cover the policy rules, the MCP handshake over stdio and the full tool path against a simulated ADT endpoint.
src/
server.mjs MCP entry point (JSON-RPC over stdio)
tools.mjs tool definitions, single execution path
policy.mjs policy engine
adt-client.mjs ADT REST client with path guard
audit.mjs audit log
config.mjs configuration from environment / .env
config/policy.json default policy
scripts/ connection check, sandbox setup
test/ tests (node:test)Contributions are welcome, see CONTRIBUTING.md.
Related projects
sap-ai-mcp-servers keeps an up-to-date list of MCP servers for SAP, including several for ABAP and ADT.
License
Available Tools
8 toolssap_activateA
Activates an object. Requires human approval: the call returns an approval request and does not execute.
Inputs: object_name (required).
sap_list_transportsA
Lists open transport requests of the logged-on user.
Inputs: no named parameters.
sap_read_metadataA
Reads type, package, owner and version of an object.
Inputs: object_name (required).
sap_read_sourceB
Reads the source code of a development object.
Inputs: object_name (required).
sap_release_transportA
Releases a transport request. Requires human approval and is subject to separation of duties.
Inputs: transport (required), approver.
sap_search_objectsB
Searches repository objects. Returns name, type and package.
Inputs: query (required), max_results.
sap_test_connectionA
Checks the connection to the SAP system and reports user, client and number of available ADT resources.
Inputs: no named parameters.
sap_write_sourceA
Replaces the source code of an existing object. Only inside the allowed packages. Activation is a separate step that requires approval.
Inputs: source (required), object_name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct resource/action: connection test, search, metadata read, source read, transport list, source write, activation, and transport release. No overlaps or ambiguous boundaries.
All tools follow a consistent snake_case verb_noun pattern with the 'sap_' prefix, making the API predictable and easy to navigate.
8 tools is well-scoped for a SAP development server, covering the essential operations without redundancy or unnecessary bloat.
The set covers the core lifecycle: search, read, edit, activate, and release transports. Missing create/delete operations, but these are often not permitted via API in SAP, so the gap is minor.
Maintenance
Related MCP Connectors
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Supervised API-write gateway for AI agents with policy, human approval and execution receipts.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Governance and control for agentic software development. Trust AI written code.
1225
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to access SAP ADT APIs for reading, writing, debugging, deploying, and testing ABAP code through natural language or DSL automation.541MIT
- AlicenseAqualityBmaintenanceEnables AI assistants like Claude Code to directly connect to SAP ABAP systems via the ADT REST API with read/write capabilities, featuring AI-friendly high-level tools and built-in safety measures such as read-only mode, prefix whitelisting, and automatic locking.9MIT
- AlicenseAqualityDmaintenanceEnables AI agents to read, write, activate, and transport ABAP code in SAP systems via ABAP ADT REST API, without needing SAP GUI.24MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to perform ABAP Development Tools operations on SAP ERP (ECC and S/4HANA) systems, including source code editing, object activation, syntax checks, and ABAP unit tests.14 npmMIT