
Sap Adt Mcp
io.github.yzonur由 GitHub 账号 yzonur 发布v0.8.57更新于 Oct 24, 2026
Give Claude live access to SAP ABAP via ADT: read, search, check, test, and edit objects.
概览
本地 MCP 服务器,通过 ADT 让 AI 助手直接访问 SAP ABAP 系统:读取、搜索、检查、测试、调试和编辑对象。
- 可以做什么
- 读取、创建、替换、删除、格式化和激活 ABAP 对象,支持多步编辑的加锁与解锁,并提供直接调用 ADT REST 的兜底工具。运行语法检查、ABAP Unit 测试和 ABAP 测试驾驶舱检查。浏览包、按名称搜索对象并查询使用位置。比较两个系统间的对象或传输内容,管理传输并查看队列状态。以 SE16 方式读取表,获取系统信息和 F4 式值帮助。查看 ST22 转储并驱动外部 ABAP 调试器,包括单步执行和修改变量。
- 适用场景
- 适合 ABAP 开发者和 SAP 团队让助手直接在开发系统中工作:探索包、审计或重构类、分析转储、在 DEV、QAS、PRD 之间验证发布,或调试 ICF、RFC 和后台会话。可选的 Clean Core 提示支持 S/4HANA 评级和设计工作。
- 运行要求
- 通过 npm(Node.js 22.19 或更高版本)或 npx 在本地运行。需要为每个 SAP 系统准备含 host、client、user 和 password 的 config.json,查找顺序为 SAP_ADT_MCP_CONFIG、~/.sap-adt-mcp/config.json 或 ./config.json;密码可从环境变量读取。需要能访问 SAP 系统的网络、启用 ADT,调试器还需调试授权。数据预览工具需要 NetWeaver 7.55+ 或 S/4HANA。
安装
在 SourceWeft 中
- 打开 控制台中的 Sap Adt Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
sap-adt-mcp
MCP server giving Claude (and any MCP-compatible client) live access to SAP systems via ADT.
Read source, search the repository, run syntax checks, run unit tests, run ATC, diff the same object across landscapes, edit and activate ABAP — all from a chat window or an autonomous agent. No add-on installation on the SAP stack required.
[npm version] [CI] [License: MIT] [Node.js]
Why
SAP development is full of repetitive read-the-source / check-the-callers / diff-the-system work. AI assistants are great at exactly that kind of task — but only if they can reach the system. ADT (ABAP Development Tools) is the HTTP API that Eclipse uses; it ships with every modern NetWeaver and S/4 system. This server speaks ADT on behalf of the agent so the agent can do real work against your real systems, with the same auth and scoping you'd give a developer in Eclipse.
What's in the box
50+ high-level tools wrapped around the most common ADT endpoints, plus a generic escape hatch for anything else, plus 5 user-invokable Clean Core prompts that turn the tool surface into outcome-shaped slash commands (see Clean Core prompts below).
¹ Experimental tools target ADT endpoints (SNOTE, SM12 enqueues, SM36/SP01)
that classic NetWeaver does not expose; on such systems they return
available:false with a fall-back hint rather than failing. They work where the
backing service exists (typically S/4HANA).
Multi-system aware. One config, many SAP systems (DEV / QAS / PRD or
landscape-wide); switch with the system argument or compare across two with
adt_compare_source / adt_transport_diff.
Safe by default. A readOnly flag (global or per-system) blocks every
write method. Read-only POST queries (search, where-used, package tree)
remain allowed so agents can still discover.
Robust. Per-request timeout. CSRF token negotiation with auto-retry on 403. Self-signed cert opt-out. Optional debug tracing to stderr.
Structured errors. ADT's <exc:exception> envelopes are parsed into
{ type, message, namespace } so failed calls don't dump XML into the agent's
context window.
Install
Previously published as
claude-for-abap— that package still works but is deprecated; new installs should usesap-adt-mcp.
Requires Node.js 22.19+ (undici v8, used as the HTTP client, requires this minimum).
Configure
Create your config:
The server searches in this order:
$SAP_ADT_MCP_CONFIG(absolute path)~/.sap-adt-mcp/config.json./config.json(cwd at server start)
Sample config
Per-system options
Read-only mode
readOnly: true (top-level or per-system) refuses any unsafe HTTP method.
Whitelisted read-only POST endpoints (nodestructure, search,
usagereferences, parsers, checkruns) remain available so agents can
still discover and analyze without being able to modify.
Recommended: set readOnly: true for QAS and PRD profiles. Keep DEV writable.
Self-signed certificates
Many internal SAP systems use self-signed certs. "rejectUnauthorized": false
disables TLS validation for that profile only. Don't set this on PRD.
Audit log
Every write the server performs against SAP (POST/PUT/DELETE/PATCH — locks, source updates, activations, transport operations) is appended to a local JSONL file, including which MCP tool triggered it and, for blocked attempts in read-only mode, the violation itself. Reads and read-only queries are not logged. Nothing leaves your machine — this is your local answer to "what exactly did the AI change?".
Default location: ~/.sap-adt-mcp/audit.log. One JSON object per line:
Configure or disable:
…or set SAP_ADT_MCP_AUDIT=0 (also accepts false/no/off).
Result cache
Agents repeat the same discovery calls while they reason. Results of the
read-only tools adt_search_objects, adt_browse_package, adt_list_packages,
adt_where_used, adt_system_info and adt_value_help are cached in memory
for 60 seconds per system and argument set. Any write this server performs
drops the whole cache, so you never read back a stale result of your own change;
changes made elsewhere (SAP GUI, Eclipse) can be up to one TTL old. A cached
result carries _meta["sap-adt-mcp/cache"] = { hit: true, ageMs }.
"ttlMs": 0 (or SAP_ADT_MCP_CACHE_TTL_MS=0) turns it off.
Automatic error reporting
The server sends small, redacted reports to the maintainer so defects get found and fixed. This is on by default and the server prints a notice saying so on startup. There are three channels:
- Crash — a tool handler throws an unexpected error.
- ADT error — a tool returns a non-2xx ADT response that the classifier flags as a likely tool bug (406/415 content negotiation, malformed requests, server dispatcher blow-ups). User/business-side responses (401/403/404, lock and enqueue conflicts, data-preview SQL errors) are not reported.
- Agent-reported — the calling agent files a defect the other two channels
can't see (wrong data in a successful response, an ignored parameter, a
missing capability) via the
adt_report_issuetool.
What is sent: the sap-adt-mcp version, Node version, OS, the tool name, and the
error/finding with a fingerprint for de-duplication, plus an anonymous install
id (random bytes, cached at ~/.sap-adt-mcp/install-id) that lets repeat
reports from the same install be grouped for triage — it identifies neither you
nor your system. Before anything leaves your machine it is scrubbed of
hostnames, users, passwords, tokens, IPs, and emails; tool arguments and
free-text fields are redacted the same way. Reports
go to a relay the maintainer owns, which files/de-dups a GitHub issue — the
relay holds the GitHub credentials, never this package.
Turn it all off:
…or set SAP_ADT_MCP_REPORT=0 (also accepts false/no/off). Finer control:
Connect a client
Claude Code (CLI)
Pass secrets through the registration:
Claude Desktop
Edit claude_desktop_config.json (Settings → Developer → Edit Config):
Quit and restart Claude Desktop fully (system tray → Quit) for the change to apply.
Validate before connecting
Loads the config and pings every system; exits non-zero if any are unreachable or rejecting credentials. Run this first when troubleshooting.
Tools
Object-source CRUD
Quality
Discovery
Cross-system
Runtime errors
Debugger
External ABAP debugger over ADT's /sap/bc/adt/debugger/* API. Set a breakpoint,
wait for a session to hit it, then inspect the stack/variables, step through, and
(guarded) change values. Requires debug authorization on the backend; minimum
NW 7.31 SP04 + Kernel 7.21 (fine on S/4).
Typical flow:
What an external breakpoint traps: HTTP/ICF (Fiori, OData, ADT), RFC and
background sessions — not your own SAP GUI dialog session. Running the report
from SE38 with F8 traps nothing and opens no debugger, which reads like a broken
feature but isn't. To debug dialog-only code, run it inside an ICF session with a
throwaway IF_OO_ADT_CLASSRUN wrapper and trigger
POST /sap/bc/adt/oo/classrun/<class>:
SUBMIT opens a fresh program context, so you debug the target report on its own.
Timing: arm adt_debug_listen before triggering the run — for a fast
request (Fiori/OData) arming it after clicking is already too late. A trapped
debuggee then waits only ~15–20 s for the attach before resuming on its own, so
listen attaches immediately with no round trip in between. A caught: false
can therefore mean three things: the run hasn't happened yet, the listener was
armed too late, or that line never executes in this flow — keep a known-good
control breakpoint to tell a wrong breakpoint apart from a setup problem.
Read-only mode: inspection (breakpoints, listen, stack, variables) is allowed;
the WRITE tools above (step, goto-stack, set-variable, watchpoints) are refused
under readOnly: true. Debugging another user's session (requestUser) is off
by default; enable it per system with "debug": { "allowRequestUser": true }
(needs backend debug authorization).
Data
Transports
Escape hatch
adt_request — direct ADT REST call. Use this when a niche endpoint isn't
covered by a high-level tool. Handles auth / CSRF / cookies / sap-client
automatically.
Object types
Friendly aliases (any of either column work):
Skills (packaged workflows)
The raw tools are building blocks; skills/ ships ready-made
workflows for Claude Code that orchestrate them. Each SKILL.md lists its own
prerequisites (minimum NetWeaver release, required authorizations, read-only
compatibility).
To use one, copy its folder into your project's .claude/skills/ (or
~/.claude/skills/ for all projects):
Claude Code picks them up automatically; they trigger when the conversation matches (e.g. "is E4DK900123 safe to release?" → transport-release-gate).
Clean Core: prompts + reference
The server ships an opt-in Clean Core layer for SAP S/4HANA work. There are two pieces, and they are deliberately separate:
- Five MCP prompts (
src/prompts.js) — the operational surface. The user invokes them as slash commands. Each one pairs a slice of the Clean Core framework with the relevantadt_*tools so the model can act on a real system, not just lecture about levels. - Long-form reference (
skills/abap-clean-core/) — the framework's full text: Stay Clean / Get Clean playbook, A/B/C/D level deep-dive, Cloudification Repository state semantics, ABAP Cloud allowed/forbidden lists, the SAP Application Extension Methodology (3 phases), governance practices, KPI calculations, ATC exemption process. Read once, link to it from PRs, hand to a new team member. The prompts above quote what they need; the reference is everything else.
Design choices
- Opt-in, not auto-firing. Clean Core is an S/4HANA discipline. ECC developers should not have it imposed on them. Nothing fires unless the user types the slash command.
- ECC applicability check baked into every prompt. The first thing each prompt body asks the model to do is verify the target system is S/4HANA. On ECC, it backs off and offers help in classic-ABAP idioms with no level labels.
- Tone is descriptive, not judgmental. "I know it's Level D, just ship it" is honored. The agent ships, marks the level, sketches the Level A refactor for later, and moves on.
The prompts
In Claude Code (assuming you registered the server as sap-adt), the
exact commands are:
The slash-command name structure is determined by the MCP client: the
mcp__<server-alias>__ prefix is added automatically based on the alias
you used when registering the server. If you registered the server with
a different alias (e.g. claude mcp add cc -- npx sap-adt-mcp), the
prefix changes accordingly (/mcp__cc__clean_core_grade).
In Claude Desktop, prompts appear in the slash-command picker — same naming.
Argument flow examples
Atomic prompts (grade, review) take all their arguments inline and
return a structured analysis:
Mode-loading prompts (refactor, create, design) optionally take a
seed; without one, they wait for the user's natural-language follow-up:
Or with a seed argument so the request is one-shot:
Read the long-form reference
skills/abap-clean-core/ is the canonical
source for everything the prompts quote and more. If you're setting up
Clean Core governance for a real program — KPI baselines, ATC exemption
discipline, maturity assessment, on-stack vs side-by-side trade-offs at
the architecture level — that's where the depth lives.
The directory is structured as one entry point (SKILL.md) plus four
deep-dive files in references/:
references/levels-detailed.md— Cloudification Repository state values, released local vs released remote APIs, reclassification dynamics, per-anti-pattern remediationreferences/decision-framework.md— fit-to-standard, the SAP Application Extension Methodology in detail, on-stack vs side-by-side triggers, hybrid patterns, worked scenariosreferences/governance.md— Stay Clean / Get Clean playbook, the four KPIs and how to compute them, ATC exemption process, maturity assessment, multi-year roadmapreferences/abap-cloud-rules.md— full allowed/forbidden lists, RAP / CDS / business object interfaces / Custom Fields, prebuilt services, classic-to-cloud migration patterns
You can install the reference as an actual auto-loading Claude skill by
copying or symlinking skills/abap-clean-core/ into your
~/.claude/skills/ — but that's an explicit choice. The default
behavior of this repo is opt-in, prompt-only.
Examples
See examples/ for end-to-end agent workflows: project discovery,
class audit, cross-system release verification, where-used-driven refactor,
test triage.
Quick taste:
Architecture
Two runtime dependencies: @modelcontextprotocol/sdk (the MCP wire protocol)
and undici (HTTP with custom TLS dispatcher). Everything else is stdlib.
Multi-step editing pattern
For most edits, adt_set_source is enough — it acquires the lock, writes,
and releases. For workflows that touch the same object multiple times within
a single turn (e.g. apply N method-level patches, then activate), use the
sticky-lock pattern:
The lockHandle parameter on adt_set_source skips internal lock/unlock
when present.
Large objects (thousands of lines)
A multi-thousand-line class or program can exceed the per-call I/O cap, so its source cannot be passed inline. Keep the content on disk instead — it never enters the agent context:
Note: assigning to a transport works headless, but TR creation
(adt_create_transport) routes through a GUI dialog on some systems and can
fail with a 500 — pass an existing TR id instead.
Caveats
- NetWeaver release variation. A few ADT endpoints (especially around
transport requests, ATC, and object-create XML shapes) have small shape
differences across NW 7.5x, S/4 on-prem, and Steampunk. If a high-level
tool fails with HTTP 4xx, the tool description notes which endpoint it
hits — fall back to
adt_requestwith the right path / content type for your release. - ABAP Cloud (BTP / Steampunk). Only on-prem ADT 7.5x+ has been actively exercised. Steampunk uses a stricter object-type allowlist (only released / public APIs) and some collection endpoints differ. Steampunk users: please open an issue with the endpoints that differ; PRs welcome.
- Object-create XML shapes. The body templates target modern on-prem
releases. Some older systems require additional attributes
(
adtcore:masterLanguage, etc.) — open an issue if your system rejects the create payload, and include the response body. - DDIC primitives (tables, data elements, domains) are not creatable via
adt_create_object— these need a richer DDIC-specific payload that we haven't generalised. Useadt_requestfor now.
Troubleshooting
"failed" in Claude Desktop's MCP server list. Run sap-adt-mcp --validate-config from a terminal. If that prints OK, the server is fine and
the issue is in your claude_desktop_config.json (wrong path or env).
403 with x-csrf-token: required. Should self-heal — the client refetches
the token and retries. If it persists, you likely have an SSO / front-end
auth in front of ADT that breaks Basic auth; check your ICM and SAP web
dispatcher rules.
Read-only mode refuses an obviously-read endpoint. It's probably a POST
endpoint not in the whitelist. Open a PR or issue with the path; we'll add
it. Or temporarily flip the system to readOnly: false.
SAP_ADT_MCP_DEBUG=1 traces every request and response (status, latency,
URL, request headers minus Authorization) to stderr. The MCP client shows
stderr in its server log, so check there.
Contributing
See CONTRIBUTING.md — bug reports, new tool coverage, NetWeaver compatibility notes, docs, examples all welcome.
License
MIT — see LICENSE.
来源:README.md,提交 3ee5076
工具
0版本历史
1- v0.8.57最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分