ADT MCP Server

ADT MCP Server

Enables interaction with SAP ABAP systems through ABAP Development Tools (ADT), providing access to repository objects, source code, where-used analysis, and SQL queries with support for both on-premise and BTP systems.

Category
访问服务器

README

ADT MCP Server

This repository provides a Model Context Protocol (MCP) server for ABAP Development Tools (ADT), exposing various ABAP repository-read tools (program, class, function, include, interface, structure, table, where-used, etc.) over a standardized MCP interface.

🆕 Now includes SAP BTP (Business Technology Platform) support with JWT authentication and service key utilities!

📚 Quick Start: See QUICK_START.md for immediate setup instructions.

🔌 Client Connections: See MCP_CLIENT_CONNECTIONS.md for connecting to Cline, Claude Desktop, and other MCP clients.

📖 Documentation: Complete documentation is available in the doc/ folder.


Prerequisites

  • Python 3.9+
  • pip (the Python package installer)
  • A running SAP ABAP system with ADT services enabled
  • A .env file in the project root with your SAP connection settings (see below)

Setup

  1. Clone the repository

    git clone https://github.com/<your-org>/<your-repo>.git
    cd <your-repo>
    

    Note: The MCP server can now be run from any directory, not just the project directory. See REMOTE_CONNECTION_GUIDE.md for details.

    Transport Options: The server supports multiple transport protocols: STDIO (default), SSE, and Streamable HTTP.

  2. Create and activate a virtual environment

    python -m venv .venv
    source .venv/bin/activate   # Linux/macOS
    .\.venv\Scripts\activate  # Windows
    
  3. Install dependencies

    pip install mcp "mcp[cli]"
    

    Then install:

    pip install -r requirements.txt
    
  4. Configure environment variables

    Copy the example .env.example to .env and fill in your SAP credentials:

    For On-Premise Systems (Basic Authentication)

    SAP_AUTH_TYPE=basic
    SAP_URL=https://my.sap.system:443
    SAP_CLIENT=100
    SAP_USER=YOUR_USER
    SAP_PASS=YOUR_PASS
    SAP_VERIFY_SSL=true
    
    # Optional timeout configuration (in seconds)
    SAP_TIMEOUT_DEFAULT=45                 # Default timeout (45 seconds)
    SAP_TIMEOUT_CSRF=15                    # CSRF token timeout (15 seconds)
    SAP_TIMEOUT_LONG=60                    # Long operations timeout (60 seconds)
    

    For BTP Systems (JWT Authentication)

    SAP_AUTH_TYPE=jwt
    SAP_URL=https://your-system.abap.region.hana.ondemand.com
    SAP_JWT_TOKEN=eyJhbGciOiJSUzI1NiIsImp...
    SAP_VERIFY_SSL=true
    
    # Optional timeout configuration (in seconds)
    SAP_TIMEOUT_DEFAULT=45                 # Default timeout (45 seconds)
    SAP_TIMEOUT_CSRF=15                    # CSRF token timeout (15 seconds)
    SAP_TIMEOUT_LONG=60                    # Long operations timeout (60 seconds)
    

    💡 Tip: Use the included BTP utilities to generate .env files from service keys automatically!

🚀 BTP Integration

This server now includes comprehensive SAP BTP support with:

  • JWT Token Authentication for BTP ABAP systems
  • Service Key Parsing and analysis
  • Automatic .env Generation from BTP service keys
  • CLI Utility for easy configuration management

Quick BTP Setup

  1. Download your service key from BTP cockpit
  2. Generate .env file using the CLI utility:
    python btp_env_generator.py --service-key service-key.json --username your-user@company.com --prompt-password
    
  3. Use the generated .env file in your project

For complete BTP integration details, see BTP_INTEGRATION_GUIDE.md.

Available Tools

ABAP Repository Tools

  • get_program_source_mcp – Retrieve ABAP program source
  • get_class_source_mcp – Retrieve ABAP class source
  • get_function_group_source_mcp – Retrieve function group source
  • get_function_source_mcp – Retrieve function module source
  • get_include_source_mcp – Retrieve include source
  • get_interface_source_mcp – Retrieve interface source
  • get_structure_source_mcp – Retrieve structure definition
  • get_table_source_mcp – Retrieve table definition
  • get_table_contents_mcp – Fetch table data (max rows default 100)
  • get_package_structure_mcp – Retrieve package metadata
  • get_type_info_mcp – Retrieve type information
  • get_transaction_properties_mcp – Retrieve transaction properties
  • get_search_objects_mcp – Quick search for repository objects
  • get_usage_references_mcp – Retrieve where‑used references for any object
  • get_cds_source_mcp – Retrieve CDS view source
  • get_metadata_extension_source_mcp – Retrieve metadata extension source
  • get_sql_query_mcp – Execute freestyle SQL queries
  • get_enhancements_mcp – Discover enhancement implementations

🆕 BTP Tools

  • generate_env_from_service_key_file_mcp – Generate .env from service key file
  • generate_env_from_service_key_json_mcp – Generate .env from service key JSON
  • parse_btp_service_key_mcp – Parse and analyze service keys
  • get_btp_connection_status_mcp – Check current BTP configuration

Troubleshooting

"MCP error -32000: Connection closed" Error

If you get this error when connecting from another directory:

  1. Make sure you use the full path to the server:

    python /full/path/to/mcp-adt/mcp_server.py
    
  2. Check MCP client configuration:

    {
      "mcpServers": {
        "adt-server": {
          "command": "python",
          "args": ["/full/path/to/mcp-adt/mcp_server.py"]
        }
      }
    }
    
  3. Run connection test:

    python /path/to/mcp-adt/test_remote_connection.py
    
  4. Check logs:

    • Log file is created in project directory: mcp_server.log
    • Check for import or configuration errors

Other Common Issues

  • ModuleNotFoundError: Make sure all dependencies are installed: pip install -r requirements.txt
  • .env file issues: File is automatically searched in project directory
  • Permission issues: On Linux/macOS you may need chmod +x mcp_server.py

For detailed information see REMOTE_CONNECTION_GUIDE.md

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选