# Repository Briefing: w1ccc/sap-data-mcp
> Source: https://repoforai.com/repo/w1ccc/sap-data-mcp (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/w1ccc/sap-data-mcp
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A (77/100 · Maintenance 35/35 · Adoption 2/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.2.0 (2026-11-22) — https://github.com/w1ccc/sap-data-mcp/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Self-Hosted, MCP, CLI
- **Momentum**: 203 ★ total (+0 24h / +16 7d) · 1 forks
- **Topics**: `ai-agents`, `bapi`, `erp`, `llm`, `mcp`, `mcp-server`, `model-context-protocol`, `odata`, `pyrfc`, `python`, `rfc`, `s4hana`
- **When to Use**: Best for: SAP operations and business teams that need conversational, auditable cross-object lookups against an authorized S/4HANA system, such as tracing purchase orders through invoices and supplier open items. Skip if: You need transactions that write or approve records, arbitrary query construction, deterministic scheduled reporting, or a deployment where SAP results cannot be exposed to the chosen assistant.

## Overview
```text
### Architecture & Core Mechanics
SAP Data MCP splits S/4HANA access across three Python MCP servers: `private_cloud/rfc`, `private_cloud/odata`, and `public_cloud/api`. An MCP client launches the selected `server.py` and invokes a named tool, which dispatches to an SAP function or a predefined HTTP endpoint. Each server keeps its configuration, credentials, and logs separate. The base manifest pins `mcp[cli]==2.2.0`, `httpx==0.28.1`, and `python-dotenv==1.2.3`; the RFC route additionally needs PyRFC and the SAP NW RFC SDK.

The protocol boundary is deliberately narrow. The RFC connector rejects functions outside `READ_ONLY_FUNCTIONS`. The HTTP routes use fixed GET requests for data, reserve POST for OAuth token acquisition, keep TLS verification enabled, and do not accept credentials, arbitrary URLs, or raw OData queries as tool inputs. Each call is written to `logs/tool_calls_YYYY-MM-DD.jsonl` with its arguments, status, duration, and SAP function or API path. Credential values are redacted in errors and logs.

### Key Capabilities & Differentiators
The three routes register 95 RFC tools, 159 private-cloud OData tools, and 158 public-cloud API tools. The 412 total counts registrations, not distinct operations: equivalent tools can appear on more than one route. Coverage spans MM/IM, PP, SD, WM/EWM, FI, CO, master data/MDG, and QM. RFC also adds Basis and interface monitoring, including short dumps, background jobs, IDocs, and RFC queues, as well as read-only table and source inspection and reviewed display-only reports.

A purchase-order payment inquiry can combine the order and its history with supplier invoices and open items. The result contract preserves SAP field names, identifiers, amounts, units, currencies, zero values, and `false`. Lists paginate via `max_results` and `offset`; `ok`, `not_found`, `partial`, and `error` give the assistant a basis for distinguishing missing, incomplete, and failed reads. Those signals do not establish a business conclusion: an empty list does not prove a zero balance, and a clearing reference does not prove payment.

### Trade-offs & Limitations
Compared with navigating SAP GUI transactions, the MCP layer is most useful for investigations that cross business objects. It also avoids the per-workflow authentication and pagination code of a bespoke RFC or OData script. The trade-off is a narrower interface: the assistant cannot submit arbitrary OData queries or invoke arbitrary RFC functions. A direct integration is a better fit for a stable report that needs deterministic processing, and SAP GUI or an authorized workflow is still required to create, post, or approve documents.

Actual coverage depends on activated services and the SAP account’s authorizations. Use least-privilege credentials and review the RFC inspection tools separately from ordinary business lookups. Local secrets and credential redaction do not prevent returned business data from reaching the MCP client and potentially its model provider. Audit records also contain arguments, so restrict access and set retention deliberately. The MIT license covers the project code; the server is independent of SAP and is not an official SAP product.

### Hardware & Deployment Guide
The quickstart uses Python 3.12 in a virtual environment. For an HTTP route, copy `.env.example` into `private_cloud/odata` or `public_cloud/api` as `.env`, then set `SAP_API_BASE_URL` and configure Basic authentication or OAuth client credentials. Register the virtual environment interpreter and the route’s `server.py` by absolute path in Claude Desktop, Claude Code, Cursor, or another compatible MCP client. Run `health_check` first, then validate a representative SAP service with the intended account.

RFC adds the SAP NW RFC SDK and PyRFC setup described in `private_cloud/rfc/docs/GOLDEN_PATH.md`. The MCP server is self-hosted, but live queries still need network access to SAP; offline regression tests in `tests/` use SAP-shaped fixtures and do not validate tenant configuration or permissions. The RFC tests import PyRFC. v0.2.0 is the first public release and includes all three routes, so validate the selected route in a representative environment before relying on its tool count as a measure of usable coverage.
```

## Key Capabilities
```text
- Route selection: Three independently configured MCP servers for RFC/BAPI, private-cloud OData, and public-cloud Released APIs.
- Tool surface: v0.2.0 registers 95 RFC, 159 private OData, and 158 public API tools; the 412 total includes overlapping tools.
- Read-only enforcement: RFC checks a 98-function allowlist; SAP data requests use predefined GETs, with POST reserved for OAuth token acquisition.
- Result semantics: `ok`, `not_found`, `partial`, and `error` distinguish query outcomes, while `max_results` and `offset` support pagination.
- Audit trail: Daily JSONL logs capture arguments, status, duration, and the SAP function or API path and are queryable through `get_tool_call_log`.
- RFC diagnostics: Basis tools cover short dumps, background jobs, IDocs, and qRFC, tRFC, and bgRFC queues.
```

## Quick Start / Clone
```bash
git clone https://github.com/w1ccc/sap-data-mcp.git
cd sap-data-mcp
py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
Copy-Item .env.example public_cloud\api\.env
```
