ABAP MCP

ABAP MCP

An AI-powered server that provides comprehensive coding assistance for SAP ABAP development, including tools for code generation, analysis, and refactoring. It integrates with various LLMs and the SAP ADT REST API to enable intelligent interaction with ABAP repository objects and best practices.

Category
Visit Server

README

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 /docs FOR ALL ENTRIES
@abap /format           ← format and fix deprecated syntax
@abap how do I implement a BAdi?   ← free-form ABAP question

LLM Providers

Provider Config Notes
GitHub Copilot LLM_PROVIDER=copilot Uses your existing Copilot subscription via VS Code
OpenAI LLM_PROVIDER=openai + OPENAI_API_KEY GPT-4o recommended
Anthropic LLM_PROVIDER=anthropic + ANTHROPIC_API_KEY Claude Sonnet 4.6 recommended
Azure OpenAI LLM_PROVIDER=azure-openai + endpoint/key Enterprise deployments
Ollama LLM_PROVIDER=ollama Local inference with CodeLlama, DeepSeek-Coder

Quick Start

1. Install dependencies

npm install

2. Configure environment

cp config/example.env .env
# Edit .env with your LLM credentials and optional SAP connection

3. Build and run

npm run build
npm start              # stdio mode (for Claude Desktop / Cursor)

4. Connect to Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "abap": {
      "command": "node",
      "args": ["/path/to/ABAP_MCP/dist/server/index.js"],
      "env": {
        "LLM_PROVIDER": "openai",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

5. Install the VS Code Extension

cd vscode-extension
npm install
npm run compile
# Press F5 to launch Extension Development Host, or package with vsce

Then in VS Code settings, configure:

{
  "abapMcp.llmProvider": "copilot",
  "abapMcp.sapBaseUrl": "https://your-sap-system:8000",
  "abapMcp.sapUser": "DEVELOPER"
}

SAP System Connection (Optional)

The SAP connection uses the ABAP Development Tools (ADT) REST API, available on any SAP system with ABAP 7.5+ or S/4HANA.

Required SAP authorizations:

  • S_ADT_RES – ADT resource access
  • S_DEVELOP – ABAP Workbench authorization
  • S_CODE_INS – Code Inspector (for runCodeInspector: true)

Set credentials:

SAP_BASE_URL=https://my-sap.example.com:8000
SAP_USER=DEVELOPER
SAP_PASSWORD=secret
SAP_CLIENT=100
SAP_LANGUAGE=EN

Development

npm run dev          # Run server in development mode (tsx, no build)
npm run build:watch  # Watch mode TypeScript compilation
npm run typecheck    # Type-check without building
npm test             # Run unit tests

Project Structure

ABAP_MCP/
├── src/
│   ├── server/
│   │   ├── index.ts              # MCP server entry point
│   │   ├── tools/                # MCP tool handlers
│   │   │   ├── analyze.ts        # abap_analyze
│   │   │   ├── generate.ts       # abap_generate
│   │   │   ├── explain.ts        # abap_explain
│   │   │   ├── refactor.ts       # abap_refactor
│   │   │   ├── search.ts         # abap_search
│   │   │   ├── unit-test.ts      # abap_unit_test
│   │   │   ├── format.ts         # abap_format
│   │   │   └── docs.ts           # abap_docs
│   │   └── resources/            # MCP resources
│   │       ├── abap-syntax.ts    # ABAP syntax reference
│   │       └── best-practices.ts # Clean ABAP guidelines
│   ├── sap/
│   │   ├── adt-client.ts         # SAP ADT REST API client
│   │   └── types.ts              # ABAP domain types
│   ├── llm/
│   │   ├── provider.ts           # Generic LLM interface + ABAP system prompt
│   │   ├── factory.ts            # Provider factory (reads env config)
│   │   ├── openai.ts             # OpenAI adapter
│   │   ├── anthropic.ts          # Anthropic adapter
│   │   ├── azure-openai.ts       # Azure OpenAI adapter
│   │   ├── copilot.ts            # GitHub Copilot adapter
│   │   └── ollama.ts             # Ollama (local) adapter
│   └── utils/
│       ├── config.ts             # Zod-validated env config
│       └── logger.ts             # Winston logger
├── vscode-extension/
│   ├── package.json              # VS Code extension manifest
│   └── src/
│       ├── extension.ts          # Extension activation, commands
│       ├── copilot-agent.ts      # @abap Copilot chat participant
│       └── mcp-client.ts         # MCP client wrapper
└── config/
    ├── example.env               # Configuration template
    └── mcp.json                  # MCP server config template

Adding a New LLM Provider

  1. Create src/llm/my-provider.ts implementing LLMProvider:
export class MyProvider implements LLMProvider {
  readonly name = 'my-provider';
  readonly model: string;

  async complete(messages, options) { /* ... */ }
  async *stream(messages, options) { /* ... */ }
  async healthCheck() { /* ... */ }
}
  1. Register it in src/llm/factory.ts under a new case.
  2. Add the new provider to the LLM_PROVIDER enum in src/utils/config.ts.
  3. Add a VS Code setting entry in vscode-extension/package.json.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured