Skip to content
Back to search

mcp-abap-adt

MCP server for SAP BTP ABAP Cloud and On-Premise ECC/S/4HANA ABAP ADT with full CRUD, JWT/XSUAA, and service-key auth.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/fr0ster/mcp-abap-adt with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/fr0ster/mcp-abap-adt'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/fr0ster--mcp-abap-adt/badge.svg)](/listings/fr0ster--mcp-abap-adt)

HTML

<a href="/listings/fr0ster--mcp-abap-adt"><img src="/api/listings/fr0ster--mcp-abap-adt/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Pick a variant first — full or compact server, and HTTP, RFC or SNC to the system. HTTP needs nothing but Node.js 22 or 24; **RFC and SNC need the SAP NW RFC SDK and a C++ toolchain on the machine before `npm install`**, because the RFC module is compiled during the install and silently left out when it cannot be. [Installation variants](docs/installation/INSTALLATION.md#installation-variants) has the table and the commands; [RFC Setup](docs/installation/RFC_SETUP.md) the steps. To run without Node.js on a machine, build your own [portable executable](docs/installation/PORTABLE.md) — Node.js and your SAP NW RFC SDK inside.

Install the server and configure your client using the configurator:

npm install -g @mcp-abap-adt/core
npm install -g @mcp-abap-adt/configurator

# stdio (destination)
mcp-conf --client cline --name abap --mcp TRIAL

# HTTP (streamable HTTP)
mcp-conf --client copilot --name abap --transport http --url http://localhost:3000/mcp/stream/http --mcp trial

Full configurator usage (separate repo): [CLIENT_INSTALLERS.md](https://github.com/fr0ster/mcp-abap-adt-conf/tree/main/docs/CLIENT_INSTALLERS.md).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 689 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # <img src="logo.png" alt="mcp-abap-adt logo" width="36" align="absmiddle" /> mcp-abap-adt: Your Gateway to ABAP Development Tools (ADT)
  2. [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
  3. `mcp-abap-adt` is an MCP server for ABAP ADT in SAP ECC/S/4HANA (on-premise) and SAP BTP ABAP Cloud systems. It gives agents controlled access to real ABAP repositories through ADT, so analysis and changes are grounded in system data instead of assumptions. It is built for AI-assisted pair programming (AIPNV: AI Pairing, Not Vibing), not autopilot vibe coding.
  4. **Primary workflows:**
  5. - **Deep ABAP analysis**: where-used, object metadata, repository navigation, object structure, semantic analysis, dependency and impact exploration.
  6. - **High-level ABAP development**: rapid CRUD and iterative updates for RAP and classic ABAP artifacts (classes, interfaces, function groups/modules, programs, DDIC, CDS/view/service artifacts), validated through ADT flows.
  7. **Why teams use it:**
  8. - **Full CRUD** (not read-only): create, read, update, and delete ABAP artifacts
  9. - Works with **On-Premise (ECC/S/4HANA)** and **ABAP Cloud (BTP)** systems
  10. - Legacy systems (BASIS < 7.50) are **not supported at present**: that support is parked on the `parked/legacy-support` branch until it can be tried against a live legacy system
  11. - Three authentications over stdio: **basic** (HTTP or RFC), **SNC** (passwordless, RFC), **JWT with browser login** (service key, ABAP or XSUAA); a **JWT you already hold** goes in the `x-sap-jwt-token` header of `mcp-abap-adt-http` / `mcp-abap-adt-sse`
  12. - Multiple transports: **stdio**, **HTTP**, **SSE**
  13. - Several installation variants: the **full** server (`@mcp-abap-adt/core`) or the **compact** one (`@mcp-abap-adt/compact`), each connecting to the system over **HTTP**, **RFC** or **SNC** — see [Installation variants](docs/installation/INSTALLATION.md#installation-variants)
  14. - Rich tool surface for ABAP objects, metadata, transports, and search
  15. **Authorization & Destinations (Important):** A *destination* is the filename of a service key stored locally. You place service keys in the service-keys directory, and use `--mcp=<destination>` to select which one to use. This is the primary auth model for on‑prem and BTP systems. See [Authentication & Destinations](docs/user-guide/AUTHENTICATION.md).
  16. You can configure MCP clients either manually (JSON/TOML) or via the configurator CLI (`@mcp-abap-adt/configurator`, repo: [`mcp-abap-adt-conf`](https://github.com/fr0ster/mcp-abap-adt-conf)).
  17. ## Table of Contents
  18. 1. [Getting Started](#getting-started)
  19. 2. [Architecture](#architecture)
  20. 3. [Quick Start](#quick-start)
  21. 4. [Use Cases](#use-cases)
  22. 5. [Target Users](#target-users)
  23. 6. [Capabilities (High-Level Focus)](#capabilities-high-level-focus)
  24. 7. [Terminology](#terminology)
  25. 8. [Authorization & Destinations](#authorization--destinations)
  26. 9. [Registries](#registries)
  27. 10. [Features](#features)
  28. 11. [Documentation](#documentation)
  29. 12. [Dependencies](#dependencies)
  30. 13. [Running the Server](#running-the-server)
  31. ## Getting Started
  32. Pick a variant first — full or compact server, and HTTP, RFC or SNC to the system. HTTP needs nothing but Node.js 22 or 24; **RFC and SNC need the SAP NW RFC library when the server runs** — SAP GUI's 64-bit `sapnwrfc.dll` on Windows, else the SAP NW RFC SDK; the RFC module comes prebuilt for Linux x64 (glibc), Windows x64 and macOS ARM64, and `npm install` compiles nothing. [Installation variants](docs/installation/INSTALLATION.md#installation-variants) has the table and the commands; [RFC Setup](docs/installation/RFC_SETUP.md) the steps. To run without Node.js on a machine, build your own [portable executable](docs/installation/PORTABLE.md) — Node.js and your SAP NW RFC SDK inside.
  33. Install the server and configure your client using the configurator:
  34. ```bash
  35. npm install -g @mcp-abap-adt/core
  36. npm install -g @mcp-abap-adt/configurator
  37. # stdio (destination)
  38. mcp-conf --client cline --name abap --mcp TRIAL
  39. # HTTP (streamable HTTP)
  40. mcp-conf --client copilot --name abap --transport http --url http://localhost:3000/mcp/stream/http
  41. ```
  42. Full configurator usage (separate repo): [CLIENT_INSTALLERS.md](https://github.com/fr0ster/mcp-abap-adt-conf/tree/main/docs/CLIENT_INSTALLERS.md).
  43. ## Terminology
  44. **Destination**: a local service key filename. You store service keys in the standard `service-keys` directory, and pass the filename (without extension) via `--mcp=<destination>` to select which system to use.
  45. See [docs/user-guide/TERMINOLOGY.md](docs/user-guide/TERMINOLOGY.md) for the full list.
  46. ## Authorization & Destinations
  47. Destination-based auth is the default. Drop service keys into the standard platform folder and use the filename as your destination:
  48. ```bash
  49. mcp-abap-adt --mcp=TRIAL --system-type=cloud
  50. ```
  51. Standard service key paths:
  52. - Unix (Linux/macOS): `~/.config/mcp-abap-adt/service-keys/<destination>.json`
  53. - Windows: `%USERPROFILE%\\Documents\\mcp-abap-adt\\service-keys\\<destination>.json`
  54. `mcp-abap-adt` (stdio) supports exactly three authentications, each a destination stated in a service key, a `.env`, or both; a JWT you hold is sent in headers to the HTTP or SSE server:
  55. | Authentication | `.env` keys |
  56. |----------------|-------------|
  57. | Basic (HTTP or RFC) | `SAP_AUTH_TYPE=basic`, `SAP_USERNAME`, `SAP_PASSWORD` |
  58. | SNC (RFC only, passwordless) | `SAP_AUTH_TYPE=snc`, `SAP_SNC_PARTNERNAME`, optional `SAP_SNC_QOP`, `SAP_SNC_LIB`, `SAP_SNC_MYNAME` — no user, no password |
  59. | JWT, browser login | `SAP_AUTH_TYPE=jwt`, `SAP_GRANT_TYPE=authorization_code`, a service key (ABAP or XSUAA) or `SAP_UAA_*` |
  60. | JWT you hold | the `x-sap-jwt-token` header of `mcp-abap-adt-http` / `mcp-abap-adt-sse` (stdio serves none) |
  61. A `jwt` `.env` must state `SAP_GRANT_TYPE`. The `mcp-auth` command that writes such a `.env` comes from
  62. `@mcp-abap-adt/auth-broker-cli`. The browser login listens on port `61001` unless `--browser-auth-port` says otherwise.
  63. A created object always carries its responsible person and, where known, its master system. The
  64. servers name them once per destination — its credentials and its ABAP system — when its connection
  65. is created, by the rules of `@mcp-abap-adt/responsible-rules`: the system's `systeminformation`
  66. answer (its user, its system id) wins, on-premise and on ABAP Cloud alike; a tool argument that
  67. names the value (a transport's `owner`, say) still states it for that call. When the system gives
  68. no information, ABAP Cloud is an error (`cloud_without_systeminformation` for a `404`, else
  69. `system_lookup_failed`); on-premise the responsible is `SAP_RESPONSIBLE` / `x-sap-responsible` if
  70. stated, else the login (`SAP_USERNAME`, `x-sap-login`), and the master system
  71. `SAP_MASTER_SYSTEM` / `x-sap-master-system` when stated; with no user at all the call is refused
  72. `system_user_unknown`, and a stdio start ends with exit `1`. A `401` is answered as it came. The
  73. library applies no rules unless an embedder passes them. See
  74. [Authentication & Destinations](docs/user-guide/AUTHENTICATION.md).
  75. Coming from 23.x? See the [24.0 migration note](docs/MIGRATION-24.0.md) — an RFC destination states its address (`SAP_ASHOST` and `SAP_SYSNR`, or the message-server keys), `SAP_CLIENT` and `SAP_LANGUAGE`, and no `SAP_URL`; over MCP two arguments become required (`CreateDomain`'s `package_name`, compact `HandlerCreate` `BEHAVIOR_IMPLEMENTATION`'s `behavior_definition`) and a few tools declare arguments their handlers already read; compact `HandlerSearch` and `HandlerWhereUsed` became `HandlerSystem`'s `search_object` and `where_used`, beside six reads compact did not have; an embedder writes a tool's `inputSchema` in zod, builds an entry with `defineTool`, calls it as `entry.call(context, args)` and registers it with `registerTool(server, entry)`.
  76. Coming from 22.x? See the [23.0 migration note](docs/MIGRATION-23.0.md) — `CreateProgram` no longer offers `include` (create an include with `CreateInclude`); an embedder registering the `./handlers` groups on its own `McpServer` states `systemType` (`SAP_SYSTEM_TYPE` is not read there), and `HandlerExporter` serves no background run and no debugger.
  77. Coming from 21.x? See the [22.0 migration note](docs/MIGRATION-22.0.md) — the tools, their enums and the object types each argument accepts are the declared system type's (onprem or cloud), inspection needs `--system-type` too, `function` / `func` are the function module, main types stand for their one code, `RunATC` on cloud offers no program, and `ValidateServiceBinding` requires `package_name`.
  78. Coming from 19.x? See the [20.0 migration note](docs/MIGRATION-20.0.md) — RFC on connection 19 and sap-rfc-lite 0.3.2: nothing compiled on install, a prebuilt binding for Linux x64, Windows x64 and macOS ARM64 only; over Streamable HTTP `state_handle` is an argument of every tool, and a long session keeps one SAP session across calls.
  79. Coming from 18.x? See the [19.0 migration note](docs/MIGRATION-19.0.md) — the server split into a
  80. package per transport and tool set, the system type required, the low set gone, the auth chain on
  81. 6.0. Coming from 17.x? See the [18.0 migration note](docs/MIGRATION-18.0.md) — the debugger's embedder surface moved to adt-clients 29, and a debugger start needs at least one breakpoint. From 16.x, the [17.0 note](docs/MIGRATION-17.0.md) first.
  82. For full details (paths, `.env`, direct headers), see [Authentication & Destinations](docs/user-guide/AUTHENTICATION.md).
  83. ## Architecture
  84. The project ships a **library and the servers** — and a compact variant of each server — because the two usage patterns want
  85. different licences. Embedding the tools in a network service should not drag in
  86. the obligations of a server that service never runs.
  87. | Package | Licence | What it is |
  88. |---|---|---|
  89. | [`@mcp-abap-adt/lib`](https://www.npmjs.com/package/@mcp-abap-adt/lib) | Apache-2.0 | The ADT tool handlers and the embeddable MCP server. No transport: the host supplies one. |
  90. | [`@mcp-abap-adt/core`](https://www.npmjs.com/package/@mcp-abap-adt/core) | AGPL-3.0-only | The standalone stdio server, `mcp-abap-adt`: one destination through the auth broker. Depends on the library. |
  91. | [`@mcp-abap-adt/http`](https://www.npmjs.com/package/@mcp-abap-adt/http) | AGPL-3.0-only | The Streamable HTTP server, `mcp-abap-adt-http`: credentials from each request's `x-sap-*` headers. |
  92. | [`@mcp-abap-adt/sse`](https://www.npmjs.com/package/@mcp-abap-adt/sse) | AGPL-3.0-only | The HTTP+SSE server, `mcp-abap-adt-sse`: credentials from the `x-sap-*` headers of each SSE connection's `GET`. |
  93. | [`@mcp-abap-adt/compact`](https://www.npmjs.com/package/@mcp-abap-adt/compact) | AGPL-3.0-only | The compact server over stdio, `mcp-abap-adt-compact`: one tool per operation, the object type in the arguments. `core`'s launcher and configuration (from `server-runtime`) with the compact tool set. |
  94. | [`@mcp-abap-adt/compact-http`](https://www.npmjs.com/package/@mcp-abap-adt/compact-http) | AGPL-3.0-only | The compact server over Streamable HTTP, `mcp-abap-adt-compact-http`: `http`'s launcher and configuration (from `server-runtime`) with the compact tool set. |
  95. | [`@mcp-abap-adt/compact-sse`](https://www.npmjs.com/package/@mcp-abap-adt/compact-sse) | AGPL-3.0-only | The compact server over HTTP+SSE, `mcp-abap-adt-compact-sse`: `sse`'s launcher and configuration (from `server-runtime`) with the compact tool set. |
  96. | [`@mcp-abap-adt/server-runtime`](https://www.npmjs.com/package/@mcp-abap-adt/server-runtime) | AGPL-3.0-only | The launch code of every server: the stdio, Streamable HTTP and SSE launchers and servers, and the destination layer. **No command of its own**: every server package depends on it, so it is installed with each server; you never install it yourself. |
  97. | [`@mcp-abap-adt/background-runs-memory`](https://www.npmjs.com/package/@mcp-abap-adt/background-runs-memory) | Apache-2.0 | The in-memory store of background runs (`IBackgroundRuns` of the library): the servers' store, for an embedder that keeps runs in its process. Every server package depends on it. |
  98. | [`@mcp-abap-adt/responsible-rules`](https://www.npmjs.com/package/@mcp-abap-adt/responsible-rules) | Apache-2.0 | The rules that name a call's responsible, user and system from `systeminformation` (`SystemContextRules` of the library), and the system type the binaries require. Every server package passes them; the library applies none, so an embedder opts in. |
  99. | [`@mcp-abap-adt/core-ro`](https://www.npmjs.com/package/@mcp-abap-adt/core-ro), [`http-ro`](https://www.npmjs.com/package/@mcp-abap-adt/http-ro), [`sse-ro`](https://www.npmjs.com/package/@mcp-abap-adt/sse-ro) | AGPL-3.0-only | The read-only servers, `mcp-abap-adt-ro`, `mcp-abap-adt-http-ro`, `mcp-abap-adt-sse-ro`: `core`'s, `http`'s and `sse`'s launcher with the readonly tools (with system and search), the background runs of the long reads, batch mode and, on stdio, the leftover-session list — nothing that changes the system: no high, run, trace-schedule, debugger, leftover-session logoff or resume tool. |
  100. | [`@mcp-abap-adt/compact-ro`](https://www.npmjs.com/package/@mcp-abap-adt/compact-ro), [`compact-http-ro`](https://www.npmjs.com/package/@mcp-abap-adt/compact-http-ro), [`compact-sse-ro`](https://www.npmjs.com/package/@mcp-abap-adt/compact-sse-ro) | AGPL-3.0-only | The read-only compact servers, `mcp-abap-adt-compact-ro`, `-compact-http-ro`, `-compact-sse-ro`: the 16 compact tools that change nothing, the background runs of the long reads, `HandlerBatch` and, on stdio, the leftover-session list. |
  101. | [`@mcp-abap-adt/compact-readonly-entries`](https://www.npmjs.com/package/@mcp-abap-adt/compact-readonly-entries), [`compact-modify`](https://www.npmjs.com/package/@mcp-abap-adt/compact-modify) | Apache-2.0 | The compact tools as libraries, split into the half that changes nothing and the half that writes (`compact-readonly-entries` was `compact-readonly` before 19.0.0). |
  102. Eighteen packages, twelve binaries: four kinds of binary — core, core-ro, compact, compact-ro — on
  103. each transport. **The binary fixes the tool set** (19.0.0; there is no `--exposition`): install the
  104. one for your transport and the tools you want to run a server — `@mcp-abap-adt/core`, `http` or
  105. `sse` (readonly, high, the debugger), their `-ro` packages (the readonly tools alone), `compact`,
  106. `compact-http`, `compact-sse`, or their `-ro` packages (the compact tools that change nothing).
  107. Install `@mcp-abap-adt/lib` to embed the tools in your own application. Every binary and its
  108. tools: [Handler sets](docs/user-guide/HANDLERS_MANAGEMENT.md).
  109. **Each server is installed on its own** (`npm install -g @mcp-abap-adt/compact`): a server
  110. package brings everything it runs on — `server-runtime`, `lib` and the rest — and depends on
  111. no other server package, so installing two servers, in one command or in two, is fine and
  112. neither needs the other. Since 19.2.0 a process that loads two copies of `@mcp-abap-adt/lib`
  113. anyway does not start: it prints `Two copies of @mcp-abap-adt/lib are loaded in this process
  114. (<copy>, <copy>): reinstall <package> (npm install -g <package>).` — each copy by its version
  115. and label, an earlier one as `a copy before 24.0.0` — and exits `1` — see
  116. [One `lib` per server process](docs/architecture/README.md#one-lib-per-server-process-1920).
  117. ### 1. Standalone MCP Server (Default)
  118. Run as a standalone MCP server; a binary is its transport (there is no `--transport` option):
  119. ```bash
  120. mcp-abap-adt --mcp=TRIAL --system-type=cloud # stdio (@mcp-abap-adt/core): one destination
  121. mcp-abap-adt-http --system-type=<onprem|cloud> # Streamable HTTP (@mcp-abap-adt/http): x-sap-* headers per request
  122. mcp-abap-adt-sse --system-type=<onprem|cloud> # SSE (@mcp-abap-adt/sse): x-sap-* headers per SSE connection
  123. mcp-abap-adt-compact --mcp=TRIAL --system-type=cloud # the compact tool set over stdio (@mcp-abap-adt/compact)
  124. mcp-abap-adt-compact-http --system-type=<onprem|cloud> # ... over Streamable HTTP (@mcp-abap-adt/compact-http)
  125. mcp-abap-adt-compact-sse --system-type=<onprem|cloud> # ... over SSE (@mcp-abap-adt/compact-sse)
  126. mcp-abap-adt-ro --mcp=TRIAL --system-type=cloud # the readonly tools alone over stdio (@mcp-abap-adt/core-ro)
  127. mcp-abap-adt-compact-ro --mcp=TRIAL --system-type=cloud # the compact tools that change nothing (@mcp-abap-adt/compact-ro)
  128. # (and -http-ro, -sse-ro, -compact-http-ro, -compact-sse-ro)
  129. ```
  130. ### 2. Embeddable Server (For Integration)
  131. Embed MCP server into existing applications (e.g., SAP CAP/CDS, Express).
  132. This needs `@mcp-abap-adt/lib` only — not the AGPL server:
  133. ```bash
  134. npm install @mcp-abap-adt/lib
  135. ```
  136. ```typescript
  137. import { EmbeddableMcpServer } from '@mcp-abap-adt/lib/embeddable';
  138. const server = new EmbeddableMcpServer({
  139. connection, // Your AbapConnection instance
  140. logger, // Optional logger
  141. exposition: ['readonly', 'high'], // Handler groups to expose
  142. // A tool both groups serve under one name (Get<Type>) is listed once.
  143. // readOnlyDedupStrategy: a custom IReadOnlyDedupStrategy hides more.
  144. });
  145. await server.connect(transport);
  146. ```
  147. See [Handlers Management → EmbeddableMcpServer dedup strategies](docs/user-guide/HANDLERS_MANAGEMENT.md#embeddablemcpserver-dedup-strategies) for how readonly tools are deduped against high and how to plug a custom `IReadOnlyDedupStrategy` for role-based rules.
  148. ## Quick Start
  149. 1. **Install server**: pick the [installation variant](docs/installation/INSTALLATION.md#installation-variants) — full or compact, HTTP, RFC or SNC — and follow the [Installation Guide](docs/installation/INSTALLATION.md)
  150. 2. **Configure client (auto)**: Use `mcp-conf` from `@mcp-abap-adt/configurator` (repo: [`mcp-abap-adt-conf`](https://github.com/fr0ster/mcp-abap-adt-conf), docs: [CLIENT_INSTALLERS.md](https://github.com/fr0ster/mcp-abap-adt-conf/tree/main/docs/CLIENT_INSTALLERS.md))
  151. 3. **Configure client (manual)**: See [Client Configuration](docs/user-guide/CLIENT_CONFIGURATION.md)
  152. 4. **Use**:
  153. - [Read-Only Tools](docs/user-guide/AVAILABLE_TOOLS_READONLY.md)
  154. - [High-Level Tools](docs/user-guide/AVAILABLE_TOOLS_HIGH.md)
  155. - [Compact Tools](compact/docs/AVAILABLE_TOOLS.md) — the single-step operations (lock, write under the lock, unlock, check, activate) the low set had; the low set left `mcp-abap-adt` / `-http` / `-sse` in 19.0.0 ([MIGRATION-19.0](docs/MIGRATION-19.0.md#the-low-set-leaves-the-full-binaries))
  156. ## Use Cases
  157. - **Impact analysis / where-used before changes**: map object usage and probable blast radius.
  158. - **Dependency audit**: inspect links across classes, interfaces, DDIC, CDS/views, and RAP artifacts.
  159. - **Migration and cleanup prep**: extract repository facts to plan refactoring or cloud-readiness work.
  160. - **RAP and ABAP iterative development**: create/update artifacts quickly with ADT-backed operations.
  161. - **Automated documentation and RAG ingestion**: pull structured facts from ABAP systems for downstream tooling.
  162. ## Target Users
  163. - ABAP developers and ABAP architects
  164. - RAP developers
  165. - Team leads and tech leads who need fast repository visibility
  166. - Teams building RAG/agent workflows for SAP landscapes
  167. ## Capabilities (High-Level Focus)
  168. Key examples of high-value workflows and tools:
  169. - **Repository and impact analysis**: `GetWhereUsed`, `DescribeByList`, `GetObjectStructure`, `GetObjectInfo`, `SearchObject`, `GetPackageTree`, `GetPackageContents`
  170. - **Code structure, as SAP states it**: `GetObjectOutline` (an object's components with the source lines each occupies), the `Get<Type>` source reads with `start_line`/`end_line` for just those lines, `GetIncludesList`
  171. - **RAP development**: `CreateBehaviorDefinition`, `UpdateBehaviorDefinition`, `CreateBehaviorImplementation`, `UpdateBehaviorImplementation`, `CreateServiceDefinition`, `UpdateServiceDefinition`, `CreateMetadataExtension`, `UpdateMetadataExtension`
  172. - **CDS/View development**: `CreateView`, `UpdateView`, `GetView`, `DeleteView`
  173. - **ABAP OO CRUD**: `CreateClass`, `UpdateClass`, `GetClass`, `DeleteClass`, `CreateInterface`, `UpdateInterface`, `GetInterface`, `DeleteInterface`
  174. - **Function module/group CRUD**: `CreateFunctionGroup`, `UpdateFunctionGroup`, `GetFunctionGroup`, `DeleteFunctionGroup`, `CreateFunctionModule`, `UpdateFunctionModule`, `GetFunctionModule`, `DeleteFunctionModule`
  175. - **Transport and activation support**: `CreateTransport`, `GetTransport`, `ActivateObject`
  176. - **Quality and testing**: `RunATC`, `GetATCRunStatus`, `GetATCFindings` (ABAP Test Cockpit — one run over several objects, findings read back by worklist), `ListATCResults`, `GetATCResult` (the stored ATC results — central and users' runs — listed by user, kind and age, one read by its Display ID), ABAP Unit per test carrier — `CreateUnitTest`/`UpdateUnitTest`/`DeleteUnitTest`/`RunUnitTest` for a class, `CreateCdsUnitTest`/`RunCdsUnitTest` for a CDS view, `CreateProgramUnitTest`/`RunProgramUnitTest` for a report, `CreateFunctionGroupUnitTest`/`RunFunctionGroupUnitTest`/`RunFunctionModuleUnitTest` for a function group (`runner: 'async'`, the default, starts the run; with `wait: true`, the default, the call reads the run's status at once and long-polls it only while SAP answers it running, and answers the result of a run SAP answers finished, lasting as long as the run, or the `run_id` and `NOT_STARTED` at once for a run SAP does not know; with `wait: false` it answers the `run_id` right after the start, which `GetUnitTestResult` reads — the way to start a long run under a client with a request time limit; `runner: 'sync'` is one request to `/abapunit/testruns` answering the finished result — for a system that has that endpoint alone; a function module's synchronous run takes `function_group_name` and covers every test of its group), and `RunAbapUnit` (with the same `wait`) for any ABAP Unit run target: an object of any type of the run registry (`CLAS/OCL`, `DDLS/DF`, …) or a package, with or without its subpackages; a CDS view's tests are assigned tests and execute with `scope.foreign_tests: true` — `CheckClass` and the rest of the `Check*` family
  177. ### Long reads run in the background
  178. The long reads on an approved list (where-used and search, `SearchSource`, package walks, data
  179. preview, the dump feed, profiler traces, … — `tools/long-handlers.json`) run on an ABAP session
  180. of their own. Since 24.0.0 a call **without** `background` answers a `run_handle` at once, and the
  181. result is read with `GetBackgroundRun` (compact `HandlerBackgroundRunGet`); `background: false`
  182. answers the result in the call. `DiscardBackgroundRun` (compact `HandlerBackgroundRunDiscard`) on a
  183. running read cancels it: its session is logged off, and nothing was changed. No tool takes a
  184. `timeout`: a read ends when SAP answers or when you cancel it. Once Get answers a finished or cancelled read, that read is gone: a Get response lost on the way cannot be recovered, `ListBackgroundRuns` no longer shows it, and the read must be started again. Every binary serves the background-run tools, the `-ro` ones included (their runs are reads
  185. alone). A server without background runs (an embedder without a store) lists a long tool without
  186. `background` and answers its read in the call.
  187. See [MIGRATION-24.0](docs/MIGRATION-24.0.md#callers-of-the-long-tools-background-by-default-no-timeout).
  188. ### Batch mode
  189. Calls none of whose requests depends on another's answer can be recorded and sent together, in
  190. one ADT batch envelope, instead of one request each. Batch mode is the compact binaries' (the
  191. `-ro` ones included, on every transport), one tool, `HandlerBatch`: `action: 'begin'` switches
  192. the server into batch mode, every such call is then recorded, answers nothing and takes the next
  193. number (from 1, in the order made), `action: 'end'` sends them all and leaves batch mode whatever
  194. happens, and `action: 'answers'` reads each call's answer by its number — the answer the tool
  195. gives outside batch mode for what SAP answered. The full binaries serve no batch mode; their
  196. debugger batch reads its answers with `DebugBatchAnswers`.
  197. A tool that builds a request from an earlier answer is refused in batch mode — a high-level
  198. create or update, a fallback after a `404`, a poll. Run such work as phases, each its own batch,
  199. with the single-step tools: create (compact `HandlerCreate`, one request), lock (`HandlerLock`;
  200. the handles read with `HandlerBatch` `action: 'answers'`), write (`HandlerUpdate` with `lock_handle`, one request;
  201. the whole metadata document in `source_code` for PACKAGE, DOMAIN, DATA_ELEMENT, FUNCTION_GROUP and TABLE_TYPE, and for INCLUDE with `part: 'metadata'`), unlock
  202. (`HandlerUnlock`), read back (`HandlerGet`, one request per part: `source` or `metadata`), activate (`HandlerActivate`, one request; a list, an `object_adt_type` and the types the per-object activation leaves to a run answer `{ run_id }`), and the run's state (`HandlerGet` `part: activation_status`, then `activation_results`, by `run_id`; with `with_long_polling: true` the status read is one request SAP holds until the run ends, without it a read answered at once, as often as you choose); a unit-test run is one request with the synchronous runner (`HandlerUnitTestRun` with `runner: 'sync'`, answering the finished result) or, with the asynchronous runner (`runner: 'async'`, the default), its start (`HandlerUnitTestRun`, answering `run_id`; by `tests`, or by a run `target` — an object of any run type or a package — which takes this runner), its status (`HandlerUnitTestStatus`, as often as you choose, until `FINISHED`) and its result (`HandlerUnitTestResult`, one request); a profiled run is its schedule (`HandlerProfileSchedule`, answering `profiler_id`), the run under it (`HandlerProfileRun` with that `profiler_id`) and its trace (`HandlerProfileList`, as often as you choose, then `HandlerProfileView`); a deletion is a deletion check (`HandlerDeletionCheck`, one request) and then
  203. the delete (`HandlerDelete`, the deletion request alone). A batch holds one kind of request — LOCK, UNLOCK or stateless, as its first
  204. recorded call decides — so each batch end sends one envelope; a call of another kind is refused
  205. `batch_other_kind`: record it in the next batch. A transport create (`HandlerTransportCreate`,
  206. `HandlerCreate` `object_type: 'TRANSPORT'`) types the new request's task from the create's answer
  207. and is not recorded. Every tool's description in a compact binary ends with one sentence saying
  208. how it behaves in batch mode: recordable, recordable for the arguments it names, or run outside
  209. batch mode. Over Streamable HTTP, send the `state_handle` `HandlerBatch` `action: 'begin'` answers as the
  210. `state_handle` argument (or in the `x-mcp-state-handle` request header) on every call of the batch. See
  211. [Batch Mode](docs/user-guide/BATCH_MODE.md), with the list of every recordable call.
  212. ## Registries
  213. Published in the official MCP Registry and listed on Glama.ai.
  214. - MCP Registry: [docs/deployment/MCP_REGISTRY.md](docs/deployment/MCP_REGISTRY.md)
  215. - Glama.ai:
  216. <a href="https://glama.ai/mcp/servers/@fr0ster/mcp-abap-adt">
  217. <img width="380" height="200" src="https://glama.ai/mcp/servers/@fr0ster/mcp-abap-adt/badge" />
  218. </a>
  219. ## Features
  220. - **🏗️ Domain Management**: `GetDomain`, `CreateDomain`, `UpdateDomain` - Create, retrieve, and update ABAP domains
  221. - **📊 Data Element Management**: `GetDataElement`, `CreateDataElement`, `UpdateDataElement` - Create, retrieve, and update ABAP data elements
  222. - **📦 Table Management**: `GetTable`, `CreateTable` - Create and retrieve ABAP database tables; `GetTableContents` (the data preview) is a data tool, off unless enabled — see [The data tools](#the-data-tools-off-unless-enabled)
  223. - **🏛️ Structure Management**: `GetStructure`, `CreateStructure` - Create and retrieve ABAP structures
  224. - **🧾 Table Type Management**: `GetTableType`, `CreateTableType`, `UpdateTableType`, `DeleteTableType`, `CheckTableType`, `ActivateTableType`, `GetTableTypeVersions` - Create, read, change, check, activate and delete ABAP table types (on premise and cloud); the create and the update take the definition (row type, access, key) and answer the definition SAP stored
  225. - **👁️ View Management**: `GetView`, `CreateView`, `UpdateView` - Create and manage CDS Views and Classic Views
  226. - **🎓 Class Management**: `GetClass`, `CreateClass`, `UpdateClass` - Create, retrieve, and update ABAP classes
  227. - **📝 Program Management**: `GetProgram`, `CreateProgram`, `UpdateProgram` - Create, retrieve, and update ABAP programs
  228. - **🔧 Behavior Definition (BDEF) Management**: `GetBehaviorDefinition`, `CreateBehaviorDefinition`, `UpdateBehaviorDefinition` - Create and manage ABAP Behavior Definitions with support for Managed, Unmanaged, Abstract, and Projection types
  229. - **📋 Metadata Extension (DDLX) Management**: `CreateMetadataExtension`, `UpdateMetadataExtension` - Create and manage ABAP Metadata Extensions
  230. - **⚡ Activation**: `ActivateObject` - Universal activation for any ABAP object
  231. - **🚚 Transport Management**: `CreateTransport`, `GetTransport` - Create and retrieve transport requests
  232. - **🔍 Enhancement Analysis**: `GetEnhancements`, `GetEnhancementImpl`, `GetEnhancementSpot` - Enhancement discovery and analysis
  233. - **📋 Include Management**: `GetInclude` (source or metadata), `CreateInclude`, `UpdateInclude`, `UpdateIncludeMetadata`, `DeleteInclude`, `ActivateInclude` - Create, read, change and delete program includes (writes on premise); `GetIncludesList` - Recursive include discovery
  234. - **🔍 System Tools**: `GetInactiveObjects` - Monitor inactive objects waiting for activation
  235. - **🌐 Service Binding Preview**: `GetServiceBindingPreviewUrl` - The browser URL that opens a published service binding's Fiori preview, beside its OData service and `$metadata` URLs. Composed from the binding, its service definition and the exposed root view — no document carries it. OData V2 and V4; a Web API binding has no preview and says so. On SAP BTP the preview URL carries the browser host (`abap-web`), where the BTP logon answers, while the service URLs keep the ADT host
  236. - **🧪 Runtime Diagnostics**: `RuntimeCreateProfilerTraceParameters`, `RuntimeListProfilerTraceFiles`, `RuntimeGetProfilerTraceData`, `RuntimeGetDumpById` - Profiling and dump analysis with JSON payloads
  237. - **📡 Runtime Feeds**: `RuntimeListFeeds`, `RuntimeListSystemMessages`, `RuntimeGetGatewayErrorLog` - Feed reader (dumps — filtered by user, runtime error, exception, object, package or component, and read past SAP's 100 entries per request — system messages, gateway errors), SM02 system messages, Gateway error log
  238. - **🐞 Debugger** (in `mcp-abap-adt`, `-http`, `-sse` and the compact write binaries; in no `-ro` binary): ABAP and AMDP — breakpoints (line, exception, statement, message; a line breakpoint may carry a condition), a background run of a class or report caught at them, another user's requests and terminal mode, stack, variables, watchpoints, steps, leaving a debuggee running, the debugger settings, memory sizes and snapshots. A debug session is named by a `state_handle` and survives between tool calls on every transport. In user mode a breakpoint catches every request of the request user (the connected SAP user unless another is named): where that must not be possible, install a `-ro` binary. See [Debugger](docs/user-guide/DEBUGGER.md)
  239. - **🔗 Long session over Streamable HTTP** (`mcp-abap-adt-http`, `-compact-http` and their `-ro`): every tool takes an optional `state_handle` argument that routes the call to the instance holding that state (a lock, a batch, a debug session); `SessionOpen` / `SessionClose` (compact: `HandlerSession`) keep one instance and its SAP session for a run of calls and log it off at the close, or at the idle bound. See [`@mcp-abap-adt/http`](http/README.md#held-state-and-the-long-session)
  240. - **🚀 SAP BTP Support**: JWT/XSUAA authentication with browser-based token helper
  241. - **🔑 Destination-Based Authentication**: Service key-based authentication with automatic token management (see [Client Configuration](docs/user-guide/CLIENT_CONFIGURATION.md#destinations))
  242. - **💾 Freestyle SQL**: `GetSqlQuery` - Execute custom SQL queries via ADT Data Preview API; a data tool, off unless enabled — see [The data tools](#the-data-tools-off-unless-enabled)
  243. > ℹ️ **ABAP Cloud limitation**: Direct ADT data preview of database tables is blocked by SAP BTP backend policies. The server returns a descriptive error when attempting such operations. On-premise systems continue to support data preview.
  244. ## Documentation
  245. ### For Users
  246. - **[Docs Index](docs/README.md)** - Full documentation index
  247. - **[Installation Guide](docs/installation/README.md)** - Installation variants (full or compact; HTTP, RFC or SNC) and platform guides
  248. - **[RFC Setup](docs/installation/RFC_SETUP.md)** - RFC and SNC: the SAP NW RFC library at run time, the prebuilt RFC module and where to build one
  249. - **[User Guide](docs/user-guide/README.md)** - End-user docs (auth, config, tools)
  250. - **[Authentication & Destinations](docs/user-guide/AUTHENTICATION.md)** - Destination-based auth and service keys
  251. - **[Batch Mode](docs/user-guide/BATCH_MODE.md)** - The compact binaries' `HandlerBatch`: record independent calls, send them together in batch envelopes at the batch's end, read their answers by number; which calls are recorded
  252. - **[Tool Search](docs/user-guide/TOOL_SEARCH.md)** - The three texts each listed tool carries — `description` for the model, `keywords` for BM25, `semantic` for vector search — and where a client reads them
  253. - **[Debugger](docs/user-guide/DEBUGGER.md)** - The `debug` set of the write binaries: debug sessions and their handle, the SAP ids, what keeps a session alive on each transport, what ends it
  254. - **[Handlers Management](docs/user-guide/HANDLERS_MANAGEMENT.md)** - The twelve binaries and the tools each serves
  255. - **Configurator**: `@mcp-abap-adt/configurator` (repo: [`mcp-abap-adt-conf`](https://github.com/fr0ster/mcp-abap-adt-conf)) provides the `mcp-conf` CLI to auto-configure clients
  256. - **Tools by level**
  257. - [Read-Only Tools](docs/user-guide/AVAILABLE_TOOLS_READONLY.md)
  258. - [High-Level Tools](docs/user-guide/AVAILABLE_TOOLS_HIGH.md)
  259. - [Compact Tools](compact/docs/AVAILABLE_TOOLS.md) (the low set's analogue since 19.0.0)
  260. ### For Administrators
  261. - **[Security](SECURITY.md)** - Never more secure than its host: who may call the server, HTTPS, TLS to SAP, credentials and state handles, a deployment checklist
  262. - **[Deployment Docs](docs/deployment/README.md)** - MCP Registry, Docker, release notes
  263. - **[Server Configuration](docs/configuration/YAML_CONFIG.md)** - YAML config reference
  264. ### For Developers
  265. - **[Architecture Documentation](docs/architecture/README.md)** - System architecture and design decisions
  266. - **[Development Documentation](docs/development/README.md)** - Testing guides and development resources
  267. - **[CHANGELOG.md](CHANGELOG.md)** - Version history and changes
  268. - **[docs/MIGRATION-24.0.md](docs/MIGRATION-24.0.md)** - Static types: a tool's schema is zod, an entry carries its typed `call`, `registerTool` takes the entry, the args-only form and its helpers are gone, typed handler arguments; `CreateDomain` requires `package_name`, compact `HandlerCreate` `BEHAVIOR_IMPLEMENTATION` `behavior_definition`; the low-to-compact table as it stands
  269. - **[docs/MIGRATION-23.0.md](docs/MIGRATION-23.0.md)** - Includes are created by `CreateInclude`, not `CreateProgram`; the include and table-type tools; a plain `./handlers` registration lists and calls on its stated system type; `ToolHandler` is either call form; `HandlerExporter` without background runs and the debugger; compact cloud schemas; the search table's shape
  270. - **[docs/MIGRATION-22.0.md](docs/MIGRATION-22.0.md)** - The system type decides the tools and the object types each argument accepts (the ADT type tables of interfaces-adt 24, adt-clients 39); inspection needs the system type; friendly names and main types; the search filter's names; RunATC per system type; arguments now required
  271. - **[docs/MIGRATION-20.0.md](docs/MIGRATION-20.0.md)** - RFC on connection 19 and sap-rfc-lite 0.3.2: nothing compiled on install, prebuilt bindings for three platforms, the RFC library at run time, the portable build on 0.3 only; Streamable HTTP: held state by the `state_handle` argument, and the long session
  272. - **[docs/MIGRATION-19.0.md](docs/MIGRATION-19.0.md)** - A package per transport and tool set (seventeen packages, twelve binaries), the system type required, the low set gone, the auth chain on 6.0, logoff at every session end
  273. - **[docs/MIGRATION-18.0.md](docs/MIGRATION-18.0.md)** - The debugger on adt-clients 29: what an embedder of lib/debugger changes; a start needs a breakpoint
  274. - **[docs/MIGRATION-17.0.md](docs/MIGRATION-17.0.md)** - The HTTPS certificate is verified; a message class needs a responsible
  275. - **[docs/MIGRATION-16.0.md](docs/MIGRATION-16.0.md)** - Authentication on auth-broker 4: four authentications, destinations
  276. - **[docs/MIGRATION-14.0.md](docs/MIGRATION-14.0.md)** - The compact facade moved to its own
  277. packages and `--exposition=compact` became the `mcp-abap-adt-compact` command
  278. - **[docs/MIGRATION-13.0.md](docs/MIGRATION-13.0.md)** - What a consumer on the 12.x contract changes
  279. - **[docs/MIGRATION-12.0.md](docs/MIGRATION-12.0.md)** - What a consumer on the 11.x contract changes
  280. ## Dependencies
  281. Two packages do the work:
  282. - **[@mcp-abap-adt/connection](https://www.npmjs.com/package/@mcp-abap-adt/connection)** – connection/auth/session layer
  283. - **[@mcp-abap-adt/adt-clients](https://www.npmjs.com/package/@mcp-abap-adt/adt-clients)** – Builder-first ADT clients
  284. and six packages declare the contracts both of them and this project are written against — `@mcp-abap-adt/interfaces-adt`, `-adt-connection` (where `IAbapConnection` and `IAdtWireResponse` live), `-network`, `-auth`, `-auth-sap` and `-utils`. They replace the single `@mcp-abap-adt/interfaces` umbrella, which is no longer published: a consumer naming a contract package directly gets one copy of it in the tree and takes its majors one domain at a time.
  285. The verdict on an ADT answer is a strategy, not a default: since `adt-clients` 23 no member judges its own answer, and **[@mcp-abap-adt/adt-strategies](https://www.npmjs.com/package/@mcp-abap-adt/adt-strategies)** holds the readings this project passes to every call. That is what keeps a refusal ADT embeds in an HTTP `200` — an activation that did not activate, a delete that was refused — from reaching a caller as success.
  286. Everything above is installed by `npm install` and published to npm. `@mcp-abap-adt/sap-rfc-lite` is optional and only needed for the RFC transport (and so for SNC). It has no install script: it carries a prebuilt binding for Linux x64 (glibc), Windows x64 and macOS ARM64 and compiles nothing on install; elsewhere a binding is built by hand. At run time it needs the SAP NW RFC library — SAP GUI's 64-bit `sapnwrfc.dll` in `System32` on Windows, else the SAP NW RFC SDK. Check it is installed with `npm ls -g @mcp-abap-adt/sap-rfc-lite`. See [RFC Setup](docs/installation/RFC_SETUP.md).
  287. ---
  288. ## Running the Server
  289. ### Global Installation (Recommended)
  290. After installing globally with `npm install -g`, you can run from any directory:
  291. ```bash
  292. # Show help
  293. mcp-abap-adt --help
  294. # Default stdio mode (for MCP clients; the destination comes from --mcp, or from a .env file named with --env or --env-path: a .env in the working directory is read only when named)
  295. mcp-abap-adt --system-type=<onprem|cloud>
  296. # Streamable HTTP on a custom port (@mcp-abap-adt/http; credentials from x-sap-* headers)
  297. mcp-abap-adt-http --port=8080 --system-type=<onprem|cloud>
  298. # Use stdio mode with auth-broker (--mcp parameter)
  299. mcp-abap-adt --mcp=TRIAL --system-type=cloud
  300. # Use env destination from platform sessions store
  301. mcp-abap-adt --env=trial --system-type=cloud
  302. # Use explicit .env file path
  303. mcp-abap-adt --env-path=/path/to/my.env --system-type=<onprem|cloud>
  304. # SSE (@mcp-abap-adt/sse; credentials from the opening GET's x-sap-* headers)
  305. mcp-abap-adt-sse --sse-port=3001 --system-type=<onprem|cloud>
  306. # The compact servers take their full counterpart's options; the binary fixes the tools
  307. mcp-abap-adt-compact --env-path=/path/to/my.env --system-type=<onprem|cloud> # npm install -g @mcp-abap-adt/compact
  308. mcp-abap-adt-compact-http --port=8080 --system-type=<onprem|cloud> # npm install -g @mcp-abap-adt/compact-http
  309. mcp-abap-adt-compact-sse --sse-port=3001 --system-type=<onprem|cloud> # npm install -g @mcp-abap-adt/compact-sse
  310. # The read-only servers: the same options, the tools that change nothing
  311. mcp-abap-adt-ro --env-path=/path/to/my.env --system-type=<onprem|cloud> # npm install -g @mcp-abap-adt/core-ro
  312. mcp-abap-adt-compact-http-ro --port=8080 --system-type=<onprem|cloud> # npm install -g @mcp-abap-adt/compact-http-ro
  313. ```
  314. ### Development Mode
  315. ```bash
  316. npm install
  317. npm run build
  318. npm test
  319. ```
  320. The checkout is not runnable as a server by itself: `server/` takes `@mcp-abap-adt/lib` as a package. To run a build, pack both and install the tarballs together — see [From source](docs/installation/INSTALLATION.md#from-source-development).
  321. ### Environment Configuration
  322. Env resolution:
  323. 1. `--env-path=<path|file>` (or `MCP_ENV_PATH`) for explicit `.env` file.
  324. - Absolute path: used as-is.
  325. - Relative path or file name only (e.g. `my.env`): resolved from current working directory.
  326. 2. `--env=<destination>` for destination file in standard sessions store:
  327. - Unix: `~/.config/mcp-abap-adt/sessions/<destination>.env`
  328. - Windows: `%USERPROFILE%\\Documents\\mcp-abap-adt\\sessions\\<destination>.env`
  329. Nothing is looked up in the working directory: a server started inside someone else's project must not
  330. take their settings. A `.env` there is read only when you name it (`--env-path=./.env`).
  331. Whichever file is chosen is read **and written back** with a renewed token, whatever `--unsafe` says. A destination is read once per process: a change to its `.env` from outside takes effect on restart. `.env` and environment variables hold secrets and the session; a YAML config file holds configuration only and refuses a secret-looking key.
  332. **Example .env file:**
  333. ```bash
  334. SAP_URL=https://your-sap-system.example
  335. SAP_CLIENT=100
  336. SAP_AUTH_TYPE=basic
  337. SAP_CONNECTION_TYPE=http
  338. SAP_USERNAME=your-username
  339. SAP_PASSWORD=your-password
  340. ```
  341. A destination states its connection type: `SAP_CONNECTION_TYPE` (`http` or `rfc`) in its `.env`, `--connection-type`, the process environment or YAML `connection-type`. There is no default; a destination that states none is refused at startup, naming the places it can be set. A service key carries none, so a `--mcp` destination read from one takes it from the command line, the environment or YAML.
  342. A JWT you already hold is not served over stdio: send it in the `x-sap-jwt-token` header to
  343. `mcp-abap-adt-http` or `mcp-abap-adt-sse` (`@mcp-abap-adt/http`, `@mcp-abap-adt/sse`), or create
  344. the session with `mcp-auth`.
  345. For RFC connection — the destination states its address, its client and its logon language, and no `SAP_URL`:
  346. ```bash
  347. SAP_ASHOST=your-application-server.example
  348. SAP_SYSNR=00
  349. SAP_CLIENT=100
  350. SAP_LANGUAGE=EN
  351. SAP_AUTH_TYPE=basic
  352. SAP_USERNAME=your-username
  353. SAP_PASSWORD=your-password
  354. SAP_CONNECTION_TYPE=rfc
  355. ```
  356. `SAP_CONNECTION_TYPE=rfc` in the destination's `.env` (the `--env` / `--env-path` file, or `<auth-broker-path>/sessions/<name>.env` for `--mcp=<name>`) selects RFC, as do `--connection-type=rfc`, the process environment and YAML `connection-type: rfc`; the connection type is decided before anything else of the destination is read. An RFC destination states exactly one address — an application server (`SAP_ASHOST` and `SAP_SYSNR`, its two-digit system number) or a message server (below) — and `SAP_CLIENT` and `SAP_LANGUAGE`. Nothing is derived from a URL and nothing has a default. Each key is also a CLI option and a YAML key of its name (`--ashost`, `--sysnr`, `--client`, `--language`, …, YAML `ashost`, …), read in one order: the CLI, then the process environment, then the destination's own `.env` (or a service key's fallback), then YAML. The destination's `.env` does not feed the process environment for them. A destination that states a URL over RFC, two addresses, none, an incomplete one, or no client or language is refused at startup, naming the keys. See [RFC Setup Guide](docs/installation/RFC_SETUP.md) for prerequisites (the SAP NW RFC library at run time).
  357. **Through a message server and a logon group** (load-balanced logon): instead of `SAP_ASHOST` and `SAP_SYSNR`, state `SAP_MSHOST` with `SAP_MSSERV` or `SAP_SYSID` (or both) and `SAP_GROUP` (the logon group). `SAP_SAPROUTER` goes with either address. Each is also `--mshost`, `--msserv`, `--sysid`, `--group`, `--saprouter`, or the YAML key of that name, in the order above. The server passes the fields as stated and adds nothing. Logon through a message server is implemented and unit-tested, but not yet measured on a live system (as of 2026-10-20): if the SDK refuses `SAP_MSSERV` without `SAP_SYSID`, add `SAP_SYSID`.
  358. ```bash
  359. SAP_MSHOST=your-message-server.example
  360. SAP_SYSID=ABC
  361. SAP_GROUP=<logon group>
  362. SAP_CLIENT=100
  363. SAP_LANGUAGE=EN
  364. SAP_AUTH_TYPE=basic
  365. SAP_USERNAME=your-username
  366. SAP_PASSWORD=your-password
  367. SAP_CONNECTION_TYPE=rfc
  368. # Optional: SAP_MSSERV=sapmsABC, SAP_SAPROUTER=/H/your-router.example/S/3299/H/
  369. ```
  370. An embedder of `@mcp-abap-adt/lib` that reads a configuration from outside the type system (an env file, the environment, YAML) validates it before it builds an `ISapConfig` — the union of `ISapHttpConfig` and `ISapRfcConfig`, narrowed on `connectionType`; a typed `SapConfig` it hands to the server is used as typed. Over RFC `getBaseUrl()` answers `undefined`: `GetServiceBindingPreviewUrl` answers paths, and an injected connection's background runs need `EmbeddableMcpServerOptions.system`.
  371. For SNC (passwordless logon over RFC, no user or password):
  372. ```bash
  373. SAP_ASHOST=your-application-server.example
  374. SAP_SYSNR=00
  375. SAP_CLIENT=100
  376. SAP_LANGUAGE=EN
  377. SAP_CONNECTION_TYPE=rfc
  378. SAP_AUTH_TYPE=snc
  379. SAP_SNC_PARTNERNAME='p:CN=<system>, O=<org>, C=<country>'
  380. # Creates need a responsible person; over SNC no login is known
  381. SAP_RESPONSIBLE=<your ABAP user>
  382. # Optional: SAP_SNC_QOP, SAP_SNC_LIB, SAP_SNC_MYNAME
  383. ```
  384. The credential of the installed SNC product (for example a Secure Login Client) is mapped to an ABAP user by its SNC name. `SAP_CONNECTION_TYPE=rfc` (or `--connection-type=rfc`) is required: SNC logs on over RFC only, and an SNC destination with HTTP is refused. SNC needs the SAP NW RFC library (SAP GUI's on Windows, else the SDK) and `@mcp-abap-adt/sap-rfc-lite`, an optional dependency — see [RFC Setup](docs/installation/RFC_SETUP.md).
  385. > **Not supported since 16.0:** `SAP_AUTH_TYPE=certificate` and `kerberos`, `saml`, and a `jwt` grant other than `authorization_code` and `none`, in a `.env` or service key are refused at startup, naming the authentication (a `saml` destination with no grant: `cannot be used: grantType`). See the [migration note](docs/MIGRATION-16.0.md) for what to do instead.
  386. **Generate a `.env` (JWT):**
  387. ```bash
  388. # Install the CLI globally (one-time setup) — it ships mcp-auth
  389. npm install -g @mcp-abap-adt/auth-broker-cli
  390. # Log in and write a .env that states its authentication and grant (--type xsuaa for an XSUAA key)
  391. mcp-auth --service-key ./service-key.json --output ./mcp.env --type abap
  392. # or a destination: mcp-auth --destination TRIAL --type abap (`mcp-auth --help` lists the rest)
  393. ```
  394. The `.env` states `SAP_AUTH_TYPE` and `SAP_GRANT_TYPE`; a `jwt` `.env` without a grant is refused at startup.
  395. **.env comments rule:** only full-line comments are supported (lines that start with `#`).
  396. Inline comments are not parsed, so keep comments on separate lines.
  397. **Claude recommendation:** place the service key in the service-keys directory and use `--mcp=<destination>` (avoid manual JWT tokens).
  398. ### Command-Line Options
  399. **Authentication:**
  400. - `--mcp=<destination>` - Named destination: `service-keys/<destination>.json` and `sessions/<destination>.env`, field by field
  401. - `--auth-broker-path=<path>` - Custom path for auth-broker service keys and sessions
  402. - `--browser=<name>` - Browser for a login: `system` (default), `auto`, `chrome`, `edge`, `firefox`, `none`, `headless` — mapped by the platform; `none` / `headless`: the URL on stderr ([Authentication](docs/user-guide/AUTHENTICATION.md))
  403. - `--browser-program=<program>` - The program that opens the login URL instead (excludes `--browser`)
  404. - `--renewal=<mode>` - `refresh-then-login` (default) or `refresh-only` (never a login)
  405. - `--browser-auth-port=<port>` - Browser login callback port, 1-65535 (default: `61001`); an invalid value is refused at startup
  406. - `--login-timeout=<seconds>` - Ends a browser login not finished after this many seconds, 1-86400; no default (a login ends on its answer, the IdP's refusal or the end of its session; a cancel ends nothing)
  407. - `--connection-type=<http|rfc>` - SAP connection transport: `http` or `rfc`; required for a destination unless its `.env`, the environment or YAML states it (no default)
  408. - `--ashost`, `--sysnr` - RFC to an application server (`SAP_ASHOST`, `SAP_SYSNR` — see above)
  409. - `--mshost`, `--msserv`, `--sysid`, `--group`, `--saprouter` - RFC through a message server and a logon group (`SAP_MSHOST`, … — see above)
  410. - `--client`, `--language` - The client and the logon language (`SAP_CLIENT`, `SAP_LANGUAGE`); both required over RFC
  411. - `--unsafe` - Write named destinations' sessions to disk. By default they are kept in memory (one login per process). A `.env` you name is written back either way
  412. When `--mcp=<destination>` is specified, automatic fallback loading of `./.env` is skipped.
  413. #### Access restrictions
  414. Every binary takes optional start-time restrictions: `--deny-actions` (tools and values not
  415. registered), `--allowed-packages`, `--allowed-requests`, `--denied-tables` / `--allowed-tables`
  416. (each also an `MCP_*` variable and a `restrictions.*` key of the `--conf` file). None is set by
  417. default, and with none the server behaves as without them. They are formal checks of a call's
  418. arguments; SAP's authorization remains the boundary. The server names what it read in one start
  419. line (`[MCP] Access restrictions: …`). See
  420. [Access restrictions](docs/user-guide/ACCESS_RESTRICTIONS.md), which also describes
  421. `GetObjectDraft` (compact: `HandlerGet` `part: 'draft'`): whether an object holds an
  422. unactivated change, and whose.
  423. #### The data tools: off unless enabled
  424. `GetSqlQuery` (a freestyle ABAP SQL `SELECT`) and `GetTableContents` (the rows of a table or CDS
  425. view), and their compact form `HandlerGetData`, read business data through ADT's data preview.
  426. From 24.0.0 every binary — full, `-ro`, compact and compact `-ro`, over stdio, Streamable HTTP
  427. and SSE — leaves them out unless it is started with the flag, in any of its three forms (the CLI
  428. wins over the environment, which wins over the configuration file):
  429. - `--enable-data-tools` (or `--enable-data-tools=false`),
  430. - `MCP_ENABLE_DATA_TOOLS=true`,
  431. - `enable-data-tools: true` in the `--conf` YAML file.
  432. `false` in a higher form turns them off again. A value other than empty, null, `true` or `false`
  433. stops the start; an empty value or YAML null counts as not given, as for every parameter, and the
  434. next form decides.
  435. On Streamable HTTP and SSE it is a start parameter of the server; no request header turns it on.
  436. Without it the tools are not listed, and a call of one is answered that the tool is not found.
  437. An embedder states it too: `exposition: [..., 'data']` (`EmbeddableMcpServer`),
  438. `includeData: true` (`HandlerExporter`), or `DataHandlersGroup` / `CompactDataHandlersGroup`.
  439. The reason is SAP's API Policy FAQ, version 1.3 (June 2026), question 33, which SAP marks as
  440. informational and non-binding ([PDF](https://d.dam.sap.com/x/UL9AiqH/SAP_API_Policy_FAQ_v1.3_June.pdf)): "ADT APIs are not intended for programmatic reading of application tables or export of business data, SQL execution against SAP backend systems, business data integration or runtime orchestration, agentic AI workflows operating on business data, or substitution for business APIs."
  441. **Whether to enable the data tools is the customer's decision**; the server leaves them off
  442. until the customer makes it.
  443. Other tools can reach business data too and are served as before; reviewing them is a separate,
  444. later task: the debugger's variable reads and its AMDP table preview (`DebugGetVariables`,
  445. `AmdpDebugGetTable`, compact `HandlerDebugMaintain` `getVariables` / `getDataPreview`), memory
  446. snapshots, short dumps (`RuntimeGetDumpById`, `HandlerDumpView`), the gateway error log, profiler
  447. traces, and the runs of a class or a program (not in any `-ro` binary).
  448. **Examples:**
  449. ```bash
  450. # Named destination, session kept in memory (default)
  451. mcp-abap-adt --mcp=TRIAL --system-type=cloud
  452. # Named destination, session persisted to sessions/TRIAL.env
  453. mcp-abap-adt --mcp=TRIAL --unsafe --system-type=cloud
  454. # Custom base directory for service-keys/ and sessions/
  455. mcp-abap-adt --mcp=TRIAL --auth-broker-path=~/prj/tmp/ --unsafe --system-type=cloud
  456. # Browser login on another callback port
  457. mcp-abap-adt --mcp=TRIAL --browser-auth-port=61005 --system-type=cloud
  458. ```
  459. See [Client Configuration](docs/user-guide/CLIENT_CONFIGURATION.md) for complete configuration options.
  460. ### Handler logging switches
  461. - `AUTH_LOG_LEVEL=error|warn|info|debug` — sets base log level for handler logger; `DEBUG_AUTH_LOG=true` also enables `debug`.
  462. - `HANDLER_LOG_SILENT=true` — fully disables handler logging.
  463. - `DEBUG_CONNECTORS=true` — verbose connection logging in high-level handlers.
  464. - `DEBUG_HANDLERS=true` — enables verbose logs for selected read-only/system handlers.
  465. ## Development
  466. ### Testing
  467. ```bash
  468. npm test # the unit run: Jest, then node:test — no SAP system, no outside service
  469. npm run test:install # packs and installs the release (the npm registry): the install suites
  470. npm run test:retrieval # vector tool retrieval through a local Ollama
  471. npm run test:integration # the live suites, against the system tests/test-config.yaml names
  472. ```
  473. How each run selects, skips and is interrupted: [the testing guide](docs/development/tests/TESTING_GUIDE.md) and [the integration tests' README](src/__tests__/integration/README.md).
  474. #### Test logging switches
  475. - `TEST_LOG_LEVEL=error|warn|info|debug` — controls test logger verbosity (DEBUG_TESTS/DEBUG_ADT_TESTS/DEBUG_CONNECTORS force `debug`).
  476. - `TEST_LOG_FILE=/tmp/adt-tests.log` — writes test logs to a file (best-effort).
  477. - `TEST_LOG_SILENT=true` — disables test logging pipeline (console output muted).
  478. - `TEST_LOG_COLOR=true` — adds colored/prefixed tags to test log lines.
  479. - All `console.*` in tests are routed through the test logger with a `[test]` prefix.
  480. ### Building
  481. ```bash
  482. npm run build
  483. ```
  484. ### Developer Tools
  485. ```bash
  486. # Generate tool documentation
  487. npm run docs:tools
  488. # See tools/README.md for more developer utilities
  489. ```
  490. ## Contributors
  491. Thank you to all contributors! See [CONTRIBUTORS.md](CONTRIBUTORS.md) for the complete list.
  492. ---
  493. **Acknowledgment**: This project was originally inspired by [mario-andreschak/mcp-abap-adt](https://github.com/mario-andreschak/mcp-abap-adt). We started with the core concept and then evolved it into an independent project with our own architecture and features.
  494. ## License
  495. **Two licences: the libraries Apache-2.0, the servers AGPL.** Which one applies depends on which
  496. package you install.
  497. | Packages | Licence | |
  498. |---|---|---|
  499. | `@mcp-abap-adt/lib`, `background-runs-memory`, `responsible-rules`, `compact-readonly-entries`, `compact-modify` | Apache-2.0 | [`LICENSE`](LICENSE), [`NOTICE`](NOTICE); each package's own `LICENSE` |
  500. | `@mcp-abap-adt/server-runtime`, `core`, `http`, `sse`, `compact`, `compact-http`, `compact-sse` and the six `-ro` packages | AGPL-3.0-only | [`server/LICENSE`](server/LICENSE); each package's own `LICENSE` |
  501. All eighteen are published from this repository with one command, in dependency
  502. order ([Release](docs/deployment/RELEASE.md)):
  503. ```bash
  504. npm run release:dry # rehearses every package, touches nothing
  505. npm run release:publish # @mcp-abap-adt/lib first, then the packages that depend on it
  506. ```
  507. `release:publish` skips a version already on the registry, so re-running after
  508. a failure resumes rather than starting over. It aborts on the first failure
  509. instead of publishing a package on top of one that is not there.
  510. Note that `npm publish` and `npm run` are different commands. `npm publish
  511. release` asks npm to publish a package *named* `release`, which is somebody
  512. else's package on the registry.
  513. Copyright © 2025–2026 Oleksii Kyslytsia
  514. All are distributed in the hope that they will be useful, but WITHOUT ANY
  515. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  516. PARTICULAR PURPOSE.
  517. **What this means.** Running any of them, on your own data, carries no conditions.
  518. Embedding the library in your own application carries no obligation to open your
  519. application: Apache-2.0 asks for the notice and the licence text to travel with
  520. it, and nothing more.
  521. Distributing the standalone server, or running a modified version of it as a
  522. network service, means passing on the same freedoms under AGPL section 13 —
  523. including the source. That is why the two are separate packages: installing the
  524. library never puts the server in your dependency tree.
  525. **The packages underneath are LGPL-3.0-only** — `@mcp-abap-adt/adt-clients`,
  526. `adt-strategies`, `connection`, `logger`, `auth-broker`, `auth-providers`,
  527. `auth-stores` and the contract packages `interfaces-adt`,
  528. `interfaces-adt-connection`, `interfaces-network`, `interfaces-auth`,
  529. `interfaces-auth-sap` and `interfaces-utils` — and the library links them at
  530. runtime. It was four of them when this paragraph was written; the rule is the
  531. whole scope now, libraries LGPL and servers AGPL or GPL, and the MIT that a few
  532. of the auth packages still carried was an oversight rather than an offer. LGPL
  533. does not reach your own code, but its terms do travel with those packages
  534. whatever this project is licensed as. Plan for that, not for the notice on this
  535. repository.
  536. **Other terms are possible.** Apache-2.0 is what the library is offered under
  537. publicly, not the only way it can be offered. The copyright holder may license
  538. the same code separately to a party who needs different terms; that takes
  539. nothing away from anyone who received it under Apache-2.0, which is permanent.
  540. [`CONTRIBUTORS.md`](CONTRIBUTORS.md#licensing) records what keeps that option
  541. open, including the rule that no LGPL code from the packages underneath is ever
  542. copied into this tree.
  543. **History.** Releases through 8.13.0 were MIT and stay MIT; 9.x was
  544. `GPL-3.0-only`. A licence change is not retroactive — anyone may still take an
  545. earlier release under the licence it carried. See [`CONTRIBUTORS.md`](CONTRIBUTORS.md#licensing)
  546. for the full account of how the relicensing was lawful.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.