Abap Mcp

io.github.palimkarakshay由 GitHub 帳號 palimkarakshay 發布v0.12.7更新於 Nov 2, 2026

Offline SAP ABAP/RAP tools for AI agents: lint, Cloud readiness, released APIs, knowledge.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

離線 MCP 伺服器,讓 AI 助理進行 ABAP/RAP 分析:程式碼檢查、ABAP Cloud 就緒度評分、遷移規劃、已發佈 API 查詢與程式碼骨架產生。

可以做什麼
  • 對 ABAP、CDS 與行為定義原始碼進行檢查、自動修正、格式化與結構大綱,並可瀏覽與解說規則
  • 評估 ABAP Cloud 就緒度、產生分階段遷移清單、比較改寫前後差異、梳理物件相依關係
  • 依版本查詢 SAP 已發佈/已棄用 API,並檢索內建且標註日期的 ABAP Cloud、Clean Core 與 SAP AI 知識庫
  • 產生 RAP 受控業務物件、ABAP Unit 測試類別、呼叫 Generative AI Hub 的類別,以及 AGENTS.md 規則區塊
  • 以伺服器自帶的解析器檢查 RAP 行為定義與服務定義
適用情境
適合助理在 git 工作目錄、abapGit 匯出或 CI 流程中撰寫與審查 ABAP 程式碼、卻無法連線實際 SAP 系統時使用。也適用於 Clean Core 遷移盤點、程式碼審查,以及建立新的 RAP 物件。
執行需求
需要 Node.js 22+,以及能啟動 npx 程序的本地 MCP 用戶端。不需要 SAP 系統、憑證或 API 金鑰。工具以原始碼文字作為輸入,不讀取工作區檔案;內建 CLI 可遞迴掃描目錄。選用的 run_abap_unit 工具需設定 ABAP_MCP_ENABLE_RUN=1。
安裝前請注意
預設 stdio 版本不發出網路請求、不讀取使用者檔案,但原始碼文字會經由工具呼叫傳遞。選用的 HTTP 版本會把原始碼文字送到端點託管方。選用的 abap-mcp-genai 元件會把 ABAP 原始碼送到你自己租用戶下的 SAP AI Core。就緒度評分與已發佈 API 結果來自標註日期的內建快照,並非 ATC,目標系統仍具最終權威。產生的骨架仍需在 ADT 中啟用。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Abap Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

abap-mcp

[Install in VS Code] [Install in VS Code Insiders] [npm]

Make your AI coding agent an expert SAP ABAP & RAP consultant — local by default. No SAP system, no credentials, one command to install.

abap-mcp is a Model Context Protocol server that gives any AI coding agent — Claude Code, GitHub Copilot, Cursor, Codex, Windsurf — real ABAP senses, built on abaplint (the open-source ABAP parser/linter). The agent brings the reasoning; abap-mcp brings ground truth: a deterministic parser, objective scores, and validated generators that keep the AI honest. It works on ABAP source wherever your agent works — a git checkout, an abapGit export, a code review, CI — long before anything reaches a system.

  • New to ABAP or RAP? Your agent becomes the senior consultant looking over your shoulder: every snippet linted against Clean ABAP as you write (lint_abap), every finding explained with its rationale and examples (explain_abap_rule), and scaffold_rap_bo starts you from a canonical, self-validated RAP business object instead of a blank editor.
  • Senior ABAP consultant? It's your assessment and task engine: point your agent at a repo and get a scored, categorized ABAP Cloud readiness report with an A–D tech-debt grade (check_cloud_readiness), a phased migration backlog with efforts and exit criteria (plan_cloud_migration), an objective before/after verdict on every rework (compare_abap), released-API replacements (check_released_api), and CI gates that hold the line while the migration proceeds.

The default stdio edition is 100% local: the analysis engine makes zero network calls and reads no user files. Sources go in as text and structured findings come back. The released-API list and abaplint rule data are package-bundled. An optional guarded Streamable HTTP edition makes the same tools available to remote clients such as ChatGPT web; in that mode, source text is sent to the machine you host. See privacy and data handling.

Why this exists

Every other ABAP MCP server is either a bridge to a live SAP system (ADT/RFC — needs credentials, a system, and trust) or a documentation search. But AI coding agents spend most of their time where the files are — editing abapGit repos, reviewing diffs, generating code — long before anything reaches a system. This server gives agents the missing feedback loop at that layer:

  • "Does this ABAP parse? Is it clean? How does it perform?" → lint_abap (+ focus packs)
  • "Fix this block automatically — casing, obsolete syntax." → fix_abap (deterministic, parser-guaranteed)
  • "How far is this classic report from ABAP Cloud? Grade it." → check_cloud_readiness (A–D)
  • "Plan the migration — what do we tackle first?" → plan_cloud_migration (phased backlog)
  • "This class has no tests — start me a harness." → scaffold_abap_unit (failing-by-default)
  • "What depends on what? Migrate which object first?" → get_object_dependencies (+ Mermaid)
  • "Did this rework make the code better or worse?" → compare_abap
  • "Is MARA a released API? What do I use instead?" → check_released_api
  • "Start me a correct RAP business object." → scaffold_rap_bo
  • "What's in this 4,000-line class? Draw it." → get_abap_outline (+ Mermaid)

Install — 60 seconds

The only requirement is Node.js 22+. No SAP system, no credentials, no API keys. New to AI tooling (or ABAP)? Follow the from-zero walkthrough in docs/INSTALL.md — or let the installer do it:

bash
npx abap-mcp setup     # detects VS Code / Claude Code and registers the server; guides Eclipse

Otherwise, pick your client:

Codex CLI · Codex IDE extension · ChatGPT desktop — one command configures all three on the same Codex host:

bash
codex mcp add abap-mcp -- npx -y abap-mcp

Restart ChatGPT desktop or the IDE extension, then use /mcp to confirm abap-mcp is connected. In ChatGPT desktop you can alternatively open Settings → MCP servers → Add server, choose STDIO, and enter command npx with arguments -y abap-mcp.

Codex plugin (MCP server + review/mentor/migration skills)

bash
codex plugin marketplace add palimkarakshay/abap-mcpcodex plugin add abap-mcp@abap-mcp

ChatGPT web cannot start a local npx process. It needs a deployed HTTPS /mcp endpoint or a secure development tunnel. This repository ships the HTTP entry point and hardening controls, but does not operate a public service. Follow the OpenAI setup and self-hosting guide.

Claude Code

bash
claude mcp add abap-mcp -- npx -y abap-mcp

VS Code (Copilot agent mode) — one click on the Install in VS Code badge above, or one command:

bash
code --add-mcp '{"name":"abap-mcp","command":"npx","args":["-y","abap-mcp"]}'

For a whole team, commit examples/vscode/mcp.json as .vscode/mcp.json in your abapGit repo — everyone who opens the folder gets the server offered automatically.

Eclipse (via the GitHub Copilot plugin) — Copilot Chat in Eclipse speaks MCP: open the Copilot menu → Edit preferences → MCP, and add the same "abap-mcp" server block (command npx, args ["-y", "abap-mcp"]). Steps and prerequisites: GitHub's MCP docs, Eclipse tab. Stock ADT without Copilot has no MCP client today.

Cursor · Windsurf · any MCP client — add this to its mcp.json / .mcp.json (project or global):

json
{  "mcpServers": {    "abap-mcp": { "command": "npx", "args": ["-y", "abap-mcp"] }  }}

Claude Desktop — Settings → Developer → Edit Config, add the same mcpServers block to claude_desktop_config.json, restart.

From a clone (contributing / hacking):

bash
npm install && npm run buildclaude mcp add abap-mcp -- node /path/to/abap-mcp/dist/cli.js

Connected? Ask your agent "list your ABAP tools" — you should see eighteen by default, lint_abap through check_rap_behavior, plus the opt-in run_abap_unit when ABAP_MCP_ENABLE_RUN=1 is set.

First things to ask

  • "Here's my functional spec — build the RAP implementation from it." (or run /mcp__abap-mcp__abap-from-spec)
  • "Lint this class against ABAP Cloud and explain the worst finding like I'm new to ABAP."
  • "How cloud-ready is this repo? Grade it and plan the migration in phases."
  • "Is MARA a released API? What do I use instead?"
  • "Scaffold a RAP BO for entity Booking on table zbooking, draft enabled."
  • "I reworked zcl_pricing — compare old vs new: did it actually get better?"

Guided workflows built in (MCP prompts)

The consultant's playbook ships both as four MCP prompts and as four Codex plugin skills. In Claude Code the prompts appear as slash commands (/mcp__abap-mcp__…); prompt-capable clients list them natively, while the Codex plugin discovers the corresponding skills:

PromptWhat it sets up
abap-from-specThe blank-page killer. Hand it a functional/tech spec — or a plain-language requirement — and the agent builds working, validated modern ABAP/RAP: spec → build plan with an ASSUMPTION register → deterministic scaffold_rap_bo foundation → behavior logic → every file gated through fix_abap + lint_abap until clean → filled unit tests → delivery in activation order. Nothing unlinted is ever delivered.
abap-reviewA full senior-consultant code review: lint → triage → explain each finding's why → minimal fixes → prove the rework with compare_abap. Optional focus (Performance / Security / Styleguide).
abap-mentorOver-the-shoulder mentoring mode for the rest of the session: every snippet is quietly linted and readiness-checked, findings become plain-language guidance, new objects start from validated scaffolds.
abap-migration-planA client-ready phased migration plan driven by plan_cloud_migration — current state, phases with S/M/L efforts and exit criteria, released-API work separated — then offers to execute phase 1.

CLI — same engine, no AI required

Every tool is also a subcommand, so it works in terminals and CI where no MCP client exists:

bash
npx abap-mcp lint src/                          # lint files or whole directoriesnpx abap-mcp fix src/ --write                   # apply abaplint's deterministic auto-fixes in placenpx abap-mcp lint src/ --focus Performance      # themed pass: Performance | Security | Styleguidenpx abap-mcp lint src/ --rules-file org.json    # your org's abaplint rule pack, same enginenpx abap-mcp readiness src/ --fail-below 80     # repo-level ABAP Cloud readiness, scored + graded A–Dnpx abap-mcp plan src/                          # phased migration backlog: work items, S/M/L efforts, exit criterianpx abap-mcp unittest src/ --out tests/         # failing-by-default ABAP Unit skeletons for untested classesnpx abap-mcp deps src/ --mermaid                # dependency graph (+released-API flags) as a Mermaid diagramnpx abap-mcp compare old/ new/                  # rework verdict: findings resolved/introduced, grade movementnpx abap-mcp scaffold --entity Travel --table ztravel --key travel_id --out ./outnpx abap-mcp outline src/zcl_monster.clas.abap  # navigate big objects (--mermaid for a diagram)npx abap-mcp released MARA I_Product --edition btp  # released-API status + successor, per edition (s4hc|btp|pce)npx abap-mcp explain exit_or_check              # rule rationalenpx abap-mcp release --since 2605 rap           # bundled ABAP Cloud/RAP release-delta knowledge (dated, sourced)npx abap-mcp knowledge "clean core level C"     # search the bundled SAP knowledge base (Clean Core, ATC, SAP-AI)npx abap-mcp aisdk --scenario ZDEMO_AI --interaction string --out ./out  # scaffold a Generative AI Hub callnpx abap-mcp agent-rules --target Cloud --paired sap-adt-mcp --run       # print the AGENTS.md rules blocknpx abap-mcp rapcheck src/ --release 2508       # check RAP behavior/service definitions (BDEF/SRVD); exit 1 on errorsnpx abap-mcp unittest --run src/                # EXECUTE ABAP Unit tests offline (open-abap kernel, no DB/CDS/EML); exit 1 on failure

Directories are walked recursively (abapGit naming), batched automatically, and readiness merges batches into one scored, categorized repo report. Exit codes are CI-friendly (1 on error findings / failed threshold).

Agentic workflows, recipes & CI

docs/examples/abap2xlsx-assessment.md — what all of this produces on a real, well-known open-source repo (100 files, three commands, no system). docs/COOKBOOK.md — practical recipes: the fix-until-clean loop, PR review without a transport, whole-repo migration triage, CI gates, per-persona use cases. examples/claude-code/ — drop-in agentic workflows that turn the tools into that over-the-shoulder consultant: an abap-code-reviewer subagent, an abap-cloud-migrator sweep loop (readiness score as the loop condition), an abap-tech-debt-assessor (the graded A–D client deliverable), per-repo .mcp.json, and a GitHub Actions quality gate for abapGit repos.

Agentic loop

The full offline loop an agent can run before anything reaches a system:

  1. Scaffold — scaffold_rap_bo, scaffold_abap_unit, or scaffold_abap_ai_sdk for a validated starting point instead of a blank editor.
  2. Fix, then lint — fix_abap (deterministic mechanical pass) followed by lint_abap until findings are zero or consciously waived.
  3. Run — run_abap_unit (opt-in via ABAP_MCP_ENABLE_RUN=1, or always through abap-mcp unittest --run) executes the ABAP Unit tests and feeds real pass/fail results back into the loop — TH Köln's ABAP benchmark (arXiv 2601.15188) measured this alone moving Claude Opus 4.5 from 31.6% to 78.7% task success across feedback rounds.
  4. Readiness — check_cloud_readiness / plan_cloud_migration to grade the result and size what's left; compare_abap proves the rework didn't regress.
  5. Hand off — pair with SAP's official ADT MCP server or abap-adt-mcp for the in-system half (write, activate, ATC, a real ABAP Unit run) — see Related projects.

Tools

ToolWhat it does
lint_abapabaplint static analysis over ABAP/CDS/BDEF sources → structured findings with rule docs links. Presets: style (default, snippet-friendly), full, syntax-only; per-rule overrides for org rule packs; focus lens (Performance / Security / Styleguide) for themed reviews.
check_cloud_readinessDual-parse diff (classic baseline vs Cloud): statements that are valid today but illegal in ABAP Cloud become categorized blockers (dynpro, list output, native SQL, …) with a transparent score and a density-banded A–D tech-debt grade; code broken at the baseline is reported separately, not counted as migration work. Also surfaces a separate, dated released-API cross-check (releasedApiFindings): direct access to non-released classic tables and deprecated-API usage found in the source, with CDS successor hints — informational, not folded into the score.
fix_abapabaplint's own machine-applicable corrections, applied and verified: keyword casing, obsolete statements with defined modern replacements (MOVE → =, …). Batches re-parse after every pass and a batch that would break the parse is discarded — output is parser-guaranteed, never guessed. Unfixable findings return as remaining for judgment-tier rework (prove it with compare_abap).
plan_cloud_migrationThe task-manager layer over readiness: arranges every blocker into a phased, consulting-ordered backlog — repair-the-baseline first, then mechanical quick wins, core rework, UI re-architecture, and a separate snapshot-dated released-API phase. Each work item carries an S/M/L effort band, a remediation recipe and sample locations; each phase carries objective, re-checkable exit criteria. Deterministic: same readiness numbers, rearranged — no new judgments.
compare_abapBefore/after verdict on a rework: lint findings resolved vs introduced (matched by content, so moved code isn't noise), blocker/score/grade movement, and classes/methods/FORMs added or removed. The objective referee for refactors and AI rewrites.
check_released_apiLooks up objects (tables, CDS views, function modules, classes, …) in SAP's bundled per-edition Cloudification snapshots (edition: s4hc | btp | pce, default s4hc) → released / deprecated / not-released per object, plus SAP's own successor(s) when published, a curated CDS successor fallback for common classic tables, and a classicAPI/noAPI/internalAPI classification. The released-API half of readiness, offline.
scaffold_rap_boGenerates the canonical RAP managed-BO stack (root view, behavior definition strict(2) + optional draft, behavior class + handler locals, projection, metadata extension, OData V4 service definition) plus suggested table DDL, activation order and next steps.
scaffold_abap_unitGenerates the local ABAP Unit test class for each global class: setup + one skeleton test per public method, every skeleton failing loudly with a TODO so generated-but-empty tests can't masquerade as coverage. Round-tripped through abaplint with the class under test.
get_object_dependenciesDependency graph over the provided sources — parser-level table/function references (annotated with released-API state + CDS successors), inherits/implements structure, and honestly-labeled textual cross-references. Optional Mermaid flowchart. The sequencing companion to plan_cloud_migration.
list_abap_rulesBrowse abaplint's ~180 rules (filter by text or tag).
explain_abap_ruleOne rule in depth — rationale (often Clean ABAP), examples, docs URL.
format_abapOffline pretty-printer (keyword case + indentation).
get_abap_outlineClasses/methods/visibility/interfaces/FORMs of a source — navigate big objects without reading them whole. Optional Mermaid classDiagram output for instant structure visuals.
explain_abap_releaseBundled, dated (curated 2026-09-10) knowledge base of ABAP Cloud / CDS / RAP / EML / ATC release deltas across the 2502–2608 trains plus ABAP Platform 2025 — each row an original summary with a cited SAP source URL and a confirmed / reported confidence flag; filter by sinceRelease, product, kind.
search_sap_knowledgeFree-text search over the same bundle plus Clean Core governance (Levels A–D, release contracts C0–C3, the real ATC vocabulary) and 7 SAP-AI decision cards (SAP-ABAP-1, Generative AI Hub, ABAP AI SDK, SAP's official ADT MCP server, …) — every hit carries its sources and confidence.
scaffold_abap_ai_sdkGenerates a validated ABAP class calling the Generative AI Hub through the ABAP AI SDK (ISLM): 7 interaction shapes (string, messages, prompt-template, function-calling, structured-output, streaming, orchestration), round-tripped through abaplint against abap-mcp's own bundled IF_AIC_* stubs (validated: "abaplint-syntax"); returns the manual ISLM setup steps it cannot perform itself.
get_abap_agent_rulesEmits the AGENTS.md / CLAUDE.md rules block for an ABAP repo: lint-before-commit, the readiness gate, released-API discipline, scaffold-first, the offline unit-test loop, and division of labour with an online ADT MCP server.
check_rap_behaviorChecks RAP behavior definitions (.bdef.asbdef) and CDS service definitions (.srvd.srvdsrv) with abap-mcp's own BDL/SDL parser and a 48-rule set (40 behavior rules including the structural tiers, 7 service-definition rules, 1 release gate) — abaplint deep-parses neither file type, so this is the only static feedback they get without a system. Covers the draft/etag/lock/authorization/numbering consistency set, strict-mode obligations, action/operation/validation/determination/side-effect coherence, projection use against the base BDEF, and service expose against the CDS entities you pass in the same call; with abapRelease it also gates constructs newer than that release. Two-tier by design: punctuation breakage is an error, a construct the grammar does not know is an info that says so.
run_abap_unit (opt-in — ABAP_MCP_ENABLE_RUN=1)Executes ABAP Unit tests offline: transpiles to JavaScript via @abaplint/transpiler against the bundled open-abap kernel and runs it in a sandboxed subprocess (server-owned temp dir, hard timeout, file access confined to that dir; network is not used but not blocked) — one pass/fail/error/skipped row per method, plus the honest static lint. Evidence about pure logic only — no DB/CDS/EML/AMDP/auth. Always available in the CLI as abap-mcp unittest --run.

Knowledge base & resources

A dated, cited SAP knowledge bundle ships with the package (curated 2026-09-10): 100 ABAP Cloud / RAP release-delta rows (2502–2608 trains + ABAP Platform 2025, plus pre-2502 chronology corrections so an agent can't present an established feature as a 2025-26 novelty), 55 Clean Core entries (Levels A–D, release contracts C0–C3, the real ATC vocabulary), and 7 SAP-AI decision cards (SAP-ABAP-1, Generative AI Hub orchestration, the ABAP AI SDK, Joule for Developers, SAP's official ADT MCP server, …). Every row is abap-mcp's own original summary over a cited source with a confirmed / reported confidence flag — never copied SAP prose (see the licensing boundary in docs/DESIGN.md).

Reach it as tools (explain_abap_release, search_sap_knowledge; CLI release / knowledge) or as MCP resources a host can attach directly to a conversation: abap-mcp://knowledge/manifest (provenance for every bundled file), .../release-deltas, .../clean-core, .../sap-ai (whole files), and .../release/{id}, .../clean-core/{id}, .../sap-ai/{id} (individual cards, each returned as both application/json and text/markdown).

Honesty box — what this is not

  • Not ATC. The objective readiness score is still language-level: statements ABAP Cloud removed. Released-API coverage is now partial, offline, and edition-aware: check_released_api and the releasedApiFindings in readiness reflect SAP's published Cloudification lists as of the bundled snapshot date — one per SAP edition (s4hc Public Edition, btp, pce Private Edition / on-prem; edition param, default s4hc) — they cover tables and function modules referenced in your source, not every API, and are only as current as the snapshot. A target system's own ATC check ("Usage of Released APIs (Cloudification Repository)" for Public Edition / "Usage of APIs (Cloudification Repository)" for Private Edition & on-prem, via check variants such as ABAP_CLEAN_CORE_DEVELOPMENT / ABAP_CLEAN_CORE_READINESS) remains authoritative; treat an "absent from the list" result as "not released as of the snapshot", not as proof. The readiness report's grade is our own blocker-density banding (gradeMeaning: "blocker-density"), not SAP's Clean Core Level A–D — see cleanCoreVocabulary on the report for the real ATC vocabulary (src/data/atc-vocabulary.json).
  • Scaffold validation is tiered. Generated classes and CDS views are round-tripped through abaplint at Cloud level before they're returned (the generator and the linter share one parser). Behavior and service definitions are outside abaplint's checked surface, so they run through abap-mcp's own RAP checker instead and are labeled validated: "rap-checker" when it returns nothing at error or warning severity; the metadata extension has no checker at all and stays "template". Each generated file is labeled validated: "abaplint" | "rap-checker" | "template", and ADT activation is still the final arbiter.
  • The RAP checker is our own grammar, not SAP's parser. check_rap_behavior (and the rap/… findings merged into lint_abap) reads BDEF/SRVD with a tokenizer and grammar this project wrote from SAP's published RAP BDL feature tables, the ABAP keyword documentation, and a 102-file corpus of Apache-2.0 SAP sample sources. Every report carries grammarVersion, rulesVersion and a scopeNote saying what that does and does not prove: it cannot see DDIC tables, behavior-pool classes or CDS field types, and constructs it does not recognise are reported as info, never as errors. Rules derived from anything weaker than SAP documentation are capped at warning and carry their provenance in the message. Every shipped rule is documented in docs/RAP-RULES.md.
  • run_abap_unit is not SAP's kernel. It transpiles to JavaScript and executes on the open-abap kernel (opt-in, ABAP_MCP_ENABLE_RUN=1; always on in the CLI via unittest --run) — no database (any ABAP SQL aborts the method), no CDS, no EML/RAP runtime, no AMDP, no authority checks, no locks, no ATC, no activation. A green run is evidence about pure logic, never proof of system behavior; constructs it cannot execute come back in unsupported, never as a silent pass.
  • scaffold_abap_ai_sdk is checked against abap-mcp's own stubs, not SAP's real API. Generated classes are round-tripped through abaplint against bundled IF_AIC_* / CL_AIC_* declarations this project wrote from SAP's documentation, not SAP source — labeled validated: "abaplint-syntax", meaning the ABAP parses, not that it matches SAP's actual ABAP AI SDK signatures exactly. The manual ISLM setup it depends on (SAP_COM_0A69, INTS/INTM) is listed in setupSteps, never performed.
  • Text-in only, by design. The analysis engine does no user-filesystem walking or outbound network access; it parses strings you explicitly pass. With stdio those strings are handled by the local child process. With Streamable HTTP they travel to the endpoint operator, so use HTTPS, authentication, and the documented privacy controls. For whole directories, use the CLI below, abaplint in CI, or the mcp-kit wrap-abaplint recipe.

Develop

bash
npm installnpm run check     # typecheck + tests + build + routing eval — the CI gatenode dist/cli.js  # stdio MCP servernpm run start:http # guarded Streamable HTTP on http://127.0.0.1:3000/mcpnpx @modelcontextprotocol/inspector --cli node dist/cli.js --method tools/list

Tool and prompt descriptions are CI-graded (a rubric test enforces verb-first names, when-to-use, non-goals, described params, worked examples — the mcp-kit discipline).

Design

The decision log — why offline, why abaplint, why a dual-parse readiness diff, why the scaffolder validates its own output, what was deliberately left out — lives in docs/DESIGN.md.

Online companion: abap-mcp-genai

A separate, opt-in binary — abap-mcp-genai, never imported by the default server — wraps SAP's Generative AI Hub orchestration service using your own SAP AI Core tenant: explain_with_sap_abap_1 (ask SAP's own ABAP-tuned model to explain a class, method or snippet) and list_genai_hub_models. Your ABAP source leaves this machine when you use it — it goes to SAP infrastructure under your organization's own SAP AI Core contract, never to abap-mcp's authors. Read docs/GENAI.md in full before enabling it.

Related projects

  • abap-kit by Furkan Coşgun (MIT) — a CLI that scaffolds complete offline ABAP projects (abapGit layout, abaplint + transpiler config, the open-abap runtime) and can execute ABAP Unit tests locally via the abaplint transpiler. Complementary by design: abap-kit builds and runs the project harness; abap-mcp gives your AI agent the analysis, planning and scaffolding tools inside it — abap-kit create + abap-mcp setup is a complete offline ABAP+AI workspace. Its transpile-and-run pipeline previewed what run_abap_unit (v0.11) now ships natively in this server, on the same abaplint transpiler + open-abap-core foundation.
  • SAP's official ADT MCP server (GA, ships inside ADT for Eclipse and VS Code; 20 tools across 8 toolsets, 18 licence-free) — writes, activates and tests ABAP in a real system (abap_creation-create_object, abap_activate_objects, abap_run_unit_tests, abap_run_atc, …), with no offline lint, readiness grade or released-API cross-check of its own.
  • abap-adt-mcp by Willian Saez (MIT) — the community equivalent, 173 online tools over the same ADT REST API, same live-system trust model.
  • Pairing. abap-mcp verifies offline, before and after: lint_abap / check_cloud_readiness / compare_abap on code before it is written to a system, then again on what SAP's official server or abap-adt-mcp just wrote, activated or ran ATC against. Neither online server needs abap-mcp, and abap-mcp never needs credentials — see the recipe in docs/COOKBOOK.md and get_abap_agent_rules for the rule text to paste into a repo's AGENTS.md.

Credits

  • abaplint by Lars Hvam — the parser and rule engine underneath every tool here (MIT).
  • SAP/abap-atc-cr-cv-s4hc — SAP's official ABAP Cloudification Repository (object release list), Apache-2.0. The bundled released-API snapshot (src/data/released-apis.json, refreshed with each weekly release — tool output carries its snapshotDate) is a compact transform of that data, redistributed under Apache-2.0 with attribution; see docs/DESIGN.md and scripts/build-released-api-index.mjs for the pipeline.
  • mcp-kit — the production-MCP patterns this server follows (typed tool specs, transport discipline, description lint).

MIT © Akshay Palimkar. Not affiliated with or endorsed by SAP SE. "SAP", "ABAP" and "RAP" are trademarks of SAP SE; this is an independent open-source tool for developers working with them.

來源:README.md,提交 6b6c5cc

工具

18

lint_abap

Lint ABAP source

Run abaplint static analysis over ABAP, CDS or behavior-definition sources and return structured findings (rule key, message, severity, file/line/column, the offending line, and a docs URL per finding). Use this when you have written or modified ABAP code and want style and correctness feedback before it goes anywhere near a system — it runs entirely offline on the provided text. It does not connect to any SAP system, does not run ATC, and cannot judge whether referenced objects exist unless you provide them in the same call (preset "style", the default, skips whole-program checks for that reason; preset "full" enables them when you provide every dependency). A focus tag turns a pass into a themed review (performance / security / Clean ABAP style) without hand-picking rules; rule overrides layer a team's own pack on top. For an ABAP-Cloud migration verdict use check_cloud_readiness instead. When the call contains a .bdef.asbdef or .srvd.srvdsrv file, abap-mcp's own RAP checker also runs over the whole set and its findings are merged in under rap/ rule keys (abaplint does not deep-parse those file types, so without this they would silently produce nothing); set rapCheck:false to opt out, or call check_rap_behavior for the full structured RAP report with hints, confidence and the scope note. Example: lint_abap({ "files": [ { "source": "REPORT ztest.\nDATA foo TYPE i.\nIF foo = 1.\nENDIF." } ] }).

輸入參數files必填focusrulespresetrapCheckabapVersion

fix_abap

Fix ABAP automatically (deterministic)

Apply abaplint's own machine-applicable corrections to ABAP sources and return the corrected code: keyword casing, obsolete statements with defined modern replacements (MOVE → =, and every other rule that ships a concrete edit), applied in verified batches — after each batch the result is re-parsed, and a batch that would break the parse is discarded, so the output is parser-guaranteed, never guessed. Findings WITHOUT a machine fix come back in `remaining` — those need judgment (yours or an agent's, proven afterwards with compare_abap). Use this when someone highlights code and wants it corrected to best practices / modern syntax instantly, as the mechanical first pass before any AI rewriting, or to modernize a file before review. It does not invent rewrites (only fixes abaplint defines), does not resolve cloud blockers that need re-architecture (dynpro, WRITE output — see plan_cloud_migration), and is not a formatter (format_abap pretty-prints without changing statements). Example: fix_abap({ "files": [ { "source": "report zdemo.\ndata lv_x type i.\nmove 5 to lv_x." } ] }).

輸入參數files必填rulespresetabapVersion

check_cloud_readiness

Check ABAP Cloud readiness

Assess how far ABAP source is from ABAP Cloud (Clean Core tier 1) by parsing it twice — once at a classic baseline (default v758) and once at version Cloud — and diffing: findings that appear only at Cloud are genuine cloud blockers (statements ABAP Cloud removed), reported in categories (dynpro, list output, native SQL, report events, …) with a transparent score, an A–D tech-debt grade and a verdict; findings already present at the baseline are reported separately as broken code, not migration work. It also reports snapshot-dated released-API observations for direct table and function-module references the parser can extract; those stay separate from the language-level blocker count and score. Use this when someone asks 'is this code cloud-ready / Clean Core compliant / S/4HANA-cloud safe', before porting classic ABAP into an ABAP Cloud environment, or for a graded tech-debt assessment of an abapGit export. It is static and parser-level: its released-API scan is not exhaustive dependency discovery, it does not connect to any SAP system or run ATC, and a 'ready' verdict means no detected language-level blockers — not a certification. Our A–D grade is blocker density (see gradeMeaning), NOT SAP's own Clean Core Level A–D; a target system's own released-API ATC check ("Usage of Released APIs (Cloudification Repository)" for SAP Cloud ERP Public Edition / "Usage of APIs (Cloudification Repository)" for SAP Cloud ERP Private Edition / on-premise, via variants such as ABAP_CLEAN_CORE_DEVELOPMENT / ABAP_CLEAN_CORE_READINESS) remains authoritative. Example: check_cloud_readiness({ "files": [ { "source": "REPORT zold.\nWRITE: / 'hi'." } ] }).

輸入參數files必填editionbaselineVersion

plan_cloud_migration

Plan an ABAP Cloud migration

Turn ABAP sources into an ordered, phased ABAP Cloud migration backlog: runs the same dual-parse analysis as check_cloud_readiness, then arranges every blocker into per-object work items across consulting-ordered phases — repair-the-baseline first (broken code is not migration work), then mechanical quick wins, core rework of removed statements, UI/output re-architecture, and a separate snapshot-dated released-API remediation phase. Each work item carries an S/M/L effort band, a remediation recipe and sample locations; each phase carries a goal and objective, re-checkable exit criteria. Use this when someone asks 'plan the migration', 'what do we tackle first', or wants a work breakdown / task backlog instead of raw findings — the natural next call after check_cloud_readiness says rework is needed. It is a deterministic re-arrangement of the readiness analysis: it does not estimate person-days, does not modify any code, and inherits every readiness limitation (static, parser-level, snapshot-dated released-API data — a system's ATC stays authoritative). Example: plan_cloud_migration({ "files": [ { "source": "REPORT zold.\nWRITE: / 'hi'.\nCALL SCREEN 100." } ] }).

輸入參數files必填editionbaselineVersion

compare_abap

Compare two ABAP versions

Compare a BEFORE and an AFTER version of ABAP source and report what a rework actually changed: lint findings resolved and introduced (matched by content, so moved-but-unchanged code is not noise), cloud-blocker / score / A–D grade movement from the same dual-parse diff as check_cloud_readiness, and structural changes — classes, methods and FORMs added or removed. Use this when reviewing a refactor, a modernization step or an AI-generated rewrite of an existing object and you need an objective better-or-worse verdict instead of eyeballing a diff. It is not a textual diff tool (use git diff to see the edits) and it cannot judge functional equivalence — behavior can change while every number improves; it does not connect to any SAP system. Example: compare_abap({ "before": [ { "source": "REPORT zr.\nWRITE 1." } ], "after": [ { "source": "REPORT zr.\nWRITE 2." } ] }).

輸入參數after必填focusrulesbefore必填presetabapVersion

scaffold_rap_bo

Scaffold a RAP business object

Generate the complete, canonical RAP managed business-object stack for one root entity: root CDS view entity, behavior definition (managed, strict(2), optional draft), behavior implementation class with handler locals, projection view with transactional_query, projection behavior definition, UI metadata extension, and an OData V4 service definition — plus a suggested table DDL, the activation order, and next steps. Use this when starting a new RAP business object in ABAP Cloud or S/4HANA and you want correct boilerplate that follows the SAP /DMO reference shape instead of writing it by hand. Generated classes and CDS views are round-trip validated through abaplint at ABAP-Cloud level before being returned; behavior and service definitions are canonical templates (abaplint does not parse those deeply) and ADT activation is the final check. It does not create the table or the service binding (binding is not a source artifact — create it in ADT), and it generates single-entity BOs: model compositions (parent-child) yourself for now. Example: scaffold_rap_bo({ "entityName": "Travel", "sqlTable": "ztravel", "keyField": "travel_id", "fields": [ { "name": "agency_id", "type": "abap.char(6)" } ], "draft": true }).

輸入參數draftfieldsprefixkeyField必填sqlTable必填entityName必填managedUuidKey

scaffold_abap_unit

Scaffold ABAP Unit test classes

Generate the local ABAP Unit test-class include (<class>.clas.testclasses.abap) for each global class in the provided sources: a FOR TESTING class (RISK LEVEL HARMLESS, DURATION SHORT) with a setup method that instantiates the class under test and one skeleton test method per public method. Every skeleton fails loudly with cl_abap_unit_assert=>fail('TODO …') so generated-but-empty tests can never masquerade as coverage; abstract classes and parameterized constructors get TODO guidance instead of a blind NEW #( ). Generated code is round-tripped through abaplint together with the class under test before being returned. Use this when a class has no tests yet and you want a correct, ready-to-fill test harness — the natural first step of test-driven rework and the 'add tests before we migrate this' consulting task. It does not invent assertions or test data (the given/when/then substance is yours or the agent's to write), does not create test doubles, and cannot run the tests — ADT/CI does that. Example: scaffold_abap_unit({ "files": [ { "filename": "zcl_travel.clas.abap", "source": "CLASS zcl_travel DEFINITION PUBLIC.\n…" } ] }).

輸入參數files必填abapVersion

get_object_dependencies

Get a dependency graph of ABAP objects

Build a dependency graph over the provided ABAP sources for migration sequencing and impact reading: nodes are the provided objects plus every DB table / function module they reference (annotated with released-API state and CDS successor from the bundled SAP snapshot); edges are tiered by how they were derived — parser-level db-access and call-function references, structural inherits/implements from class definitions, and word-boundary references-textual matches between the provided objects. Optional Mermaid flowchart output. Use this when deciding what to migrate first (leaves before roots), what a rework might break, or which objects pull non-released tables into the picture — the sequencing companion to plan_cloud_migration. It is not a system where-used list: it only sees the text you pass, textual edges cannot see dynamic calls, and an absent edge is not proof of independence — a system's where-used and ATC remain authoritative. Example: get_object_dependencies({ "files": [ { "filename": "zcl_a.clas.abap", "source": "…" }, { "filename": "zcl_b.clas.abap", "source": "…" } ], "mermaid": true }).

輸入參數files必填editionmermaidabapVersion

check_released_api

Check ABAP released-API status

Look up ABAP repository objects (DB tables, CDS view entities, function modules, classes, interfaces, …) in SAP's published ABAP Cloudification list and report, per object, whether it is a 'released' API (safe to use in ABAP Cloud / Clean Core), 'deprecated' (released but being retired), or 'not-released' (a classic/internal object that is not a public API — e.g. most classic DDIC tables) — with SAP's own successor(s) when the snapshot has any, a curated CDS successor hint otherwise, and a classicAPI/noAPI/internalAPI classification where SAP publishes one. This reflects SAP's official per-edition Cloudification lists as bundled in this package (default edition "s4hc", snapshot 2026-10-26); it ships offline with the server. Use this when you need to know if your code may reference a given object in ABAP Cloud, or which released CDS view to use instead of a classic table. This explicit lookup complements check_cloud_readiness's limited, source-extracted released-API observations and can check objects that do not appear in the supplied source. It does not connect to any SAP system, does not run ATC, and is only as current as the bundled snapshot — a target system's own released-API ATC check ("Usage of Released APIs (Cloudification Repository)" for SAP Cloud ERP Public Edition / "Usage of APIs (Cloudification Repository)" for SAP Cloud ERP Private Edition / on-premise, via variants such as ABAP_CLEAN_CORE_DEVELOPMENT / ABAP_CLEAN_CORE_READINESS) remains authoritative; treat an 'absent from the list' result as 'not-released as of the snapshot', not as proof. Example: check_released_api({ "objects": ["MARA", "I_Product", "BAPI_MATERIAL_GET_DETAIL"] }).

輸入參數editionobjects必填

list_abap_rules

List abaplint rules

List the abaplint rules this server can check, optionally filtered by a free-text query or a tag, returning key, title, one-line description, tags and a documentation URL per rule. Use this when deciding which rules to enable or override in lint_abap, or to discover what a Clean-ABAP-style check exists for. It does not run any analysis and does not change configuration — it is a read-only catalog. Example: list_abap_rules({ "query": "obsolete" }).

輸入參數tagquery

explain_abap_rule

Explain an abaplint rule

Explain one abaplint rule in depth: title, description, extended rationale (often citing the Clean ABAP style guide), tags, documentation URL, and good/bad code examples where the rule defines them. Use this when a lint_abap or check_cloud_readiness finding needs justification — to explain to a developer why the finding matters and how to fix it. It does not run analysis and only knows abaplint rules; SAP ATC check documentation is out of scope. Example: explain_abap_rule({ "rule": "exit_or_check" }).

輸入參數rule必填

format_abap

Format ABAP source

Pretty-print one ABAP source: normalize keyword casing and indentation using abaplint's formatter — the offline equivalent of Pretty Printer in ADT/SE80. Use this when generated or hand-written ABAP has inconsistent casing/indentation and you want it normalized before review or commit. It does not reformat CDS views or behavior definitions, does not change any logic, and fails cleanly on source it cannot parse. Example: format_abap({ "source": "report ztest.\nwrite 'hi'." }).

輸入參數source必填filename

get_abap_outline

Get ABAP source outline

Return the structural outline of ABAP sources — classes (with methods, visibility, attributes, interfaces, inheritance), interfaces, and FORM routines — without you having to read the whole file. Use this when navigating a large class or legacy program to decide which part to read or edit next; it is the cheap first call before pulling thousands of lines into context. Set mermaid: true to also get the structure as a Mermaid classDiagram (inheritance, interface realization, method visibility) for documentation visuals. It does not return method bodies or analyze code quality (use lint_abap for that), and CDS/behavior-definition files yield an empty outline. Example: get_abap_outline({ "files": [ { "filename": "zcl_big.clas.abap", "source": "CLASS zcl_big DEFINITION…" } ] }).

輸入參數files必填mermaid

explain_abap_release

Explain ABAP Cloud / RAP release deltas

Look up what changed in ABAP Cloud, CDS, ABAP SQL, RAP, EML, ABAP Unit, ATC and the development tools across the 2502 to 2608 release trains plus ABAP Platform 2025 (SAP_BASIS 816), from a dated knowledge base bundled with this package. Each row carries an original summary, an optional syntax sketch, the release and ABAP release, the products it was verified for, the cited SAP source URL, and a confidence flag ("confirmed" = fact-checked, "reported" = single-source). Use this when you are about to write or review ABAP and need to know whether a language, CDS or RAP feature exists in the target release — for example before using CDS table entities as draft persistence, BUFFER ON, RAP change documents, global side effects, or a feature-control attribute. Filter by sinceRelease to see only what is new since the customer's current level. Rows flagged pre-2502 exist to stop an agent presenting an established feature (business events, late numbering, prechecks, bgPF) as a 2025-26 novelty. It does not connect to any SAP system, does not read release notes live, and is not a complete changelog — it is a curated snapshot (curated 2026-09-10) and the target system's own release notes stay authoritative. For released-API state of a specific object use check_released_api; for Clean Core levels and ATC vocabulary use search_sap_knowledge. Example: explain_abap_release({ "sinceRelease": "2605", "kind": "rap" }).

輸入參數kindlimittopicproductsinceRelease

search_sap_knowledge

Search the bundled SAP knowledge base

Search one dated, cited knowledge bundle covering three areas: ABAP Cloud / RAP release deltas, Clean Core governance (SAP's extensibility Levels A-D, release contracts C0 to C4, the real ATC check and variant names, and the SAP/abap-atc-cr-cv-s4hc Cloudification Repository file and schema inventory), and decision cards for the SAP AI options an ABAP team can reach (SAP-ABAP-1, the Generative AI Hub orchestration API, the ABAP AI SDK powered by ISLM, Joule for Developers, SAP's official ADT MCP server, the custom code migration agent, and the community MCP ecosystem). Every hit returns its sources, a confidence flag and the full card. Use this when a question is about SAP facts rather than about a piece of source text — which Clean Core level a pattern lands in, what a C1 release contract guarantees, which ATC variant to run, whether SAP-ABAP-1 accepts a system prompt, which classes the ABAP AI SDK exposes, or what SAP's own MCP server can and cannot do. It does not connect to any SAP system, does not run ATC, does not fetch anything live, and is not a substitute for a real ATC run or for SAP's own documentation — it is a curated snapshot (curated 2026-09-10) and the target system and SAP's current documentation stay authoritative. For release-timeline questions prefer explain_abap_release; for the release state of a specific object use check_released_api; to analyze actual source text use lint_abap or check_cloud_readiness. Example: search_sap_knowledge({ "query": "sap-abap-1 system prompt" }).

輸入參數arealimitquery必填

scaffold_abap_ai_sdk

Scaffold an ABAP AI SDK (ISLM) class

Generate one validated global ABAP class that calls the SAP Generative AI Hub through the ABAP AI SDK powered by Intelligent Scenario Lifecycle Management (ISLM) — SAP's own client library, not a third-party SDK with a similar name. Seven interaction shapes: "string" (single prompt via EXECUTE_FOR_STRING), "messages" (system/user/assistant turns plus token-count/finish-reason retrieval), "prompt-template" (CL_AIC_ISLM_PROMPT_TPL_FACTORY, never the non-existent CL_AIC_PROMPT_TEMPLATE), "function-calling" (the tool-call DO-loop, with the upstream SAP sample's undeclared-tool_calls bug fixed — the table is declared and populated before ADD_TOOL_RESULTS), "structured-output" (DEFINE_RESPONSE_FORMAT->JSON_SCHEMA->FROM_STRING), "streaming" (IF_AIC_ADT_COMPLETION_API delta loop), and "orchestration" (the separate Orchestration API, which does not yet support structured output, function calling or media input). Every generated class carries an injectable constructor seam (an OPTIONAL api parameter) so it can be unit-tested with cl_abap_testdouble instead of a live ISLM scenario; pass withUnitTest for a FOR TESTING skeleton using that seam. Generated files are round-tripped through abaplint (version Cloud, preset syntax-only) together with abap-mcp's own bundled stub declarations of the referenced IF_AIC_*/CL_AIC_*/CX_AIC_* types, labelled validated:"abaplint-syntax" — this proves the ABAP parses, not that it matches SAP's real API surface exactly. Use this when you are adding a Generative-AI-Hub call to ABAP Cloud code and want correct, cited API shapes instead of guessing class/method names from memory (a common LLM hallucination surface — e.g. inventing CL_AIC_PROMPT_TEMPLATE, or copying SAP's own buggy function-calling sample verbatim). It does NOT call any LLM, does NOT deploy or activate anything, and does NOT create the SAP_COM_0A69 communication arrangement or the Intelligent Scenario (INTS/INTM) itself — those are manual ISLM/BTP-cockpit steps returned in setupSteps

輸入參數prefixclassNamefunctionsinteraction必填scenarioName必填withUnitTest

get_abap_agent_rules

Get the AGENTS.md rules block for an ABAP repo

Generate the ABAP section of a repository's AGENTS.md / CLAUDE.md: the lint-before-commit rule, the ABAP Cloud readiness gate, released-API discipline, scaffold-first, the offline unit-test loop, and the division of labour with an online ADT MCP server. Use this when you set up a new ABAP repo for agentic development or want a team's coding-agent rules to reference the abap-mcp tools consistently. It does not write the file (paste the returned markdown yourself), does not read the workspace, and is not a substitute for the project's own conventions — it encodes the tool contract, nothing project-specific beyond the parameters you pass. Example: { "target": "Cloud", "pairedWith": ["sap-adt-mcp"], "runEnabled": true }.

輸入參數targeteditionpairedWithrunEnabledpackagePrefix

check_rap_behavior

Check a RAP behavior/service definition

Check RAP behavior definitions (.bdef.asbdef) and CDS service definitions (.srvd.srvdsrv) for syntax and structural-consistency defects, offline, using abap-mcp's own BDL/SDL parser — abaplint does not deep-parse either file type (it stores a BDEF behind a single regex and a SRVD not at all), so this is the only static feedback these files get without a system. Reports the draft/etag/lock/authorization/numbering consistency set, strict-mode obligations, action/operation/validation/determination/side-effect coherence, projection 'use' statements against the base BDEF, and service 'expose' sets against the CDS entities you pass in the same call; with abapRelease set, it also flags constructs newer than that release from a bundled, dated copy of SAP's RAP BDL feature table. Use this when you have written or generated a BDEF/SRVD (by hand, from scaffold_rap_bo, or from a model that may have invented RAP syntax) and want it checked before it reaches ADT — and pass the base BDEF and the .ddls.asddls views alongside it, because the cross-file rules only run on files present in the call. It does NOT connect to SAP, does not activate anything, does not run ATC, cannot see DDIC tables, behavior-pool classes or CDS field types, and cannot certify that ADT would accept the file — the grammar is derived from SAP's published feature tables plus a 102-file corpus of Apache-2.0 SAP sample sources, so constructs it does not recognise are reported as info, never as errors. For ABAP classes use lint_abap; for a new BO use scaffold_rap_bo; for what a release added use explain_abap_release. Example: check_rap_behavior({ "files": [ { "filename": "zr_travel.bdef.asbdef", "source": "managed implementation in class zbp_travel unique;\nstrict ( 2 );\nwith draft;\n\ndefine behavior for ZR_Travel alias Travel\npersistent table ztravel\nlock master\n{ create; }\n" } ], "abapRelease": "2508" }).

輸入參數files必填strictabapRelease

版本歷史

5
  1. v0.12.7最新Oct 26, 2026
  2. v0.12.6Oct 19, 2026
  3. v0.12.5Oct 12, 2026
  4. v0.12.4Oct 5, 2026
  5. v0.12.0Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分