ABAP-ADT-API MCP-Server

by mario-andreschak
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows interaction with SAP systems via ABAP Development Tools (ADT) APIs, providing tools for managing ABAP objects, handling transport requests, performing code analysis, and modifying source code in SAP systems.

면책 조항: 이 서버는 아직 실험 단계입니다! 주의해서 사용하세요!

ABAP-ADT-API MCP 서버

설명

MCP 서버 mcp-abap-abap-adt-api 는 ABAP 시스템과 MCP 클라이언트 간의 원활한 통신을 지원하도록 설계된 모델 컨텍스트 프로토콜(MCP) 서버입니다. abap-adt-api 의 래퍼(wrapper)로, ABAP 객체 관리, 전송 요청 처리, 코드 분석 등을 위한 도구와 리소스 모음을 제공하여 ABAP 개발 워크플로의 효율성과 효과를 향상시킵니다.

특징

  • 인증 : login 도구를 사용하여 ABAP 시스템에서 안전하게 인증합니다.
  • 객체 관리 : ABAP 객체를 원활하게 생성, 읽기, 업데이트 및 삭제합니다.
  • 운송 처리 : createTransporttransportInfo 와 같은 도구를 사용하여 운송 요청을 관리합니다.
  • 코드 분석 : 구문 검사를 수행하고 코드 완성 제안을 검색합니다.
  • 확장성 : 필요에 따라 추가 도구와 리소스로 서버를 쉽게 확장할 수 있습니다.
  • 세션 관리 : dropSessionlogout 사용하여 세션 캐싱 및 종료를 처리합니다.

설치

Smithery를 통해 설치

Smithery를 통해 Claude Desktop용 ABAP-ADT-API MCP-Server를 자동으로 설치하려면:

지엑스피1

필수 조건

  • 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
  2. 종속성 설치
    npm install
  3. 환경 변수 구성루트 디렉터리에는 필수 환경 변수의 템플릿으로 사용할 .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 파일에 이미 포함되어 있습니다.
  4. 프로젝트 빌드
    npm run build
  5. 서버 실행
    npm run start
    (또는 MCP 서버를 VSCode에 통합)

용법

서버가 실행되면 MCP 클라이언트나 모델 컨텍스트 프로토콜(예: Cline )을 지원하는 도구를 사용하여 서버와 상호 작용할 수 있습니다. 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: ```abap 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. 저장소 포크
  2. 새로운 지점 만들기
    git checkout -b feature/your-feature-name
  3. 변경 사항 커밋
    git commit -m "Add some feature"
  4. 지점으로 밀어 넣기
    git push origin feature/your-feature-name
  5. 풀 리퀘스트 열기

특허

이 프로젝트는 MIT 라이선스 에 따라 라이선스가 부여되었습니다.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

ABAP 시스템과 MCP 클라이언트 간 통신을 원활하게 하는 모델 컨텍스트 프로토콜 서버로, ABAP 객체를 관리하고, 전송 요청을 처리하고, ABAP 개발 워크플로를 향상시키기 위한 코드 분석을 수행하는 도구를 제공합니다.

  1. Description
    1. Features
      1. Installation
        1. Installing via Smithery
        2. Prerequisites
        3. Steps
      2. Usage
        1. Custom Instruction
          1. Contributing
            1. License
              ID: p1uxnf0htn