abap-mcp
An MCP server that lets AI coding agents inspect, review, lint, and test ABAP code stored as abapGit files without an SAP system.
List classes, interfaces, and programs in an abapGit project folder.
Outline an object's methods, signatures, visibility, attributes, test classes, and method line ranges.
Review ABAP snippets or workspace objects against Clean ABAP conventions and get actionable fixes citing the style guide.
Run full static analysis with abaplint for syntax, types, obsolete statements, and naming (requires Node.js).
Execute ABAP Unit tests via the Node.js/abaplint transpiler and get pass/fail counts and failing test names (requires Node.js).
Work within a sandboxed workspace root; tool errors are returned as results, and all tools except
run_testsare marked read-only.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@abap-mcp review zcl_invoice for Clean ABAP violations"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
abap-mcp
An MCP server that lets AI coding agents read, review and test ABAP code without an SAP system.
AI coding agents are good at Python and TypeScript because they can explore a codebase, run a linter and run the tests. ABAP code usually lives inside an SAP system, so an agent gets none of that. It writes code blind, and a human finds the problems after a transport.
abap-mcp closes that gap for code stored as abapGit files. An agent (Claude, GitHub Copilot, Kilo Code, Cline...) can list the objects in a repository, outline a class before changing it, review its own output against Clean ABAP, run full static analysis, and execute ABAP Unit tests, all on a laptop.
Tools
Tool | What the agent gets | Needs |
| Every class, interface and program in an abapGit folder, with its files | Python |
| Methods with visibility and full signature, attributes, test classes, and the line range of every method body | Python |
| A fast Clean ABAP review of a snippet or an object. Each finding has a fix and cites the style guide section | Python |
| Full static analysis with abaplint: syntax, types, obsolete statements, naming | Node.js |
| ABAP Unit tests executed on Node.js through the abaplint transpiler, with pass/fail counts and failing test names | Node.js |
The rule catalog is also exposed as the MCP resource abap-mcp://rules.
Related MCP server: CodePulse MCP Server
Example
The agent has just written this and asks for a review before saving it:
METHOD calculate.
DATA lv_sum TYPE i.
MOVE iv_amount TO lv_sum.
IF NOT lv_sum IS INITIAL.
ev_total = lv_sum.
ENDIF.
ENDMETHOD.check_conventions answers with something the agent can act on directly:
[
{ "rule": "no-hungarian-notation", "line": 2,
"message": "'lv_sum' encodes its scope or type in a prefix",
"suggestion": "Name it for what it holds, e.g. 'sum'" },
{ "rule": "no-obsolete-statements", "line": 3,
"message": "'MOVE' is obsolete", "suggestion": "Use an assignment: target = source." },
{ "rule": "prefer-is-not", "line": 4,
"message": "Negation placed before the operand", "suggestion": "Write 'lv_sum IS NOT ...'" }
]Then run_tests on a project like jakkwi/SAP returns {"passed": true, "tests_passed": 21, "tests_total": 21, ...}. The agent has verified its change without anyone opening SAP GUI.
Quick start
Requires Python 3.11+. Node.js 20+ is optional and enables lint and run_tests.
pipx install git+https://github.com/jakkwi/abap-mcp
# or run it without installing:
uvx --from git+https://github.com/jakkwi/abap-mcp abap-mcp --root path/to/abap/repoConnect an agent
Claude Code
claude mcp add abap -- abap-mcp --root /path/to/abap/repoClaude Desktop, Kilo Code, Cline (mcpServers in the client's MCP settings file):
{
"mcpServers": {
"abap": {
"command": "abap-mcp",
"args": ["--root", "/path/to/abap/repo"]
}
}
}VS Code with GitHub Copilot (.vscode/mcp.json):
{
"servers": {
"abap": { "command": "abap-mcp", "args": ["--root", "${workspaceFolder}"] }
}
}To share one server across a team, run it over HTTP instead of stdio:
abap-mcp --root /srv/abap --http --host 0.0.0.0 --port 8000 # endpoint: /mcp
# or
docker build -t abap-mcp . && docker run -p 8000:8000 -v "$PWD:/workspace" abap-mcpThe server has no authentication of its own: bind it to 0.0.0.0 only on a network you trust.
The Docker image includes Node.js and abaplint, so lint and run_tests work inside it. It serves HTTP on port 8000 with the mounted folder as the workspace root.
Configuration
Setting | Default | Effect |
|
| Workspace root. Tool paths must stay inside it. |
| off (stdio) | Serve Streamable HTTP instead of stdio |
|
| HTTP bind address |
|
| abaplint timeout in seconds; each npm step gets three times this |
| unset | Command used to run abaplint. Otherwise |
How it works
The full picture (modules, request flow, external tools) is in docs/architecture.md.
flowchart LR
A[AI agent] -- MCP: stdio or HTTP --> S[abap-mcp server]
S --> W[Workspace<br/>path sandbox, abapGit layout]
W --> P[Statement splitter<br/>+ outline]
P --> R[Clean ABAP rules]
S --> L[abaplint CLI]
S --> T[npm test<br/>transpiler + ABAP Unit]Statement splitter (
source.py). ABAP statements end with a period, except when the period sits in a string literal, a string template, a comment or a member access. A single pass with explicit state handles all of these, keeps line numbers, and attaches ABAP Doc comments to the statement they document.Outline (
outline.py). Turns statements into classes, interfaces, methods and attributes. The signature parser knows that inIMPORTING a TYPE REF TO zif_x b TYPE STANDARD TABLE OF t WITH EMPTY KEYthe parameters areaandb, notzif_xort.Rules (
rules.py). Each rule is a small generator registered with a decorator, so adding a check is one function and one test.Workspace (
workspace.py). Every path arrives from a language model, so it is untrusted. Paths are resolved and must stay inside the root the server was started with:../, absolute paths and symlinks pointing outside are refused.Toolchain (
tooling.py). Runs abaplint and npm as subprocesses with timeouts and without a shell. When Node.js is missing, the result says so and the pure-Python tools keep working.
Design decisions
Two levels of checking.
check_conventionsis instant and works on a snippet that has not been saved yet, which suits an agent iterating in a loop.lintis slower, needs Node.js and understands types. Agents use the first constantly and the second before finishing.Errors are results, not exceptions. An unknown object or a bad path comes back as
{"error": "..."}, so the agent can correct itself instead of failing the whole call.Read-only by default. Every tool except
run_testscarries the MCPreadOnlyHint, so clients can auto-approve them.No SAP system, no vendor code. Everything runs on open-source tooling. All sample ABAP in this repository is original.
Development
pip install -e ".[dev]"
pytest # 46 tests; the abaplint tests run when Node.js is available
ruff check . && ruff format --check .
mypy src # strictThe tests drive the server through a real MCP client, the same way an agent does.
Project layout
Path | Contents |
| The package: |
| pytest suite; |
| |
| Image with Python, Node.js and abaplint, serving HTTP on port 8000 |
| Lint, type check, tests on Python 3.11 to 3.13, Docker build |
Documentation
Doc | What it covers |
Modules, how a tool call flows through them, Node.js tooling, configuration, external contracts | |
Why the code works on abapGit files, has its own Python rules, and runs Node.js tools as optional subprocesses |
Roadmap
Read objects directly from an SAP system over the ADT REST API, as an optional backend
More rules: magic numbers, nested IF depth, SELECT in loops
Quick fixes returned as text edits the agent can apply
License
MIT. See LICENSE.
Available Tools
5 toolscheck_conventionsARead-onlyIdempotent
Review ABAP against Clean ABAP conventions. Fast and needs no Node.js.
Pass either source (a snippet you just wrote) or object_name (an
object in the workspace). Each finding cites the style guide section.
Args: source: ABAP source text to review. object_name: Name of an object in the workspace to review instead. path: Project folder relative to the workspace root. max_method_statements: Statement limit for a single method.
Inputs: path, source, object_name, max_method_statements. Returns: result
lintARead-onlyIdempotent
Run abaplint static analysis (syntax, types, obsolete code, naming).
Lints source when given, otherwise the project at path, using the
project's own abaplint.json if it has one. Requires Node.js.
Args: source: ABAP source text to lint instead of a project. path: Project folder relative to the workspace root.
Inputs: path, source. Returns: result
list_objectsBRead-onlyIdempotent
List the ABAP objects (classes, interfaces, programs...) in an abapGit folder.
Args: path: Project folder relative to the workspace root.
Inputs: path. Returns: result
outline_objectBRead-onlyIdempotent
Describe a class or interface: methods with visibility and signature, attributes, test classes, and the line range of every method body.
Args: object_name: Object name, e.g. ZCL_ORDER_TOTAL. path: Project folder relative to the workspace root.
Inputs: object_name (required), path. Returns: result
run_testsAIdempotent
Run the ABAP Unit tests of a project that executes them on Node.js
(abaplint transpiler + open-abap), via npm test. No SAP system needed.
Args: path: Project folder containing package.json. install: Reinstall npm dependencies before testing.
Inputs: path (required), install. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
list_objects (enumerate) and outline_object (describe one object) are clearly distinct, and run_tests is unambiguous. The only real overlap is check_conventions vs lint, both static-quality checks, though the descriptions differentiate them (Clean ABAP style-guide findings vs abaplint syntax/type/naming analysis).
Four of five tools follow a predictable verb_noun snake_case pattern (list_objects, outline_object, check_conventions, run_tests). 'lint' is a bare verb that breaks the pattern slightly but is still conventional and readable.
Five tools is a lean but reasonable surface for a read-only ABAP analysis server, and each tool has a distinct role. It sits slightly on the thin side, but nothing feels redundant or missing at the count level.
The analysis workflow (discover, outline, style-check, lint, test) is well covered for a read-only server. Minor gaps remain: no way to fetch an object's raw source and no object/code search, which agents can partially work around via outline_object and lint's source argument.
Maintenance
Related MCP Connectors
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Live GitHub repo AST X-Ray, 42 coding-agent DoD gates, Git worktree guards & brownfield baselines.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Checks AI-written code for leaked keys and made-up packages, on your machine. Never uploads code.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to perform code reviews by providing access to staged files, git diffs, and repository file content. It allows users to evaluate changes and context within any local git repository before committing or pushing.34 npmISC
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search code, inspect symbols, navigate call graphs, and analyze change impact across scoped local repositories through the same engine as the CLI and REST API.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to search and query local folders or public Git repositories using code-aware hybrid retrieval, returning answers grounded in exact path-and-line citations. It also provides Git history and pull-request exploration, change-impact analysis, and documentation-drift detection, with local indexing and embeddings that keep code on the user's machine.927 PyPIMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to analyze local source code, build and query a dependency graph, and suggest skeleton structures for new modules based on existing architectural patterns and conventions.MIT