ABAP MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "ADT_URL=${ADT_URL}" -e "ADT_USERNAME=${ADT_USERNAME}" -e "ADT_PASSWORD=${ADT_PASSWORD}" abap-mcp -- npx -y abap-mcp
Required:ADT_URLADT_USERNAMEADT_PASSWORD
README.md

AI-powered coding assistance for SAP ABAP development

ABAP MCP – AI-Powered SAP Development

An ABAP Model Context Protocol (MCP) server that brings AI-driven coding assistance to SAP ABAP development. Works with VS Code Copilot, Claude Desktop, Cursor, and any MCP-compatible client. Supports multiple LLM backends including GitHub Copilot, OpenAI, Anthropic Claude, Azure OpenAI, and local models via Ollama.


Architecture

┌──────────────────────────────────────────────────────────────────┐
│                       VS Code / IDE                              │
│                                                                  │
│  ┌─────────────────────┐    ┌──────────────────────────────────┐ │
│  │  GitHub Copilot Chat│    │  MCP Client (Claude Desktop,     │ │
│  │  @abap participant  │    │  Cursor, etc.)                   │ │
│  └──────────┬──────────┘    └──────────────┬───────────────────┘ │
│             │                              │                      │
│  ┌──────────▼──────────────────────────────▼───────────────────┐ │
│  │              VS Code Extension (abap-mcp-copilot)           │ │
│  │         • Copilot @abap chat agent                          │ │
│  │         • MCP client wrapper                                │ │
│  │         • Editor commands (analyze, format)                 │ │
│  └──────────────────────────┬────────────────────────────────--┘ │
└─────────────────────────────│────────────────────────────────────┘
                              │ stdio / SSE
┌─────────────────────────────▼────────────────────────────────────┐
│                     ABAP MCP Server (Node.js)                    │
│                                                                  │
│  Tools:                          Resources:                      │
│  • abap_analyze                  • abap://syntax-reference       │
│  • abap_generate                 • abap://best-practices         │
│  • abap_explain                                                  │
│  • abap_refactor                                                 │
│  • abap_search        ◄──────── SAP ADT REST API                │
│  • abap_unit_test                                                │
│  • abap_format                                                   │
│  • abap_docs                                                     │
│                                                                  │
│  ┌─────────────────────────────────────────────────────────────┐ │
│  │              Generic LLM Provider Layer                     │ │
│  │  ┌──────────┐ ┌──────────┐ ┌────────────┐ ┌─────────────┐ │ │
│  │  │  OpenAI  │ │Anthropic │ │Azure OpenAI│ │   Ollama    │ │ │
│  │  │  GPT-4o  │ │  Claude  │ │  GPT-4o   │ │  CodeLlama  │ │ │
│  │  └──────────┘ └──────────┘ └────────────┘ └─────────────┘ │ │
│  │                    ┌────────────────┐                       │ │
│  │                    │ GitHub Copilot │                       │ │
│  │                    └────────────────┘                       │ │
│  └─────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────┘

Features

MCP Tools

Tool Description
abap_analyze Deep code analysis: syntax, performance, security, Clean ABAP, cyclomatic complexity. Optionally integrates SAP Code Inspector via ADT.
abap_generate Generate production-ready ABAP from natural language – classes, CDS views, RAP behaviors, OData services, unit tests, and more.
abap_explain Plain-English explanation of any ABAP code. Adjustable audience level (beginner → expert). Optional line-by-line annotations.
abap_refactor Refactor towards Clean ABAP: extract methods, modernize syntax, improve naming, add error handling, convert to OOP.
abap_search Search ABAP repository objects in a connected SAP system (requires ADT credentials).
abap_unit_test Generate ABAP Unit Test classes using ABAP Unit + Test Double Framework. Optionally run existing tests via ADT.
abap_format Format code: 2-space indentation, uppercase keywords, replace deprecated syntax (MOVE→=, SELECT *→explicit fields).
abap_docs Comprehensive documentation for ABAP keywords, statements, classes, and SAP concepts with version-specific notes.

MCP Resources

Resource URI Content
abap://syntax-reference ABAP data types, modern 7.4+ syntax, constructor expressions, string templates
abap://best-practices Clean ABAP naming, DB access patterns, exception design, unit testing

VS Code Extension (`@abap` Copilot Agent)

Use @abap in Copilot Chat with these slash commands:

@abap /analyze          ← analyze the current file
@abap /generate a CDS view for sales order header with customer join
@abap /explain          ← explain selected code or whole file
@abap /refactor         ← clean up current file
@abap /test             ← generate unit tests for current class
@abap /doc

Tools (8)

abap_analyzePerforms deep code analysis including syntax, performance, security, and Clean ABAP compliance.
abap_generateGenerates production-ready ABAP code from natural language descriptions.
abap_explainProvides plain-English explanations of ABAP code with adjustable audience levels.
abap_refactorRefactors code towards Clean ABAP standards, including method extraction and syntax modernization.
abap_searchSearches for ABAP repository objects in a connected SAP system.
abap_unit_testGenerates ABAP Unit Test classes and supports running tests via ADT.
abap_formatFormats ABAP code to follow standard conventions like 2-space indentation and keyword casing.
abap_docsProvides documentation for ABAP keywords, statements, and SAP concepts.

Environment Variables

ADT_URLrequiredThe base URL for the SAP ADT REST API.
ADT_USERNAMErequiredUsername for SAP system authentication.
ADT_PASSWORDrequiredPassword for SAP system authentication.

Configuration

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

Try it

Analyze the current ABAP class for performance issues and Clean ABAP violations.
Generate a new CDS view for the sales order header that includes a join with the customer table.
Explain this complex ABAP method in simple terms for a junior developer.
Refactor the selected code to use modern 7.4+ syntax and improve naming conventions.
Create a comprehensive ABAP Unit Test class for the current report.

Frequently Asked Questions

What are the key features of ABAP MCP?

Deep code analysis for syntax, security, and Clean ABAP compliance. Natural language generation of classes, CDS views, and OData services. Automated refactoring to modernize syntax and improve code structure. Integration with SAP ADT REST API for repository object interaction. Support for multiple LLM backends including Claude, OpenAI, and Ollama.

What can I use ABAP MCP for?

Modernizing legacy ABAP codebases to follow Clean ABAP standards. Accelerating development of new CDS views and RAP behaviors. Automating the creation of unit tests for existing SAP classes. Onboarding developers by providing AI-powered explanations of complex ABAP logic.

How do I install ABAP MCP?

Install ABAP MCP by running: npx -y abap-mcp

What MCP clients work with ABAP MCP?

ABAP MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep ABAP MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare