SAP RFC MCP Server
Provides tools for interacting with SAP systems via RFC, including calling BAPIs/RFCs, reading tables with overflow protection, retrieving system metadata, and managing SAP function metadata for AI agents.
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., "@SAP RFC MCP Servershow me the first 10 rows of table MARA"
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.
SAP RFC MCP Server
An enterprise-grade SAP RFC connector based on the Model Context Protocol (MCP). This project aims to provide AI agents (such as Claude Desktop, GPT-4, Cursor, etc.) with secure, efficient, and context-aware access to SAP systems. Through the standardized MCP protocol, agents can execute SAP RFCs and retrieve business data as if calling local functions.
š Project Highlights
Enterprise-Grade Security: Supports a Master Key management architecture with dynamic token generation, expiration management, and one-click revocation.
Full-Chain Tracing: Identity-aware logging system where every log includes the client IP and agent identity, with automatic daily rotation at midnight.
Intelligent Table Reading: Built-in data buffer protection mechanism that automatically handles
DATA_BUFFER_EXCEEDEDerrors and supports iterative, secure reading of large-scale data.AI-Optimized Metadata: Provides detailed function interface definitions, parameter descriptions, and supports exporting knowledge bases in RAG-friendly (Retrieval-Augmented Generation) formats.
High-Availability Sessions: Supports intelligent session reuse; agents do not need to manually manage Session IDs, as the system automatically restores active sessions based on tokens.
š Core Capabilities (Tools)
This server exposes the following toolset to MCP clients, covering the entire process from system discovery to data operations:
1. Core RFC Interaction
call_rfc_function: Dynamically calls any SAP RFC function, supporting parameter passing for complex nested structures.rfc_system_info: Retrieves metadata such as SAP system version, protocol, kernel, and database type.get_rfc_functions: Queries available remote call functions in the SAP system via fuzzy matching.
2. Secure Data Reading
read_table: A table reading tool with automatic overflow protection that automatically selects fields based on the RFC 512-byte limit.read_table_complete: Iterative reading mode that supports requesting large numbers of fields exceeding buffer limits, with automatic batch processing.get_table_structure: Retrieves detailed definitions of SAP tables, including technical field attributes and multi-language descriptions.test_table_access: Quickly verifies the current user's read permissions and data connectivity for specific tables.
3. Metadata Management
get_function_metadata: Retrieves the complete "manual" for a function, including parameter direction, type, length, and multi-language comments.search_rfc_functions: Performs full-text search on function names and descriptions to help agents discover appropriate interfaces.export_metadata_for_rag: Exports SAP interface knowledge as JSON for building offline knowledge bases for agents.
āļø Running Modes
The project supports three running modes to meet integration needs in different scenarios:
HTTP Mode (Default): Based on streamable HTTP transport provided by FastAPI, supporting streaming (SSE) responses, suitable for remote agent access.
STDIO Mode: Communicates via standard input/output, suitable for locally installed MCP clients like Claude Desktop.
Dual Mode: Enables both HTTP and STDIO simultaneously, balancing local debugging and remote service needs.
š¦ Quick Deployment
1. Environment Requirements
Python: 3.9 or higher.
SAP NW RFC SDK: Must install the official SAP SDK and configure the
SAPNWRFC_HOMEenvironment variable.
2. Installation
git clone <repo_url>
cd sap-rfc-mcp-server
python -m venv .venv
source .venv/bin/activate # Windows ä½æēØ .venv\Scripts\activate
pip install -e .3. Configuration
Copy .env.example to .env and fill in your SAP connection parameters and security keys:
# SAP čæę„
SAP_ASHOST=192.168.1.100
SAP_SYSNR=00
SAP_CLIENT=100
SAP_USER=YOUR_USER
SAP_PASSWD=YOUR_PASSWD
# å®å
ØåÆé„
MCP_MASTER_KEY=admin-secret-key-2026š Authentication Guide
The server uses a two-layer authentication architecture:
Management Layer (Master): Uses
MCP_MASTER_KEYto access/auth/*endpoints to perform token issuance.Business Layer (Agent): Uses generated dynamic tokens to access
/mcp/*endpoints to call SAP functions.
Example of generating a token (using Master Key):
POST /auth/token/generate
X-API-Key: admin-secret-key-2026
Body: {"agent_name": "Finance_Agent", "ttl_hours": 48}š Project Structure
sap_rfc_mcp_server/
āāā auth.py # åØę Token ē®”ēäøęä¹
å
āāā server.py # MCP å·„å
·å®ä¹äøå¤ēę øåæé»č¾
āāā sap_client.py # åŗå± pyrfc čæę„ē®”ēäøę± å
āāā rfc_table_reader.py # å¢å¼ŗå蔨ę°ę®å®å
ØčÆ»åé»č¾
āāā streamable_http_server.py # HTTP/SSE ä¼ č¾å±å®ē°
āāā logger.py # 身份ęē„ēčŖåØååę„åæē³»ē»
āāā metadata_manager.py # SAP å
ę°ę®åęäø RAG ä¼åš More Documentation
QUICKSTART.md: 5-minute quick start guide.
MODES_GUIDE.md: Detailed explanation of running modes and configuration.
DEPLOY.md: Systemd and Docker deployment for production environments.
Ā© 2026 SAP RFC MCP Server Team. Licensed under MIT.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors ā no code.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Time-90/sap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server