vaibhavgoel-github-1986/sap-adt-mcp-server
If you are the rightful owner of sap-adt-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The SAP ADT MCP Server is a robust toolset designed for seamless interaction with SAP systems through ADT endpoints, enabling AI agents to efficiently manage SAP objects.
SAP ADT MCP Server
Overview
MCP server for interacting with SAP systems via ABAP Development Tools (ADT) endpoints. Enables AI agents to create, search, modify, and manage SAP objects.
Quick Start
Installation
pip install -r requirements.txt
Run Server
python src/mcp_server/server.py
Configuration
Set environment variables or pass credentials via tool parameters:
HOSTNAME- SAP system URLUSERNAME- SAP usernamePASSWORD- SAP passwordCLIENT- SAP client (default: 110)
VS Code Setup
{
"servers": {
"sap-adt-mcp-server": {
"type": "http",
"url": "http://<url>/mcp/",
"headers": {
"x-hostname": "<hostname>",
"x-username": "<username>",
"x-password": "${input:sap_password}",
"x-client": "<client>"
}
}
},
"inputs": [
{
"id": "sap_password",
"type": "promptString",
"description": "Enter SAP Password",
"password": true
}
]
}
Available Tools
Connection
- connect_to_sap - Initialize SAP system connection (required first)
Object Discovery
- get_creatable_object_types - List all creatable SAP object types (PROG, CLAS, INTF, FUGR, DDLS, TABL, etc.)
- search_object - Search for existing objects by name or pattern
- get_object_structure - Get structure of an object (includes, methods, attributes)
Object Management
- create_object - Create any SAP object type (classes, programs, CDS views, tables, etc.)
- delete_object - Delete an object (requires lock)
Source Code Operations
- get_object_source - Retrieve object source code (active or inactive version)
- set_object_source - Update object source code (requires lock)
- format_source_code - Format ABAP code using SAP's pretty printer
- syntax_check - Validate ABAP syntax before activation
Object Locking
- lock_object - Lock object before editing (returns lock handle)
- unlock_object - Unlock object after editing
Activation & Testing
- activate_object - Activate object after changes
- run_unit_test - Execute ABAP unit tests for an object
- create_unit_test_include - Create test class include for ABAP class
Typical Workflow
- Connect to SAP system using
connect_to_sap - Search for objects or get creatable types
- Lock object before editing using
lock_object - Modify source code with
set_object_source - Check syntax with
syntax_check - Activate changes with
activate_object - Unlock object with
unlock_object
Features
- Generic object creation for all SAP object types
- Complete lock/edit/activate/unlock workflow
- Syntax validation before activation
- Unit test execution and creation
- ABAP code formatting
- Object structure inspection
- Error handling with detailed messages
Important Notes
- Always connect to SAP first using
connect_to_sap - Use
$TMPpackage for local/temporary objects - Lock objects before editing to prevent conflicts
- Always unlock after editing (even on failure)
- Activate objects to make changes effective
Key Features
✅ Generic Object Creation - One tool handles all 12+ object types ✅ Complete Workflow - Lock, edit, activate, unlock pattern ✅ Error Handling - Detailed error messages for debugging ✅ Type Safety - Proper type hints and validation ✅ Syntax Checking - Validate code before activation ✅ Search Capabilities - Find objects by name/pattern
Notes
- Always call
connect_to_sapfirst - Use
$TMPpackage for local/temporary objects - Lock objects before editing to prevent conflicts
- Always unlock after editing (even on failure)
- Activate objects to make changes effective