Sign inSign up

irfanardi/mcpabapaccelerator

By irfanardi

•Updated about 1 month ago

MCP SAP S/4HANA || ECC connector for AI

Image
Developer tools
1

10K+

irfanardi/mcpabapaccelerator repository overview

⁠ABAP Accelerator MCP Server

MCP (Model Context Protocol) server that connects AI coding assistants — Kiro, Claude Desktop, VS Code, Amazon Q Developer, and other MCP-compatible clients — directly to your SAP system (ECC or S/4HANA) over the SAP ADT (ABAP Development Tools) REST API.

It lets an AI assistant read, write, check, and activate ABAP objects, browse the DDIC data model, inspect enhancements/BAdIs, and run read-only data previews — all through natural conversation instead of manually switching between SAP GUI, Eclipse ADT, and your editor.


⁠How it works

+------------------------+
|  MCP Client            |
|  (Kiro / Claude /      |
|   VS Code / Q Dev)     |
+-----------+------------+
            |  MCP protocol (HTTP, streamable)
            v
+------------------------+
|  ABAP Accelerator      |
|  MCP Server (Docker)   |
+-----------+------------+
            |  SAP ADT REST API (HTTPS)
            v
+------------------------+
|  SAP ECC / S/4HANA     |
+------------------------+

The server runs as a single Docker container exposing an HTTP MCP endpoint (default http://localhost:8000/mcp). It authenticates to SAP using Basic Auth (username/password) over the ADT REST API — no RFC/SAPGUI connectivity is required, only HTTPS access to the SAP host's ICM port (typically 443<instance>, e.g. 44300 for instance 00).


⁠Quick Start (Docker)

⁠1. Pull the image
docker pull irfanardi/mcpabapaccelerator:latest

The image is multi-arch (linux/amd64 and linux/arm64), so it runs natively on both Intel/AMD machines and Apple Silicon / ARM.

⁠2. Run the container
docker run -d \
  --name abap-mcp \
  --restart unless-stopped \
  -p 8000:8000 \
  -e CREDENTIAL_PROVIDER=env \
  -e SAP_HOST=your-sap-host.example.com \
  -e SAP_INSTANCE_NUMBER=00 \
  -e SAP_CLIENT=100 \
  -e SAP_USERNAME=YOUR_SAP_USER \
  -e SAP_PASSWORD='YOUR_SAP_PASSWORD' \
  -e SAP_SYSTEM_ID=YOUR_SID \
  -e SAP_LANGUAGE=EN \
  -e SSL_VERIFY=false \
  -e MCP_ROLE=dev \
  irfanardi/mcpabapaccelerator:latest

MCP_ROLE controls which tools the container exposes — set it to match how you intend to use the server:

MCP_ROLEUse it when...Behavior
dev (shown above)You're actively developing/fixing ABAP code with the assistantAll 43 tools are registered, including create/update/activate/transport tools.
prod (also accepted: production, readonly, ro, display)You only want the assistant to explore/read — e.g. a shared or production-adjacent systemWrite/edit tools (abap_cb_create_object, abap_cb_update_source, abap_cb_activate_object, abap_cb_activate_objects_batch, abap_cb_create_or_update_test_class, abap_cb_create_transport_request, abap_cb_assign_transport, abap_cb_create_package) are not registered at all — the client can't see or call them, not even by mistake. Read/preview tools (abap_cb_get_source, abap_cb_data_preview, abap_cb_get_table_info, etc.) remain fully available.

Run the same command as above but with -e MCP_ROLE=prod for a read-only instance:

docker run -d \
  --name abap-mcp-readonly \
  --restart unless-stopped \
  -p 8000:8000 \
  -e CREDENTIAL_PROVIDER=env \
  -e SAP_HOST=your-sap-host.example.com \
  -e SAP_INSTANCE_NUMBER=00 \
  -e SAP_CLIENT=100 \
  -e SAP_USERNAME=YOUR_SAP_USER \
  -e SAP_PASSWORD='YOUR_SAP_PASSWORD' \
  -e SAP_SYSTEM_ID=YOUR_SID \
  -e SAP_LANGUAGE=EN \
  -e SSL_VERIFY=false \
  -e MCP_ROLE=prod \
  irfanardi/mcpabapaccelerator:latest

You can run both a dev and a prod container side by side (different names, different host ports) if you want separate connections for exploration-only vs. active development.

Wait a few seconds, then confirm it's healthy:

docker ps --filter name=abap-mcp
# STATUS should show "healthy"

docker logs abap-mcp --tail 20
⁠3. Point your MCP client at it

The config file location and JSON shape differ per client. Both connect to the same running container — only the config format changes.

⁠Kiro

File: .kiro/settings/mcp.json (workspace-level) or ~/.kiro/settings/mcp.json (user-level, applies to all workspaces).

{
  "mcpServers": {
    "abap-accelerator": {
      "url": "http://localhost:8000/mcp",
      "disabled": false,
      "autoApprove": [
        "abap_cb_get_source",
        "abap_cb_connection_status",
        "abap_cb_search_object",
        "abap_cb_data_preview"
      ]
    }
  }
}

Create the file (and .kiro/settings/ folder) if it doesn't exist yet. After saving, open the MCP Servers panel in Kiro and enable/reconnect abap-accelerator — Kiro watches this file, but a manual reconnect is the most reliable way to pick up a newly added or edited server, especially after the container itself was restarted.

autoApprove is optional — it lists tool names Kiro can call without prompting for confirmation each time. Leave it as [] (or omit it) if you want to approve every call manually.

⁠VS Code (MCP extension / Copilot Chat MCP support)

File: .vscode/mcp.json in the workspace, or your global MCP settings depending on the extension you use. The key difference from Kiro is the top-level key (servers instead of mcpServers) and the explicit "type": "http":

{
  "servers": {
    "abap-accelerator": {
      "type": "http",
      "url": "http://localhost:8000/mcp"
    }
  }
}

Reload the window (or use the extension's "Restart/Reconnect MCP Server" command) after adding or changing this file.

⁠Claude Desktop

Claude Desktop's config only supports stdio-launched MCP servers out of the box (command/args), not a raw HTTP URL like this server exposes. To use it there, run the container as above and bridge it with an HTTP-to-stdio proxy such as mcp-remote:

{
  "mcpServers": {
    "abap-accelerator": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:8000/mcp"]
    }
  }
}

Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).

⁠Verifying the connection

Whichever client you use, once it's connected, ask it to check the SAP connection — it should call abap_cb_connection_status and report Connected.

⁠Alternative: interactive helper script

If you're running from this repository's source, run-abap-accelerator.sh walks you through the same setup interactively (prompts for host/client/user/password, starts the container, verifies the SAP connection, and prints the ready-to-paste MCP config block):

./run-abap-accelerator.sh
⁠Alternative: Docker Compose
services:
  abap-accelerator:
    image: irfanardi/mcpabapaccelerator:latest
    container_name: abap-accelerator
    restart: unless-stopped
    ports:
      - "8000:8000"
    environment:
      CREDENTIAL_PROVIDER: "env"
      SAP_HOST: "your-sap-host.example.com"
      SAP_INSTANCE_NUMBER: "00"
      SAP_CLIENT: "100"
      SAP_USERNAME: "YOUR_SAP_USER"
      SAP_PASSWORD: "YOUR_SAP_PASSWORD"
      SAP_SYSTEM_ID: "YOUR_SID"
      SAP_LANGUAGE: "EN"
      SSL_VERIFY: "false"
      MCP_ROLE: "dev"
docker compose up -d
docker compose logs -f
docker compose down

⁠Configuration Reference

⁠Required
VariableDescriptionExample
SAP_HOSTSAP application server hostname or IPvhcalnplci.example.com
SAP_INSTANCE_NUMBERSAP instance number00
SAP_CLIENTSAP client (mandant)100
SAP_USERNAMESAP username (dialog user with ADT/S_DEVELOP authorization)DEV_USER
SAP_PASSWORDSAP password—
SAP_SYSTEM_IDLogical system ID, used as the default sap_system_id context and in multi-tenant headersDEV
SAP_LANGUAGESAP logon languageEN
⁠Optional
VariableDefaultDescription
CREDENTIAL_PROVIDERinteractiveenv = read SAP_* vars above; interactive = prompt at startup; interactive-multi = load multiple systems from a YAML file; aws_secrets = AWS Secrets Manager
SAP_PORTderived from SAP_INSTANCE_NUMBER (443<NN>)Override the SAP HTTPS port explicitly
SSL_VERIFYtrueSet false for self-signed/expired SAP server certificates (testing only)
MCP_ROLEdevdev = all 43 tools enabled; prod/readonly/ro/display = write/activate tools are hidden, read-only tools remain available
MCP_SERVER_NAME—Friendly name reported by the server, useful when running multiple instances
SERVER_PORT8000Port the server listens on inside the container
ENABLE_ENTERPRISE_MODEtrueEnables multi-tenancy / per-request SAP system context via headers
DEFAULT_SAP_SYSTEM_ID—Default system used when a request doesn't specify sap_system_id
⁠Multi-system setup

Each request can target a different SAP system by passing an x-sap-system-id header (or the sap_system_id tool argument), resolved against systems configured via CREDENTIAL_PROVIDER=interactive-multi and a sap-systems.yaml file, or aws_secrets in production/ECS deployments.


⁠Security Notes

  • Never bake SAP_PASSWORD into the Docker image. Pass it at runtime via -e / Compose / a secrets manager.
  • Prefer a dedicated SAP service user scoped to what the assistant needs (development client, S_DEVELOP and ADT-related authorizations), not a personal or administrator account.
  • Run with MCP_ROLE=prod on any system where you want the assistant to browse/read but never write, activate, or create transports.
  • Set SSL_VERIFY=true and use a valid certificate for anything beyond local testing.
  • The MCP endpoint itself has no built-in authentication — anyone who can reach http://localhost:8000/mcp can invoke tools with the container's configured SAP credentials. Bind it to localhost only, or place it behind your own reverse proxy/auth layer, before exposing it on a shared network.

⁠What can this MCP do?

The server exposes 43 tools, all prefixed abap_cb_, covering the full loop of exploring, understanding, writing, and validating ABAP code plus its surrounding metadata. In MCP_ROLE=prod (read-only) mode, only the tools marked ✅ below are available; tools marked 🔒 are disabled.

⁠Connection & discovery
ToolWhat it does
✅ abap_cb_connection_statusCheck whether the server is connected to SAP, and to which host/client/user.
✅ abap_cb_get_objectsList ABAP objects inside a package.
✅ abap_cb_search_objectSearch for ABAP objects by name/pattern, optionally filtered by type or package.
⁠Reading & editing ABAP source
ToolWhat it does
✅ abap_cb_get_sourceRead the source code of any ABAP object (class, program, include, function module, etc.).
✅ abap_cb_get_program_includesRead a program and recursively resolve all its INCLUDEs (nested), returning the include tree plus every include's source.
🔒 abap_cb_create_objectCreate a new ABAP object (class, interface, program, etc.).
🔒 abap_cb_update_sourceUpdate the source code of an existing object.
✅ abap_cb_check_syntaxRun a syntax check against an object (or arbitrary source) without saving.
🔒 abap_cb_activate_objectActivate a single ABAP object.
🔒 abap_cb_activate_objects_batchActivate multiple objects together (needed for circular dependencies).
✅ abap_cb_check_object_lockCheck whether an object currently has an edit lock (SM12-style) and who holds it, before attempting an update.
⁠Code navigation
ToolWhat it does
✅ abap_cb_where_usedFind where an object — or a specific position such as a method — is used/called. Supports method-level where-used.
✅ abap_cb_get_object_structureGet the outline of a class/interface: its methods and attributes.
✅ abap_cb_find_fieldFind where a field (including custom fields added via append/include, e.g. ZBRTU) is defined across all tables/structures, and resolve its data element + domain + fixed values in one call.
⁠Testing & quality
ToolWhat it does
✅ abap_cb_run_atc_checkRun an ABAP Test Cockpit (ATC) quality check on an object or package.
✅ abap_cb_run_unit_testsRun ABAP Unit tests for a class, optionally with code coverage.
✅ abap_cb_get_test_classesRetrieve the test classes associated with a given class.
🔒 abap_cb_create_or_update_test_classCreate or update an ABAP Unit test class and its test methods.
✅ abap_cb_get_migration_analysisGet a migration/compatibility analysis for an object (e.g. S/4HANA readiness).
⁠Interfaces, function groups & modules (RFC/BAPI signatures)
ToolWhat it does
✅ abap_cb_get_interfacesList ABAP interfaces, optionally filtered by package.
✅ abap_cb_get_interface_infoGet an interface's methods, events, types, and constants.
✅ abap_cb_get_function_groupsList function groups, optionally filtered by package.
✅ abap_cb_get_function_group_infoGet a function group's function modules and includes.
✅ abap_cb_get_function_modulesList the function modules inside a function group.
✅ abap_cb_get_function_module_infoGet a function module's full signature — IMPORTING/EXPORTING/CHANGING/TABLES parameters and EXCEPTIONS — essential for calling RFCs/BAPIs correctly.
⁠Enhancements, exits & BAdIs
ToolWhat it does
✅ abap_cb_get_enhancementsList enhancements/exits (BAdI implementations, enhancement implementations, source code plugins), filterable by type or package.
✅ abap_cb_get_enhancement_infoGet details of a specific enhancement/exit — type, spot, BAdI definition, implementing class, filter values, active status.
✅ abap_cb_get_enhancement_sourceGet the source code of a source-code-plugin-style enhancement.
✅ abap_cb_get_enhancement_spotsList enhancement spots / BAdI definition spots, to discover where custom logic can be plugged in.
⁠Service bindings (OData/REST)
ToolWhat it does
✅ abap_cb_get_service_binding_infoInspect a service binding (SRVB) — binding type, service definition, and the published OData/REST endpoint URL.
⁠Data dictionary (DDIC) exploration
ToolWhat it does
✅ abap_cb_get_tablesList DDIC database tables, optionally filtered by package.
✅ abap_cb_get_table_infoGet a table's fields, types, and keys — the starting point for writing any SELECT/JOIN.
✅ abap_cb_get_table_append_fields (dev only)List all fields of a table including those added via append structures / customer includes (e.g. CI_EKKODBX), which don't appear in the plain DDL source.
✅ abap_cb_get_data_elementsList data elements, optionally filtered by package.
✅ abap_cb_get_data_element_infoGet a data element's domain, type, length, and decimals.
✅ abap_cb_get_domainsList domains, optionally filtered by package.
✅ abap_cb_get_domain_infoGet a domain's type, length, value table, and fixed values — useful for building correct WHERE-clause filters.
✅ abap_cb_get_structuresList DDIC structures, optionally filtered by package.
✅ abap_cb_get_structure_infoGet a structure's field list.
⁠Data preview (read-only SQL)
ToolWhat it does
✅ abap_cb_data_previewRun a read-only ABAP SQL query (SELECT/WITH only) against SAP and return sample rows (1–1000, default 100). Any data-modifying statement (INSERT, UPDATE, DELETE, MODIFY, DROP, ALTER, CREATE, COMMIT, ROLLBACK, CALL) is rejected before it ever reaches SAP.
⁠Packages & transports
ToolWhat it does
✅ abap_cb_get_packagesList packages (root packages, or subpackages of a given parent).
✅ abap_cb_get_package_infoGet details of a package (type, software component, super package, etc.).
🔒 abap_cb_create_packageCreate a new development package.
✅ abap_cb_get_transport_requestsList transport requests, optionally filtered by user.
🔒 abap_cb_create_transport_requestCreate a new transport request (Workbench or Customizing).
🔒 abap_cb_assign_transportAssign an ABAP object to a transport request.

⁠Typical workflows

Understand and extend an existing program

  1. abap_cb_search_object → find the program/class.
  2. abap_cb_get_source (+ abap_cb_get_program_includes if it has includes) → read it.
  3. abap_cb_where_used → check impact before changing anything.
  4. abap_cb_check_object_lock → confirm nobody else has it locked.
  5. abap_cb_update_source → apply the change.
  6. abap_cb_check_syntax / abap_cb_activate_object → validate and activate.
  7. abap_cb_run_unit_tests / abap_cb_run_atc_check → verify quality.

Design a new report/query

  1. abap_cb_search_object / abap_cb_get_tables → find the relevant tables or CDS views.
  2. abap_cb_get_table_info → understand fields, types, and keys.
  3. abap_cb_get_data_element_info / abap_cb_get_domain_info → understand field semantics and valid values.
  4. abap_cb_data_preview → validate the proposed query against real data, read-only.

Investigate a custom field or enhancement

  1. abap_cb_find_field → locate a custom field (e.g. ZBRTU) and its data element/domain, even if it lives in an append structure.
  2. abap_cb_get_enhancements / abap_cb_get_enhancement_info / abap_cb_get_enhancement_source → find and read the BAdI/exit logic that populates or uses it.

⁠Troubleshooting

"Failed to connect to SAP system ..."

  • Verify SAP_HOST, SAP_INSTANCE_NUMBER (or SAP_PORT), SAP_CLIENT, SAP_USERNAME, SAP_PASSWORD.
  • Confirm the host is reachable from wherever the container runs (curl -k https://<host>:<port>/sap/bc/adt/discovery).
  • If the SAP server uses a self-signed/expired certificate, set SSL_VERIFY=false (testing only).

MCP client shows the server as connected but tools return "Session not found" or similar

  • This happens if the container was restarted after the MCP client already opened a session. Reconnect/re-enable the server in your MCP client so it re-initializes a fresh session.

Syntax check reports a generic error for a program that is clearly valid

  • Make sure you're running the latest image — an earlier version had a bug where the syntax-check call always requested the object's "inactive" version, which fails for objects with no pending changes. This is fixed by trying the "active" version first.

Container exited unexpectedly

  • docker logs abap-mcp for the stack trace. Common causes: wrong/missing required env var, or SAP host unreachable at startup depending on credential provider mode.

⁠License

MIT License. See LICENSE for details.

Tag summary

Content type

Image

Digest

sha256:efc9a53bb…

Size

100.5 MB

Last updated

about 1 month ago

docker pull irfanardi/mcpabapaccelerator