ABAP Syntax Checker MCP Server
Provides ABAP report program syntax checking on SAP ERP systems via RFC protocol.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ABAP Syntax Checker MCP Servercheck this ABAP code: REPORT ztest. DATA lv_test TYPE string."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ABAP Syntax Checker MCP Server
A Model Context Protocol (MCP) server that provides ABAP REPORT program syntax checking capabilities for IDEs like Claude Code and Kiro.
Overview
This MCP server connects to SAP ERP systems via RFC protocol to perform native ABAP syntax checking. It enables AI assistants to validate ABAP code without requiring direct access to SAP GUI.
Related MCP server: ABAP-ADT-API MCP-Server
Features
✅ ABAP REPORT program syntax validation
✅ Detailed error reporting with line numbers and descriptions
✅ RFC-based communication with SAP ERP systems
✅ Standard MCP protocol implementation
✅ Comprehensive logging and error handling
Prerequisites
Python 3.9 or higher
SAP NetWeaver RFC SDK
Access to an SAP ERP system with appropriate credentials
pyrfclibrary (requires SAP NW RFC SDK)
Quick Start
Install SAP NetWeaver RFC SDK (see detailed instructions in Installation section)
Clone this repository:
git clone https://github.com/leocaogit/ABAP_CHECK_MCP.git cd ABAP_CHECK_MCPInstall Python dependencies:
pip install -r requirements.txtConfigure SAP connection:
cp config/config.example.json config.json # Edit config.json with your SAP credentialsDeploy ABAP function module (see
abap/DEPLOYMENT_GUIDE.md)Test the server:
python -m src.main --config config.json
Installation
1. Install SAP NetWeaver RFC SDK
The pyrfc library requires the SAP NetWeaver RFC SDK to be installed on your system.
Download:
Visit the SAP Support Portal: https://support.sap.com/en/product/connectors/nwrfcsdk.html
Download the appropriate version for your operating system (requires SAP S-user)
Installation:
macOS:
# Extract the SDK
unzip nwrfc750P_8-70002752.zip -d /usr/local/sap
# Set environment variables (add to ~/.zshrc or ~/.bash_profile)
export SAPNWRFC_HOME=/usr/local/sap/nwrfcsdk
export DYLD_LIBRARY_PATH=$SAPNWRFC_HOME/lib:$DYLD_LIBRARY_PATHLinux:
# Extract the SDK
unzip nwrfc750P_8-70002752.zip -d /usr/local/sap
# Set environment variables (add to ~/.bashrc)
export SAPNWRFC_HOME=/usr/local/sap/nwrfcsdk
export LD_LIBRARY_PATH=$SAPNWRFC_HOME/lib:$LD_LIBRARY_PATHWindows:
# Extract the SDK to C:\nwrfcsdk
# Add C:\nwrfcsdk\lib to your PATH environment variable2. Install Python Dependencies
pip install -r requirements.txtVerify installation:
python -c "from pyrfc import Connection; print('pyrfc installed successfully')"Configuration
The server can be configured using environment variables or a JSON configuration file.
Option 1: Environment Variables
Copy the example environment file and edit it with your SAP credentials:
cp config/.env.example .envEdit .env:
# SAP RFC Connection Configuration
SAP_HOST=your-sap-host.example.com
SAP_SYSNR=00
SAP_CLIENT=100
SAP_USER=your-username
SAP_PASSWORD=your-password
# Logging Configuration (optional)
LOG_LEVEL=INFOOption 2: Configuration File
Copy the example configuration file and edit it with your SAP credentials:
cp config/config.example.json config.jsonEdit config.json:
{
"rfc": {
"host": "your-sap-host.example.com",
"sysnr": "00",
"client": "100",
"user": "your-username",
"password": "your-password"
},
"log_level": "INFO"
}Security Note: Never commit files containing real credentials to version control.
Usage
Starting the MCP Server
Using a configuration file:
python -m src.main --config config.jsonWith custom log level:
python -m src.main --config config.json --log-level DEBUGMCP Client Configuration
For Claude Desktop
Edit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"abap-syntax-checker": {
"command": "python",
"args": ["-m", "src.main", "--config", "config.json"],
"cwd": "/absolute/path/to/ABAP_CHECK_MCP"
}
}
}For Kiro
Create or edit .kiro/settings/mcp.json in your workspace:
{
"mcpServers": {
"abap-syntax-checker": {
"command": "python",
"args": ["-m", "src.main", "--config", "config.json"],
"cwd": "/absolute/path/to/ABAP_CHECK_MCP",
"disabled": false,
"autoApprove": ["check_abap_syntax"]
}
}
}Using the Tool
Once configured, the check_abap_syntax tool will be available in your IDE.
Example Usage:
Check this ABAP code for syntax errors:
REPORT ztest.
DATA: lv_test TYPE string.
lv_undefined = 'test'.
WRITE: / lv_test.Response:
{
"success": true,
"has_errors": true,
"errors": [
{
"line": 3,
"type": "E",
"message": "Field \"LV_UNDEFINED\" is unknown."
}
],
"message": "Syntax check completed with errors"
}SAP Backend Setup
The MCP server requires an ABAP function module to be deployed in your SAP ERP system.
Quick deployment summary:
Create structure
ZSYNTAX_ERRORin SE11Create function group
ZSYNTAX_CHECKin SE80Create function module
Z_CHECK_ABAP_SYNTAXin SE37Copy implementation code and activate
For detailed step-by-step instructions, see:
Deployment Guide:
abap/DEPLOYMENT_GUIDE.mdABAP README:
abap/README.md
Project Structure
.
├── src/ # Source code
│ ├── __init__.py
│ ├── main.py # Entry point
│ ├── server.py # MCP server implementation
│ ├── rfc_client.py # RFC client wrapper
│ ├── config.py # Configuration management
│ ├── models.py # Data models
│ ├── tool_handler.py # MCP tool handler
│ └── logger.py # Logging configuration
├── tests/ # Test files
│ ├── __init__.py
│ └── test_tool_handler.py
├── abap/ # ABAP artifacts
│ ├── function_module/
│ ├── function_group/
│ ├── types/
│ ├── DEPLOYMENT_GUIDE.md
│ └── README.md
├── config/ # Configuration files
│ ├── .env.example
│ └── config.example.json
├── pyproject.toml # Project configuration
├── requirements.txt # Dependencies
└── README.md # This fileDevelopment
Running Tests
pytestCode Formatting
black src/ tests/Troubleshooting
RFC Connection Issues
Problem: Error: Cannot connect to SAP system
Solutions:
Verify SAP system is accessible from your network
Check credentials and client number are correct
Ensure SAP NetWeaver RFC SDK is properly installed
Check firewall settings for RFC ports
Syntax Check Errors
Problem: Function module Z_CHECK_ABAP_SYNTAX not found
Solutions:
Verify the ABAP function module is deployed (see
abap/DEPLOYMENT_GUIDE.md)Check the function module name is exactly
Z_CHECK_ABAP_SYNTAXEnsure the function module is activated in SE37
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Support
For issues and questions, please open an issue on the GitHub repository.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/leocaogit/ABAP_CHECK_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server