Skip to main content
Glama

abap-mcp

CI Python License

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

list_objects

Every class, interface and program in an abapGit folder, with its files

Python

outline_object

Methods with visibility and full signature, attributes, test classes, and the line range of every method body

Python

check_conventions

A fast Clean ABAP review of a snippet or an object. Each finding has a fix and cites the style guide section

Python

lint

Full static analysis with abaplint: syntax, types, obsolete statements, naming

Node.js

run_tests

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: abap2UI5 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/repo

Connect an agent

Claude Code

claude mcp add abap -- abap-mcp --root /path/to/abap/repo

Claude 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-mcp

How it works

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 in IMPORTING a TYPE REF TO zif_x b TYPE STANDARD TABLE OF t WITH EMPTY KEY the parameters are a and b, not zif_x or t.

  • 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_conventions is instant and works on a snippet that has not been saved yet, which suits an agent iterating in a loop. lint is 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_tests carries the MCP readOnlyHint, 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            # strict

The tests drive the server through a real MCP client, the same way an agent does.

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 tools
check_conventionsA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo.
sourceNo
object_nameNo
max_method_statementsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent, closed-world behavior, so the bar is lower. The description adds genuinely useful context beyond them: 'Fast and needs no Node.js' (a performance/dependency trait) and 'Each finding cites the style guide section' (output behavior). It doesn't cover error handling when neither input mode is supplied.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the key operating constraint are front-loaded in the first two sentences, followed by a compact Args block that earns its space. Minor redundancy between the prose 'Pass either source ... or object_name' and the Args list, but no wasted sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return-value detail is not required, and annotations cover the safety profile, so the remaining burden is small. The one notable gap is that all four parameters are optional, and the description never says what happens if neither source nor object_name is provided or if both are.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must carry the full burden, and it does document all four parameters inline with meaning: source as ABAP text, object_name as a workspace object 'instead', path as a project folder relative to the workspace root, and max_method_statements as a per-method statement limit. It omits the default of 40 and the default path '.', but the semantics are otherwise self-sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Review ABAP against Clean ABAP conventions,' which an agent can act on immediately. It does not, however, differentiate itself from the sibling tool 'lint', which an agent could plausibly confuse it with for static analysis of ABAP code.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear usage context by explaining the two entry modes: 'source' for a snippet you just wrote versus 'object_name' for an object in the workspace. It offers no explicit exclusions or guidance on when to prefer this over 'lint', so it stops short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lintA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo.
sourceNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the description only needs to add context — and it does: it discloses the Node.js runtime requirement and that project configuration (abaplint.json) is auto-detected. It does not state failure modes when Node.js or config is absent, but the safety/idempotency profile is fully covered by annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then the source-vs-path selection rule, then a compact arg list. Every sentence earns its place; the Args block mildly duplicates wording already given in the paragraph above, keeping it just short of a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need no explanation, and the description covers the runtime prerequisite, config discovery, and both input modes. Sufficient for a two-parameter, zero-required tool, with only edge behavior (no Node.js, missing config) left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the burden, and it defines both parameters meaningfully: `source` as ABAP source text linted instead of a project, and `path` as a project folder relative to the workspace root. This compensates for the bare schema, though it doesn't mention that `path` defaults to '.' when omitted.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Run abaplint static analysis') and enumerates what it checks (syntax, types, obsolete code, naming). It is distinguishable from most siblings, but the nearest neighbor, check_conventions, is never contrasted, leaving slight ambiguity about which to pick for convention checks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly states the two operating modes: lint the given `source` text, otherwise lint the project at `path`, using the project's own abaplint.json. That tells an agent when each parameter path applies, but it offers no exclusions or explicit alternatives to the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_objectsB
Read-onlyIdempotent

List the ABAP objects (classes, interfaces, programs...) in an abapGit folder.

Args: path: Project folder relative to the workspace root.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, so the safety profile is covered by structured data. The description adds the folder-scoping behavior but says nothing about recursion, result ordering, or behavior on a missing/invalid path.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the purpose in one sentence, followed by a compact Args block. No filler, though the 'Args:' formatting is slightly redundant given the schema already lists the path argument.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained. However, for a listing tool the description omits whether the scan is recursive, what ordering or filtering applies, and what happens when the folder contains no ABAP objects — leaving meaningful gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema description coverage at 0% and one parameter, the description carries the burden and does so: it clarifies 'path' is a project folder relative to the workspace root, which the schema's bare 'Path' title with default '.' does not convey. Some ambiguity remains (e.g., whether nested folders are searched).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('List') and resource ('ABAP objects (classes, interfaces, programs...)') with the scoping context ('in an abapGit folder'). It is clear what the tool returns, though it never names or contrasts itself with the siblings (outline_object, check_conventions, lint, run_tests).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus the sibling tools, and no prerequisites or exclusions. Usage must be inferred entirely from the one-line purpose statement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

outline_objectB
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo.
object_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, so the safety profile is covered. The description adds that it introspects code structure (visibility, signatures, line ranges), which is useful framing, but says nothing about limits on large objects, cost, or failure modes (e.g. non-existent object names).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The one-sentence purpose is front-loaded and information-dense, followed by a compact Args block. The Args block partly restates what the schema already declares, which is mildly redundant but not costly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description needn't explain return values, and annotations cover safety semantics. Both parameters are explained despite 0% schema coverage, leaving only the absence of sibling-routing guidance as a gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the param burden, and it does: object_name is given with a concrete example ('ZCL_ORDER_TOTAL') and path is explained as the project folder relative to the workspace root. This compensates well for the empty schema, though it does not state the default '.' behavior or format constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Describe') and resource ('a class or interface') and enumerates exactly what is returned: methods with visibility and signature, attributes, test classes, and method-body line ranges. It is clearly distinguishable from lint/run_tests by the static-structure nature of the output, though it never names a sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to pick this over list_objects, check_conventions, or lint. Usage is only inferable from the nature of the output described; no prerequisites, scope limits, or alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_testsA
Idempotent

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
installNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=false, openWorldHint=true and idempotentHint=true, and the description is consistent with that, adding real behavioral detail: the run is transpiled and executed on Node.js, no SAP backend is contacted, and `install` triggers a dependency reinstall. It does not mention expected runtime, failure reporting, or how test results surface, so it stops short of 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first sentence, followed by a compact two-line Args block; every line contributes information. Slightly verbose on the toolchain parenthetical, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with an output schema present, the description covers what the tool does, where it runs, its side effects, and both parameters. The only missing element is routing guidance relative to the sibling check tools, which is a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% (only bare titles 'Path' and 'Install'), so the description carries the burden and does so: it explains that path must be a project folder containing package.json, and that install reinstalls npm dependencies before testing. This meaningfully upgrades both parameters past the schema's titles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Run the ABAP Unit tests') and adds the execution environment (Node.js via abaplint transpiler + open-abap, invoked with `npm test`), which makes it clearly distinct in kind from lint/check_conventions even though no sibling is named.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the name and by the note that no SAP system is needed, which helps an agent decide it can call this in a bare environment. However, it never states when to prefer this over the sibling tools (lint, check_conventions) or any prerequisites beyond a package.json.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observedcheck_conventions
    • First observedlint
    • First observedlist_objects
    • First observedoutline_object
    • First observedrun_tests

TDQS

A3.6/5.0

Scored across 5 tools

Disambiguation4/5

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).

Naming Consistency4/5

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.

Tool Count4/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to read, write, activate, and transport ABAP code in SAP systems via ABAP ADT REST API, without needing SAP GUI.
    24
    361 npm
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Provides AI coding agents a full abap2UI5 development loop—writing ABAP classes, validating views, deploying, and running apps headless with screenshots—all locally without an SAP system.
    9
    28 npm
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Offline MCP server for SAP ABAP static analysis, ABAP Cloud readiness scoring, and RAP scaffolding. It enables AI agents to lint ABAP source, compare reworks, check released APIs, and generate RAP business objects without needing an SAP system.
    9
    261 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to perform ABAP Development Tools operations on SAP ERP (ECC and S/4HANA) systems, including source code editing, object activation, syntax checks, and ABAP unit tests.
    5 npm
    MIT