sap-abap-mcp
v0.8.0
Published
AI-powered ABAP development. Registers an MCP server that lets Copilot Chat (and other MCP clients) read, search, and edit ABAP objects on any on-premise SAP system via the ADT REST API.
Maintainers
Readme
SAP ABAP MCP
An MCP server for ABAP development on any on-premise SAP system. Once configured, an MCP-aware client — GitHub Copilot Chat, Claude Code, Claude Desktop, Cursor — can read tables, search the repository, read source code, and (when not in read-only mode) create or update ABAP programs and classes through the ADT (ABAP Development Tools) REST API.
Distributed two ways from the same repository:
- npm package
sap-abap-mcp— for Claude Desktop, Claude Code, Cursor, or any other standalone MCP client. Runs over stdio, configured via environment variables. - VS Code extension (
.vsixin Releases) — for GitHub Copilot Chat / Cursor inside VS Code 1.99+. Includes a connect wizard, OS-keychain password storage, and a status bar item.
The VS Code extension auto-registers the npm-based config into Claude Code and Claude Desktop on first run, so you don't need to maintain two configs.
Features
29 tools covering the full ABAP development lifecycle: read, search, deploy, DDIC primitives, framework helpers (OData publish, BP creation), RAP, transactions, condition data.
Read tools (7)
| Tool | What it does |
| ---------------------- | --------------------------------------------------------------- |
| sap_ping | Test the ADT connection. |
| sap_sql | Run an ABAP-SQL SELECT on any table. |
| sap_table_info | DDIC structure of a table. |
| sap_read_object | Read source of PROG / CLAS / INTF / FUGR / DDLS. |
| sap_search_objects | Repository search with type filter. |
| sap_list_package | List all objects in an ABAP package. |
| sap_syntax_check | Run the ADT syntax/semantic check. |
Write tools — Core (5)
| Tool | What it does |
| ---------------------- | --------------------------------------------------------------- |
| sap_deploy_program | Create or update an ABAP report. Idempotent. |
| sap_deploy_class | Create or update an ABAP class. |
| sap_activate | Activate one object. |
| sap_delete_object | Delete an object. |
| sap_run_abap | Run an ABAP snippet via if_oo_adt_classrun. |
Write tools — DDIC primitives (8)
| Tool | What it does |
| ---------------------- | --------------------------------------------------------------- |
| sap_create_table | DDIC transparent table. Auto-prepends MANDT. |
| sap_create_struct | Standalone DDIC structure (tabclass=INTTAB). |
| sap_create_append | Append structure attached to an existing parent table. |
| sap_create_domain | DDIC Domain with optional fixed values + intervals. |
| sap_create_dtel | DDIC Data Element referencing an existing domain. |
| sap_create_shlp | Elementary Search Help (selection method = table/view). |
| sap_create_enqu | Lock Object wrapping a primary table with key fields. |
| sap_create_view | Classic DDIC projection view (single base table). |
Write tools — Framework helpers (4)
| Tool | What it does |
| ---------------------- | --------------------------------------------------------------- |
| sap_create_msag | Message Class (MSAG) with bulk message list. |
| sap_create_bp | Business Partner via BAPI_BUPA_CREATE_FROM_DATA + roles. |
| sap_create_tcode | Transaction code (TSTC/TSTCT). Idempotent. |
| sap_publish_odata | Register OData service in Gateway hub (/IWFND/MAINT_SERVICE). |
Write tools — RAP (3)
| Tool | What it does |
| ---------------------- | --------------------------------------------------------------- |
| sap_deploy_ddls | CDS view (DDLS). |
| sap_deploy_bdef | Behavior Definition (BDEF) for RAP. |
| sap_deploy_srvd | Service Definition (SRVD). |
| sap_deploy_srvb | Service Binding (SRVB). |
Write tools — Data (2)
| Tool | What it does |
| ---------------------- | --------------------------------------------------------------- |
| sap_insert_rows | Bulk-insert rows via internal table + INSERT FROM TABLE. |
Toggle SAP ABAP: Toggle Read-Only Mode to hide all write tools from Copilot.
Requirements
Shared (both install paths):
- An on-premise SAP NetWeaver / S/4HANA system with the ADT service path
/sap/bc/adtactive (SICF) and HTTPS enabled (SMICM) - A development user with
S_DEVELOP(or equivalent) authorizations - Network reachability to the SAP host (VPN if it's an internal IP)
Path A (standalone, npm): Node.js 18+ on the machine running your MCP
client (Claude Desktop, Claude Code, Cursor). npx ships with Node.
Path B (VS Code extension): VS Code 1.99+ (native MCP support landed in that release). Node.js is bundled with VS Code; no separate install needed.
Install
Pick the path that matches your client. They aren't mutually exclusive — the npm package and the VS Code extension run the same MCP server and can coexist on one machine.
A. Standalone (Claude Desktop / Claude Code / Cursor)
No VS Code required. Add the server to your client's MCP config — npm resolves the binary on first spawn.
Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS), %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"sap-abap": {
"command": "npx",
"args": ["-y", "sap-abap-mcp"],
"env": {
"SAP_HOST": "https://sap.example.com:44300",
"SAP_CLIENT": "100",
"SAP_USER": "DEVUSER",
"SAP_PASSWORD": "<password>",
"SAP_LANG": "EN",
"SAP_VERIFY_SSL": "false",
"SAP_READONLY": "false",
"SAP_TIMEOUT": "30"
}
}
}
}Then fully quit Claude Desktop (Cmd+Q on macOS, not just close the window) and reopen.
Claude Code (CLI) — register once:
claude mcp add sap-abap -- npx -y sap-abap-mcpSet the SAP_* env vars in ~/.claude.json or your shell profile.
If npx isn't on your client's PATH (common when launching Claude Desktop
from the macOS Dock), substitute the absolute path:
/opt/homebrew/bin/npx on Apple Silicon, /usr/local/bin/npx on Intel
macOS or Linux.
Why npx -y: the package is resolved by npm at every spawn (cached
after the first run, ~100 KB compressed tarball, no native deps). Future
versions ship automatically — your config never points at a stale
.vscode/extensions/...mcp-server.js path.
B. VS Code extension
For GitHub Copilot Chat or Cursor running inside VS Code 1.99+.
curl -L -o /tmp/sap-abap-mcp.vsix \
https://github.com/Lomtech/sap-abap-mcp/releases/latest/download/sap-abap-mcp.vsix
code --install-extension /tmp/sap-abap-mcp.vsixOr manually from
Releases:
download the .vsix, then in VS Code Cmd+Shift+P → Extensions: Install
from VSIX... → pick the file.
After install: Cmd+Shift+P → SAP ABAP: Connect to System. The wizard
stores the password in OS keychain and offers to register the MCP server
with any detected Claude Code / Claude Desktop installation (using the
npx-based config above, so the registration survives extension upgrades).
Updating
- npm package: nothing to do —
npxpicks up new versions automatically. - VS Code extension: download the new
.vsixand reinstall. The extension auto-rewrites any pre-0.4.0 Claude configs to the npx shape on next activation.
Quick start
Standalone (Path A):
- Drop the JSON block into your client's config (see Install A) with your SAP credentials.
- Fully quit and restart the client.
- Ask: "Ping my SAP system." — should return the mandant and T000 description.
VS Code (Path B):
- Install the
.vsix(see Install B). Cmd+Shift+P→ SAP ABAP: Connect to System.- Enter host, client, user, password. Password lands in OS keychain via
VS Code's
SecretStorageAPI — never plain text. - Reload Copilot Chat. The MCP tools appear under the "SAP ABAP MCP" provider.
- Ask Copilot: "Ping my SAP system."
Smoke-test the npm package from the command line
If you want to verify the published sap-abap-mcp npm package runs on
your machine (independent of any MCP client), run this from a directory
other than this repo's source checkout — see the warning below:
cd /tmp # any directory that is NOT the sap-abap-mcp source repo
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}' \
| SAP_HOST="https://sap.example.com:44300" SAP_CLIENT="800" \
SAP_USER="YOURUSER" SAP_PASSWORD="yourpassword" SAP_VERIFY_SSL=false \
npx -y sap-abap-mcpExpected output (single line):
{"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{}},"serverInfo":{"name":"sap-abap-mcp","version":"0.1.0"}},"jsonrpc":"2.0","id":1}⚠️ Why "not in the source repo": the source repo's own
package.jsondeclares"name": "sap-abap-mcp", sonpxinside that directory tries to resolve the local package instead of fetching from the registry. Since the local repo has nonode_modules/.bin/linkage for its own bin entry, you getsh: sap-abap-mcp: command not found. Running from/tmp(or any other directory) avoids the name-shadowing andnpxcleanly downloads + executes the published package. This is a quirk of npm's resolution, not a bug in the package. Real MCP clients (Claude Desktop, Claude Code, Cursor) spawn from their own working directory and never hit this.
VS Code extension commands
All available from the command palette (⇧⌘P / Ctrl+Shift+P) — these
apply only to Path B (the VS Code extension):
- SAP ABAP: Connect to System... — Run the 4-step setup wizard.
- SAP ABAP: Test Connection — Verify creds work without leaving VS Code.
- SAP ABAP: Toggle Read-Only Mode — Hide/show write tools.
- SAP ABAP: Show Connection Status — Open a read-only summary view.
- SAP ABAP: Register MCP with Claude Code & Desktop — Push the npx-based config into detected Claude clients without re-running the full wizard.
- SAP ABAP: Disconnect (clear credentials) — Remove host, user, and password from settings + keychain.
A status-bar item on the right shows the current connection at a glance
($(database) SAP: user@host or [RO] when read-only is on).
Configuration
The server reads its config from environment variables — the same set regardless of install path:
| Variable | Required | Default | Notes |
| ----------------- | -------- | ------- | -------------------------------------------------------------- |
| SAP_HOST | yes | — | Full ADT base URL, e.g. https://sap.example.com:44300. HTTPS.|
| SAP_CLIENT | no | 100 | Mandant. |
| SAP_USER | yes | — | ABAP user name. |
| SAP_PASSWORD | yes | — | ABAP password. |
| SAP_LANG | no | EN | Logon language. |
| SAP_VERIFY_SSL | no | false | Set true only if your system has a trusted cert chain. |
| SAP_READONLY | no | false | When true, write tools are hidden. Recommended for prod. |
| SAP_TIMEOUT | no | 30 | HTTP timeout in seconds. |
Path A (standalone): set them in the env block of your client's
MCP config (Claude Desktop JSON, ~/.claude.json, etc.).
Path B (VS Code): edit sapAbapMcp.* settings via Settings UI; the
extension translates them into the env vars above when spawning the
subprocess. Sensitive values (password) live in OS keychain via
SecretStorage, not settings.json.
| VS Code setting | Maps to env var |
| ------------------------ | -------------------- |
| sapAbapMcp.host | SAP_HOST |
| sapAbapMcp.client | SAP_CLIENT |
| sapAbapMcp.user | SAP_USER |
| sapAbapMcp.language | SAP_LANG |
| sapAbapMcp.verifySsl | SAP_VERIFY_SSL |
| sapAbapMcp.readOnly | SAP_READONLY |
| sapAbapMcp.timeout | SAP_TIMEOUT |
| (keychain) | SAP_PASSWORD |
Security notes
- Path A stores the password in plain text inside the Claude Desktop /
Claude Code JSON config. There is no keychain integration for those
clients. Tighten file permissions:
chmod 600 ~/Library/Application\ Support/Claude/claude_desktop_config.json. - Path B uses the OS keychain (macOS Keychain / Windows Credential
Manager / Linux libsecret) via VS Code's
SecretStorageAPI. Password never lands insettings.json. - In both paths the MCP server subprocess receives credentials via env vars at spawn time. They are not logged.
sap_sqlrejects any statement that isn't aSELECT/WITH.- Write tools can be globally disabled by setting
SAP_READONLY=true(Path A) or togglingsapAbapMcp.readOnly(Path B). - TLS verification defaults to off because most on-prem SAP systems
use self-signed certs. Set
SAP_VERIFY_SSL=trueonly with a trusted cert chain. - Always test against a development or sandbox system first. Create / update / delete on production SAP development objects is irreversible without a transport-request rollback.
Server-side prerequisites (one-time, Basis admin)
| Check | Where |
| ------------------------------------------- | ------------------------------------------- |
| SICF service /sap/bc/adt active | Transaction SICF, activate with sub-nodes |
| HTTPS service running | Transaction SMICM → Goto → Services |
| User has S_DEVELOP | Transaction SU01 |
Troubleshooting
| Symptom | Likely cause |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| Tools don't appear in Claude Desktop after JSON edit | Didn't fully quit Claude Desktop (Cmd+Q on macOS). Closing the window isn't enough. |
| spawn npx ENOENT in Claude Desktop logs | npx not on the GUI app's PATH. Use absolute path: /opt/homebrew/bin/npx (or wherever). |
| First spawn hangs ~30s | npx is fetching the package. Cached after this, subsequent starts are instant. |
| sap-abap-mcp: missing environment variables: SAP_HOST… | env block in your client config missing required vars. |
| Status bar shows "not configured" (Path B) | Run SAP ABAP: Connect to System. |
| Connection timed out | VPN not connected, or wrong host/port. |
| HTTP 401 | Wrong user/password, or user is locked. |
| HTTP 403 CSRF token validation failed | Using HTTP instead of HTTPS. |
| HTTP 403 Service cannot be reached | SICF /sap/bc/adt not active. |
| Tools don't appear in Copilot Chat | Reload window after first configuration. |
| Warning: "VS Code 1.99+ is required" | Update VS Code; MCP API isn't available yet. |
Development
git clone https://github.com/Lomtech/sap-abap-mcp.git
cd sap-abap-mcp
npm install
npm run typecheck # tsc -p . --noEmit
npm run compile # esbuild → out/extension.js + out/mcp-server.js
npm run package # vsce package → .vsix
npm test # tests/smoke.mjs against live SAP (skips without SAP_HOST)To run the extension in a development window: press F5 inside VS Code with
this folder open. A new Extension Host window opens with the extension
loaded.
Releasing
The same artifact stream produces two distributions:
| Artifact | Distribution | Trigger |
| --- | --- | --- |
| out/mcp-server.js (bundled) | npm: sap-abap-mcp | npm publish |
| sap-abap-mcp-<version>.vsix | GitHub Release asset | npm run package + gh release create |
package.json files is a single allowlist consumed by both vsce
(for the .vsix) and npm (for the tarball). It includes out/extension.js
out/mcp-server.js+ CHANGELOG + LICENSE; everything else (tests, src, build config) stays in the repo for source-code consumers. npm auto-adds README and package.json on top. vsce demands one strategy at a time — either.vscodeignoreorfiles— so.vscodeignoreis intentionally absent.
out/extension.js ships to npm as dead weight (~70 KB) but is harmless:
the npm bin field points at out/mcp-server.js, and nothing in
extension.js is ever loaded outside VS Code.
To cut a release:
- Bump
versioninpackage.jsonand add aCHANGELOG.mdentry. npm run compile && npm run package— produces the .vsix.git commit -am "vX.Y.Z: …" && git tag vX.Y.Z && git push --tags.gh release create vX.Y.Z sap-abap-mcp-X.Y.Z.vsix --generate-notes.npm publish— pushes the sameout/mcp-server.jsto npm.
Why this exists
ABAP developers are increasingly using VS Code (SAP themselves are shipping "ABAP Development Tools for VS Code" in 2026). This server fills the gap left by SAP's official tooling for AI-assisted ABAP work: it gives any MCP-aware client — Claude Desktop, Claude Code, Copilot Chat, Cursor — direct, structured access to your SAP system's repository, source code, and development surface.
It is intentionally generic: no business logic, no system-specific hostnames or users, no customer code. Point it at your system, get to work.
License
Apache 2.0. Drop a copy of the standard Apache 2.0 text into LICENSE in
this folder. (Not included here to keep the repo free of vendored license
boilerplate.)
