mcp-rap-migrator
Provides tools for migrating SAP Module Pool programs to RAP applications, leveraging SAP ADT REST APIs for analysis, code generation, and activation of ABAP objects.
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., "@mcp-rap-migrator Migrate the module pool program SAPMZ_DEMO to RAP. Use package ZMIGRATED and prefix ZR_."
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.
mcp-rap-migrator
AI Agent that migrates SAP Module Pool programs → RAP applications, interactively.
Built on MCP (Model Context Protocol) + Anthropic Claude + SAP ADT REST APIs.
Architecture
Human Developer
↕ approves every step
Orchestrator Agent (Claude claude-sonnet-4-6)
↕ system prompt = MIGRATION_GUIDE.md (loaded once, token-efficient)
mcp-rap-migrator (THIS server) — write/transform tools
↕ delegates read-only calls to
mcp-abap-adt (mario-andreschak) — GetProgram, GetInclude, SearchObject
↕ both call
SAP ADT REST API /sap/bc/adt/
↕
SAP ABAP System (S/4HANA or BTP ABAP)Related MCP server: SAP ADT MCP Server
Why TWO MCP servers?
Server | Responsibility | Reason |
| Read: GetProgram, GetClass, SearchObject | Already built, battle-tested, reuse it |
| Write + Transform: analyze, generate, write, activate | New — wraps ADT write APIs + AI code generation |
Tools (this server)
Tool | Purpose | Step |
| Read + parse Module Pool → structured JSON | 1 |
| JSON analysis → CDS/BDef/Impl ABAP code strings | 2 |
| MANDATORY gate — shows human: what got, analysis, next action | Every step |
| Create Workbench Transport Request in SAP | 3 |
| PUT one ABAP object source via ADT REST | 4 |
| Activate objects, return syntax errors | 5 |
Token Efficiency Design
MIGRATION_GUIDE.mdloaded once as system prompt — not re-sent every callanalyze_module_poolreturns compact JSON (not raw ABAP source)human_checkpointshows only first 30 lines of code previewsErrors: only the error message, not the full XML response body
CSRF token reused across calls — not re-fetched every request
Prerequisites
SAP system with
/sap/bc/adtactive in SICFAlso install:
mcp-abap-adt—npx -y @smithery/cli install @mario-andreschak/mcp-abap-adt --client clineNode.js 20+ and npm
Setup
git clone <this-repo>
cd mcp-rap-migrator
npm install
npm run build
cp .env.example .env
# Edit .env with your SAP credentialsConfigure in Cline / Claude Desktop
{
"mcpServers": {
"mcp-abap-adt": {
"command": "node",
"args": ["C:/PATH/mcp-abap-adt/dist/index.js"],
"env": {
"SAP_URL": "https://your-sap.com:8000",
"SAP_USERNAME": "user",
"SAP_PASSWORD": "pass",
"SAP_CLIENT": "100"
}
},
"mcp-rap-migrator": {
"command": "node",
"args": ["C:/PATH/mcp-rap-migrator/dist/index.js"],
"env": {
"SAP_URL": "https://your-sap.com:8000",
"SAP_USERNAME": "user",
"SAP_PASSWORD": "pass",
"SAP_CLIENT": "100"
}
}
}
}Usage
In Cline or Claude Code, with MIGRATION_GUIDE.md loaded as system prompt:
Migrate the module pool program SAPMZ_DEMO to RAP.
Use package ZMIGRATED and prefix ZR_.The agent will:
Analyze the program → show you what it found → ask permission
Generate all RAP objects → show code preview → ask permission
Create a transport → write each object one-by-one → checkpoint each
Activate all → show results → checkpoint
You control every step.
Extending
Add new tools in src/tools/ and register them in src/index.ts.
Ideas:
generate_odata_service— expose the RAP BO as an OData V4 servicerun_atc_check— run ABAP Test Cockpit on generated objectscompare_behavior— run both old + new, compare DB results
mcp-rap-migrator
Available Tools
7 toolsanalyze_module_poolA
STEP 1 — Analyzes Module Pool source code fetched by mcp-abap-adt. IMPORTANT: First use mcp-abap-adt GetProgram to get program source, then GetInclude for each include, then pass combined source here. Returns structured JSON: screens, PAI/PBO modules, tables, LLM business analysis, PAI-to-RAP mapping.
Inputs: source_code (required), program_name (required).
check_released_cdsA
STEP 1b — MANDATORY before generate_rap_skeleton. Checks if SAP has released CDS views for the tables found in the Module Pool. Clean Core: always SELECT from released CDS instead of raw tables. Returns cds_source_mapping to pass into generate_rap_skeleton.
Inputs: tables (required).
create_transportA
Creates a Workbench Transport Request in SAP. Do this before write_abap_object. Returns transport number.
Inputs: description (required), target_system.
generate_rap_skeletonA
STEP 2 — Given the analysis JSON from step 1, generates the full RAP migration plan: CDS view, Behavior Definition, Behavior Implementation class, metadata extensions. Returns ABAP code as strings — does NOT write to SAP yet. Human must approve.
Inputs: prefix (required), analysis_json (required), target_package (required).
human_checkpointA
MANDATORY between every step — shows the human: WHAT WAS DONE, ANALYSIS SUMMARY, and NEXT PROPOSED ACTION. Human must type YES/MODIFY/ABORT to proceed. Always call this before write_abap_object or validate_and_activate.
Inputs: step_title (required), what_i_got (required), my_analysis (required), next_action (required), +1 more.
validate_and_activateA
STEP 4 — Activates one or more ABAP objects via ADT REST. Runs syntax check first, returns errors for agent to fix before activation. Call human_checkpoint with results.
Inputs: objects (required).
write_abap_objectA
STEP 3 — Writes a single ABAP object to SAP via ADT REST. CRITICAL: Always follow this exact order: 1st=CDS Root View (DDLS), 2nd=CDS Child Views (DDLS), 3rd=Behavior Definition (BDEF), 4th=Implementation Class (CLAS), 5th=Metadata Extension (DDLS). NEVER write BDEF before CDS views. NEVER write CLAS before BDEF. One object at a time only.
Inputs: package (required), transport (required), object_name (required), object_type (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct step in the migration workflow: analysis, CDS checking, transport creation, skeleton generation, human checkpoint, writing objects, and validation. No overlap or ambiguity.
Most tool names follow a verb_noun pattern (analyze_module_pool, check_released_cds, create_transport, generate_rap_skeleton, write_abap_object). However, 'human_checkpoint' is noun_noun and 'validate_and_activate' uses two verbs, breaking the pattern slightly.
7 tools cover the entire migration pipeline without being excessive. Each tool serves a necessary function, and the count is appropriate for the domain's complexity.
The tool set covers all essential steps from analysis through activation, including mandatory checkpoints. No obvious gaps for a migration workflow.
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseCqualityDmaintenanceAn MCP server that enables seamless communication between ABAP systems and MCP clients using the ABAP Development Tools (ADT) API. It provides tools for managing ABAP objects, handling transport requests, and performing code analysis directly through MCP-compatible interfaces.100MIT
- FlicenseBqualityNot gradedmaintenanceAn MCP server that enables AI assistants to interact with SAP systems via the ABAP Development Tools (ADT) REST API. It allows users to read ABAP source code, inspect DDIC objects, and execute SQL queries directly.66-
- AlicenseAqualityBmaintenanceAn MCP server that enables AI assistants to interact with SAP GUI for Windows through the SAP GUI Scripting API.59291 PyPI47MIT

dassian-adtofficial
AlicenseNot gradedqualityCmaintenanceMCP server for SAP ABAP development via the ADT API. Connect AI assistants to your SAP system — read, write, test, and deploy ABAP code without SAP GUI.20MIT