mcp-abap-integration-adapter
Provides standardized integration layer for MCP clients to interface with ABAP backend systems utilizing the ABAP Development Tools (ADT) RESTful services. This utility wraps core ADT functionalities for streamlined ABAP artifact lifecycle management, including secure authentication, object manipulation, and transport coordination.
Author

mario-andreschak
Quick Info
Actions
Tags
EXPERIMENTAL WARNING: This server component is currently under active development and testing. Exercise caution when deploying in production environments.
ABAP Development Tools (ADT) Interface Server via MCP
Core Purpose
The mcp-abap-integration-adapter functions as a Model Context Protocol (MCP) intermediary, bridging external MCP consumers with internal SAP ABAP environments via the established ABAP Development Tools interfaces. It serves as an abstraction layer over the underlying abap-adt-api, empowering automated management of ABAP codebase assets, change request tracking, and static code analysis within development pipelines.
Capabilities Overview
- Session Establishment: Securely initiate and validate connections to remote ABAP hosts via the
loginutility. - Artifact Lifecycle Control: Full CRUD operations (Create, Retrieve, Update, Delete) for various ABAP program units and definitions.
- Change Management: Orchestrate the process of assigning objects to development transports using tools like
createTransportand querying request status viatransportInfo. - Quality Assurance: Execute remote syntax validation checks and retrieve context-aware code completion suggestions.
- Modular Extension: Designed for straightforward extension, allowing the addition of new ABAP-related functionalities as required.
- State Cleanup: Management of active connections, including connection invalidation through
dropSessionandlogout.
Deployment Guide
Installation via Smithery
To rapidly provision this MCP Server for use with supported clients (like Claude Desktop) using the Smithery CLI:
npx -y @smithery/cli install @mario-andreschak/mcp-abap-abap-adt-api --client claude
System Prerequisites
- Runtime Environment: A working installation of Node.js (obtainable from https://nodejs.org/).
- Connectivity: Valid host URL, authentication credentials, and network accessibility to the target ABAP system.
Setup Procedure
-
Source Retrieval
cmd git clone https://github.com/mario-andreschak/mcp-abap-abap-adt-api.git cd mcp-abap-abap-adt-api -
Dependency Resolution
cmd npm install -
Configuration of Credentials
Use the provided
.env.examplefile as a template. Create a.envfile in the root directory:bash cp .env.example .envPopulate
.envwith your connection parameters:env SAP_URL=https://your-sap-server.com:44300 SAP_USER=YOUR_SAP_USERNAME SAP_PASSWORD=YOUR_SAP_PASSWORD SAP_CLIENT=YOUR_SAP_CLIENT # Optional, recommended SAP_LANGUAGE=YOUR_SAP_LANGUAGE # Optional, recommendedSelf-Signed Certificate Handling (If Necessary):
env NODE_TLS_REJECT_UNAUTHORIZED="0"SECURITY NOTICE: Ensure the
.envfile is excluded from source control via.gitignore. -
Compilation
cmd npm run build -
Execution
cmd npm run start(This server can also be integrated directly into IDE contexts like VSCode.)
Operational Interaction
After initialization, the server accepts commands via standard MCP client applications (e.g., Cline). When configuring Cline, specify the following execution profile:
"mcp-abap-abap-adt-api": {
"command": "node",
"args": [
"PATH_TO_YOUR/mcp-abap-abap-adt-api/dist/index.js"
],
"disabled": true,
"autoApprove": []
},
Tool Reference Guide (Custom Instruction Context)
This server exposes capabilities to interact with ABAP objects via ADT endpoints. The primary workflow involves locating an object, obtaining its unique identifier (URI), locking it for modification, updating its content, and finalizing the process.
Key Functions:
-
searchObject: Locates an ABAP entity (e.g., class, function module) using a string query. Returns the object's ADT URI. Example URI:/sap/bc/adt/oo/classes/zcl_model_processor -
transportInfo: Queries the current transport assignment for an object identified by its URI.- Input:
objSourceUrl(The object's URI). - Output: Transport request number (e.g.,
TRKORR).
- Input:
-
lock: Reserves the object for exclusive modification.- Input:
objectUrl(The object's URI). - Output: A required
lockHandletoken.
- Input:
-
unLock: Releases the reserved lock on the object.- Inputs:
objectUrl,lockHandle.
- Inputs:
-
setObjectSource: Overwrites the object's implementation code.- Input:
objectSourceUrl(URI MUST include/source/mainsuffix),lockHandle,source(New code content),transport(Optional TR number).
- Input:
-
getObjectSource: Fetches the current source code.- Input:
objectSourceUrl(URI MUST include/source/mainsuffix).
- Input:
-
syntaxCheckCode: Executes a remote syntax check on provided code snippet. -
activate: Triggers the activation process for the specified object.
Modification Flow Summary:
1. Resolve URI via searchObject.
2. Fetch existing code using getObjectSource (with /source/main).
3. Determine required Transport Request via transportInfo or user input.
4. Acquire lock using lock to get lockHandle.
5. Apply changes via setObjectSource (using /source/main, lockHandle, and Transport ID).
6. Validate integrity with syntaxCheckCode.
7. Persist changes via activate.
8. Release resource using unLock.
Critical Considerations:
* URI Suffix: For reading/writing content, append /source/main to the base object URI.
* Lock Dependency: setObjectSource and unLock absolutely require a valid, unexpired lockHandle.
* Local Files: Local file operations (reading/writing) are purely for local reference/editing buffers and do not directly synchronize with SAP. Use descriptive local filenames (e.g., ObjectName.Type.abap).
Database Interaction Best Practices in ABAP
When developing code that queries the underlying database tables, performance optimization is paramount due to the potential scale of SAP data.
- Filtering: Always employ restrictive
WHEREclauses to minimize dataset transfer. - Single Record Retrieval: Prefer
SELECT SINGLEwhen all primary keys are known. If keys are incomplete or you only require one match, useSELECT ... UP TO 1 ROWSto halt processing immediately upon finding the first record.
Schema Inspection Utilities
To prevent runtime errors stemming from incorrect field names or type mismatches during coding, use these tools to inspect ABAP Dictionary definitions:
GetTable: Retrieve the full field catalog for a specified database table.GetStructure: Retrieve the definition details for an internal structure or data type (this may require usingsearchObjectfirst for complex types or includes, potentially falling back toGetStructureif initial lookups fail).
Development Collaboration
To contribute enhancements or fixes:
- Fork the primary repository.
- Establish a dedicated feature branch (e.g.,
git checkout -b feature/new-transport-tool). - Commit changes clearly.
- Push the branch to your fork.
- Submit a Pull Request against the upstream repository.
Licensing
This codebase is released under the terms of the MIT License.
Contextual Note on Business Tools (Relevant to MCP/SAP): Business management tools, which encompass systems like this ABAP integration adapter, aim to enhance organizational efficiency by automating complex operational tasks. Proper selection and adaptation of such tools are key to maximizing their value, ensuring they align with specific business process requirements rather than forcing processes to conform to inflexible software defaults.
