Seamless communication between ABAP systems and MCP clients via ADT API
DISCLAIMER: This server is still in experimental status! Use it with caution!
ABAP-ADT-API MCP-Server
Description
The MCP-Server mcp-abap-abap-adt-api is a Model Context Protocol (MCP) server designed to facilitate seamless communication between ABAP systems and MCP clients. It is a wrapper for abap-adt-api and provides a suite of tools and resources for managing ABAP objects, handling transport requests, performing code analysis, and more, enhancing the efficiency and effectiveness of ABAP development workflows.
Features
- Authentication: Securely authenticate with ABAP systems using the
logintool. - Object Management: Create, read, update, and delete ABAP objects seamlessly.
- Transport Handling: Manage transport requests with tools like
createTransportandtransportInfo. - Code Analysis: Perform syntax checks and retrieve code completion suggestions.
- Extensibility: Easily extend the server with additional tools and resources as needed.
- Session Management: Handle session caching and termination using
dropSessionandlogout.
Installation
Installing via Smithery
To install ABAP-ADT-API MCP-Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @mario-andreschak/mcp-abap-abap-adt-api --client claude
Prerequisites
- Node.js: Ensure you have Node.js installed. You can download it from here.
- ABAP System Access: Credentials and URL to access the ABAP system.
Steps
Clone the Repository
git clone https://github.com/mario-andreschak/mcp-abap-abap-adt-api.git cd mcp-abap-abap-adt-apiInstall Dependencies
npm installConfigure Environment Variables
An
.env.examplefile is provided in the root directory as a template for the required environment variables. To set up your environment:a. Copy the
.env.examplefile and rename it to.env:cp .env.example .envb. Open the
.envfile and replace the placeholder values with your actual SAP connection details:SAP_URL=https://your-sap-server.com:44300 SAP_USER=YOUR_SAP_USERNAME SAP_PASSWORD=YOUR_SAP_PASSWORD SAP_CLIENT=YOUR_SAP_CLIENT SAP_LANGUAGE=YOUR_SAP_LANGUAGENote: The SAP_CLIENT and SAP_LANGUAGE variables are optional but recommended.
If you're using self-signed certificates, you can also set:
NODE_TLS_REJECT_UNAUTHORIZED="0"IMPORTANT: Never commit your
.envfile to version control. It's already included in.gitignoreto prevent accidental commits.Build the Project
npm run buildRun the Server
npm run start(or alternatively integrate the MCP Server into VSCode)
Usage
Once the server is running, you can interact with it using MCP clients or tools that support the Model Context Protocol (e.g. Cline). In order to integrate the MCP Server with Cline, use the following MCP Configuration:
"mcp-abap-abap-adt-api": {
"command": "node",
"args": [
"PATH_TO_YOUR/mcp-abap-abap-adt-api/dist/index.js"
],
"disabled": true,
"autoApprove": [
]
},
Custom Instruction
Use this Custom Instruction to explain the tool to your model:
## mcp-abap-abap-adt-api Server
This server provides tools for interacting with an SAP system via ADT (ABAP Development Tools) APIs. It allows you to retrieve information about ABAP objects, modify source code, and manage transports.
**Key Tools and Usage:**
* **`searchObject`:** Finds ABAP objects based on a query string (e.g., class name).
* `query`: (string, required) The search term.
* Returns the object's URI. Example: `/sap/bc/adt/oo/classes/zcl_invoice_xml_gen_model`
* **`transportInfo`:** Retrieves transport information for a given object.
* `objSourceUrl`: (string, required) The object's URI (obtained from `searchObject`).
* Returns transport details, including the transport request number (`TRKORR` or `transportInfo.LOCKS.HEADER.TRKORR` in the JSON response).
* **`lock`:** Locks an ABAP object for editing.
* `objectUrl`: (string, required) The object's URI.
* Returns a `lockHandle`, which is required for subsequent modifications.
* **`unLock`:** Unlocks a previously locked ABAP object.
* `objectUrl`: (string, required) The object's URI.
* `lockHandle`: (string, required) The lock handle obtained from the `lock` operation.
* **`setObjectSource`:** Modifies the source code of an ABAP object.
*
Tools (4)
searchObjectFinds ABAP objects based on a query string.transportInfoRetrieves transport information for a given object.lockLocks an ABAP object for editing.unLockUnlocks a previously locked ABAP object.Environment Variables
SAP_URLrequiredThe URL of the SAP serverSAP_USERrequiredSAP usernameSAP_PASSWORDrequiredSAP passwordSAP_CLIENTSAP client IDSAP_LANGUAGESAP language codeConfiguration
{"mcp-abap-abap-adt-api": {"command": "node", "args": ["PATH_TO_YOUR/mcp-abap-abap-adt-api/dist/index.js"]}}