Token导航 LogoToken导航TokenDH.com
ABAP-ADT-API MCP-Server logo
开发工具stdio官方级别未说明来源级核验

ABAP-ADT-API MCP-Server

MCP Server

@smithery/cli

MCP-Server for SAP ABAP wrapping abap-adt-api

工具数

0

提示词数

0

GitHub Stars

134

资源数

0
TypeScriptClaude代码管理Claude DesktopClaudeCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

mario-andreschak

提供方

mario-andreschak

最后核验

2026/5/18 03:29

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y @smithery/cli install @mario-andreschak/mcp-abap-abap-adt-api --client claude

详细介绍

免责声明:此服务器仍处于实验状态!小心使用!

ABAP-ADT-API MCP-服务器

](https://smithery.ai/server/@mario-andreschak/mcp-abap-abap-adt-api)

描述

MCP服务器 mcp-abap-abap-adt-api 是一个模型上下文协议(MCP)服务器,旨在促进ABAP系统和MCP客户端之间的无缝通信。它是一个包装 abap-adt-api 并提供了一套用于管理ABAP对象、处理传输请求、执行代码分析等的工具和资源,提高了ABAP开发工作流的效率和有效性。

特性

  • 认证:使用ABAP系统进行安全身份验证 login 工具。
  • 对象管理:无缝创建、读取、更新和删除ABAP对象。
  • 运输搬运:使用以下工具管理运输请求 createTransporttransportInfo.
  • 代码分析:执行语法检查并检索代码完成建议。
  • 可扩展性:根据需要使用其他工具和资源轻松扩展服务器。
  • 会话管理:使用处理会话缓存和终止 dropSessionlogout.

安装

通过Smithery安装

通过自动安装ABAP-ADT-API MCP-Server for Claude Desktop 史密瑟里:

npx -y @smithery/cli install @mario-andreschak/mcp-abap-abap-adt-api --client claude

先决条件

  • Node.js:确保您已安装Node.js。您可以从以下网址下载 这里.
  • ABAP系统访问:访问ABAP系统的凭据和URL。

步骤

  1. 克隆存储库
   git clone https://github.com/mario-andreschak/mcp-abap-abap-adt-api.git
   cd mcp-abap-abap-adt-api
  1. 再进行
   npm install
  1. 配置环境变量

.env.example 文件在根目录中提供,作为所需环境变量的模板。要设置环境,请执行以下操作:

a.复制 .env.example 文件并将其重命名为 .env:

   cp .env.example .env

b.打开 .env 将占位符值归档并替换为实际的SAP连接详细信息:

   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_LANGUAGE

注意:SAP_CLIENT和SAP_LANGUAGE变量是可选的,但建议使用。

如果您使用自签名证书,还可以设置:

   NODE_TLS_REJECT_UNAUTHORIZED="0"

重要提示:切勿承诺 .env 文件到版本控制。它已经包含在 .gitignore 以防止意外犯罪。

  1. 构建项目
   npm run build
  1. 运行服务器
   npm run start

(或者将MCP服务器集成到VSCode中)

用法

服务器运行后,您可以使用支持模型上下文协议的MCP客户端或工具(例如。 克莱恩).为了将MCP服务器与Cline集成,请使用以下MCP配置:

    "mcp-abap-abap-adt-api": {
      "command": "node",
      "args": [
        "PATH_TO_YOUR/mcp-abap-abap-adt-api/dist/index.js"
      ],
      "disabled": true,
      "autoApprove": [
      ]
    },

客户指令

使用此自定义说明向您的模型解释该工具:

## 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.
    *   `objectSourceUrl`: (string, required) The object's URI *with the suffix `/source/main`*.  Example: `/sap/bc/adt/oo/classes/zcl_invoice_xml_gen_model/source/main`
    *   `lockHandle`: (string, required) The lock handle obtained from the `lock` operation.
    *   `source`: (string, required) The complete, modified ABAP source code.
    *   `transport`: (string, optional) The transport request number.

*   **`syntaxCheckCode`:** Performs a syntax check on a given ABAP source code.
    *   `code`: (string, required) The ABAP source code to check.
    *   `url`: (string, optional) The URL of the object.
    *   `mainUrl`: (string, optional) The main URL.
    *   `mainProgram`: (string, optional) The main program.
    *   `version`: (string, optional) The version.
    *   Returns syntax check results, including any errors.

*   **`activate`:** Activates an ABAP object. (See notes below on activation/unlocking.)
    *    `object`: The object to be activated.

*   **`getObjectSource`:** Retrieves the source code of an ABAP object.
    *   `objectSourceUrl`: (string, required) The object's URI *with the suffix `/source/main`*.

**Workflow for Modifying ABAP Code:**

1.  **Find the object URI:** Use `searchObject`.
2.  **Read the original source code:** Use `getObjectSource` (with the `/source/main` suffix).
3.  **Clone and Modify the source code locally:** (e.g., `write_to_file` for creating a local copy, and using `read_file`, `replace_in_file` for modifying this local copy).
4.  **Get transport information:** Use `transportInfo`.
5.  **Lock the object:** Use `lock`.
6.  **Set the modified source code:** Use `setObjectSource` (with the `/source/main` suffix).
7.  **Perform a syntax check:** Use `syntaxCheckCode`.
8.  **Activate** the object, Use `activate`..
9.  **unLock the object:** Use `unLock`.

**Important Notes:**
*   **File Handling:** SAP is completly de-coupled from the local file system. Reading source code will only return the code as tool result - it has no effect on file. Files are not synchronized with SAP but merely a local copy for our reference. FYI: It's not strictly necessary for you to create local copies of source codes, as they have no effect on SAP, but it helps us track changes. 
*   **File Handling:** The local filenames you will use will not contain any paths, but only a filename! It's preferable to use a pattern like "[ObjectName].[ObjectType].abap". (e.g., SAPMV45A.prog.abap for a ABAP Program SAPMV45A, CL_IXML.clas.abap for a Class CL_IXML)
*   **URL Suffix:**  Remember to add `/source/main` to the object URI when using `setObjectSource` and `getObjectSource`.
*   **Transport Request:** Obtain the transport request number (e.g., from `transportInfo` or from the user) and include it in relevant operations.
*   **Lock Handle:**  The `lockHandle` obtained from the `lock` operation is crucial for `setObjectSource` and `unLock`. Ensure you are using a valid `lockHandle`. If a lock fails, you may need to re-acquire the lock. Locks can expire or be released by other users.
*   **Activation/Unlocking Order:** The exact order of `activate` and `unLock` operations might need clarification. Refer to the tool descriptions or ask the user. It appears `activate` can be used without unlocking first.
* **Error Handling:** The tools return JSON responses. Check for error messages within these responses.

## Efficient Database Access

SAP systems contain vast amounts of data.  It's crucial to write ABAP code that accesses the database efficiently to minimize performance impact and network traffic.  Avoid selecting entire tables or using broad `WHERE` clauses when you only need specific data.

*   **Use `WHERE` clauses:** Always use `WHERE` clauses in your `SELECT` statements to filter the data retrieved from the database.  Select only the specific rows you need.
*   **`UP TO 1 ROWS`:** If you only need a single record, use the `SELECT SINGLE` statement, if you can guarantee that you can provide ALL the key fields for the `SELECT SINGLE` statement. Otherwise, use the `SELECT` statement with the `UP TO 1 ROWS` addition. This tells the database to stop searching after finding the first matching record, improving performance. Example:

SELECT vgbel FROM vbrp WHERE vbeln = @me->lv_vbeln INTO @DATA(lv_vgbel) UP TO 1 ROWS. EXIT. " Exit any loop after this. ENDSELECT.

## Checking Table and Structure Definitions

When working with ABAP objects, you may encounter errors related to unknown field names or incorrect table usage.  You can use the following tools to inspect table and structure definitions:

*   **`GetTable`:** Use this tool to retrieve the structure of an ABAP Dictionary table, including its field names and data types. This is helpful for verifying the correct fields to use in your `SELECT` statements.
*    If you need to inspect an include structure, you may need to use `searchObject` to find the include and then use `GetTypeInfo` or `GetStructure`. You may get a 404 error and try again with `GetStructure`
*   **`GetStructure`:** Use this tool to retrieve the structure of an ABAP Dictionary structure, including its field names and data types. This is helpful for verifying the correct fields to use in your `SELECT` statements.
*    If you need to inspect an include structure, you may need to use `searchObject` to find the include and then use `GetTypeInfo` or `GetStructure`.

贡献

欢迎投稿!请按照以下步骤进行贡献:

  1. 分叉存储库
  1. 创建新分支
   git checkout -b feature/your-feature-name
  1. 提交您的更改
   git commit -m "Add some feature"
  1. 推到分支机构
   git push origin feature/your-feature-name
  1. 打开拉取请求

许可证

该项目根据 MIT许可证.

目录标签

目录标签

TypeScriptClaude代码管理developer-toolsABAP开发本地部署SAP集成传输处理语法检查

支持客户端

Claude DesktopClaudeCline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

remote-capable

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP