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
{"mcpServers": {"abap": {"command": "npx", "args": ["-y", "abap-mcp"]}}}