sap-rfc
A Model Context Protocol (MCP) server that provides seamless integration with SAP systems through RFC (Remote Function Call) connections. This server enables AI assistants and applications to interact with SAP functions, retrieve metadata, and perform operations with enhanced caching and version compatibility.
claude mcp add --transport stdio thupalo-sap-rfc-mcp-server python -m sap_rfc_mcp_server.server \ --env SAP_LANG="Language code (e.g., EN)" \ --env SAP_USER="SAP username" \ --env SAP_SYSNR="SAP system number" \ --env SAP_ASHOST="SAP application server host" \ --env SAP_CLIENT="SAP client number" \ --env SAP_PASSWD="SAP password"
How to use
This MCP server provides an interface to SAP RFC (Remote Function Call) functionality through an MCP-compatible server. It enables AI assistants and applications to discover SAP RFC metadata, execute RFC functions, and manage SAP connection parameters securely with a focus on intelligent caching and version awareness. Through the included RFC metadata management tools, you can preload function metadata, search across cached definitions, and perform bulk loads to accelerate integration. The server exposes an MCP-compliant API and an HTTP server for web-style interactions, making it suitable for both model-driven assistants and traditional applications that need SAP connectivity.
To use the server, first configure secure SAP connections (via the Security Manager or .env/encrypted storage options) and then start the MCP server. The Python-based startup supports intelligent port management and process-driven startup for reliable operation in development and production. The metadata components let you query RFC metadata (e.g., RFC_READ_TABLE) with language-specific metadata as well as perform bulk operations to populate caches for fast access during inference or runtime.
Key capabilities include:
- SAP RFC integration through pyrfc-backed calls
- MCP-compatible function discovery and invocation
- Intelligent caching with TTL and compressed storage
- Metadata search and bulk load across multiple RFCs
- Language-aware descriptions and SAP version handling
- Secure configuration management with multiple storage backends
How to install
Prerequisites
- Python 3.9 or higher
- SAP NetWeaver RFC SDK (for pyrfc) and access to an SAP system with RFC connectivity
- Optional: docker or other environment managers if you prefer containerized setup
Automated Setup (Recommended)
- Clone the repository and install development environment
# Clone the repository
git clone https://github.com/thupalo/sap-rfc-mcp-server.git
cd sap-rfc-mcp-server
# Automated development environment setup (includes SAP NetWeaver RFC SDK validation)
python tools/setup_dev.py
Manual Installation
- Install SAP NetWeaver RFC SDK from SAP
- SAP NW RFC SDK Download: https://support.sap.com/en/product/connectors/nwrfcsdk.html
- Install Python package
# Clone the repository
git clone https://github.com/thupalo/sap-rfc-mcp-server.git
cd sap-rfc-mcp-server
# Install dependencies
pip install -e .
# For development
pip install -e ".[dev]"
- Configure SAP Connection Recommended: Interactive Security Manager
# Interactive setup with secure credential management
python -m sap_rfc_mcp_server.sap_security_manager setup
# Test your configuration with connection validation
python -m sap_rfc_mcp_server.sap_security_manager test
# View your security configuration status
python -m sap_rfc_mcp_server.sap_security_manager info
Security methods include environment variables, .env files, system keyring, and encrypted files. For quick setups, you can place variables in a .env file as described in the project docs:
# SAP Connection Parameters
SAP_ASHOST=your-sap-hostname
SAP_SYSNR=00
SAP_CLIENT=100
SAP_USER=your-username
SAP_PASSWD=your-password
SAP_LANG=EN
- Start the MCP server (example)
# Start the MCP server (example as shown in docs)
python -m sap_rfc_mcp_server.server
Notes
- The setup includes validation of prerequisites and troubleshooting guidance if required components are missing.
- If you need HTTP endpoints for web applications, you can start the HTTP server as shown in the docs.
Additional notes
Tips and common issues:
- Ensure the SAP NW RFC SDK is installed and the SDK libraries are discoverable in your environment (e.g., via LD_LIBRARY_PATH on Linux or PATH on Windows).
- For secure storage, prefer Interactive Security Manager or system keyring backends; avoid plain-text credentials in source or logs.
- If you encounter port conflicts, the included port management utilities can help auto-resolve and suggest available ports.
- Use bulk metadata loading to minimize latency when bootstrapping the server in a new SAP environment.
- When running in containers, ensure the SAP RFC libraries and environment variables are wired into the container image and runtime environment.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP