SAP connector for Claude
Read-only SAP S/4HANA MCP connector for Claude: inspect data, run SAP-side calculations, execute/export reports, fetch attachments, and browse development/customizing/OData metadata under session and usage controls.
Read any SAP table/view like SE16; describe fields; page/filter results.
Aggregate in SAP (SUM/COUNT/MIN/MAX/AVG, GROUP BY, top N) and find duplicate rows.
Run finance calculations: trial balance by period, open-item ageing, GR/IR differences.
Search, inspect, and run SAP GUI reports; save ALV output to Excel or lists to text.
Retrieve GOS document attachments to Downloads without returning file contents.
Inspect ABAP source, program parts, Smart Forms, and SO10 texts.
Look up customizing shortcuts: pricing condition types, pricing procedures, MM account determination.
Browse OData services, get metadata, and query entity sets with OData v2 options.
Manage SAP session: login, whoami, list/switch environments, and token budget.
Read-only/security controls: no POST/PUT/PATCH/DELETE, per-user keychain login, local logging, Excel for large results.
Provides read-only access to SAP S/4HANA via OData and SAP Gateway, enabling table reads and descriptions, in-SAP aggregations and finance calculations such as trial balances, open-item ageing, GR/IR differences, and duplicate checks. It can also find and run SAP GUI reports with ALV output exported to Excel, fetch GOS attachments, query OData services, and access customizing shortcuts.
Click on "Deploy 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 connector for Claude Show me the trial balance by period for company code 1000 in 2024"
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 connector for Claude
A read-only MCP server that lets Claude work with SAP S/4HANA directly: read any table the way SE16 does, let SAP do the arithmetic (totals, trial balance, ageing, GR/IR, duplicate checks), run your SAP GUI reports and export them to Excel, and fetch document attachments. Built for finance teams, with token efficiency as the main design goal. It runs as a Claude plugin on Windows and macOS.
What it can do
Area | Tools |
Table reads |
|
Calculations inside SAP |
|
SAP GUI reports |
|
Attachments |
|
Development |
|
Customizing shortcuts |
|
OData |
|
Session |
|
Related MCP server: sap-mcp-server
How it works
Python MCP server (
src/sap_mcp,mcpSDK 2.x) talking to SAP Gateway over OData v2, GET only.One small custom Gateway service,
ZCFG_READ_SRV, does table reads and calculations inside SAP (ReadTable,GetTableFields,Compute). ABAP source and a step-by-step SEGW / transport guide are insap_side/. New calculations are new ABAP operations only; no SEGW change.Claude plugin (
plugin/):launch.cmd/launch.shinstall a private Python environment on first start;tools/build_plugin.pyassembles the folder you publish to your Claude organisation.
Security model
Read-only. The client refuses POST / PUT / PATCH / DELETE. (
run_sap_reportruns real reports; the tool text tells Claude to ask before running anything that could post.)Everyone logs in as themselves.
sap_loginopens a small window; the password never passes through the chat and is stored in the OS keychain (Windows Credential Manager or the macOS Keychain). SAP authorizations decide what each user sees.No credentials or server addresses in the code. Your systems live in a git-ignored
site.json.Usage controls: large results are saved to Excel instead of being sent to Claude; each conversation has a data allowance that only the user can extend (a click in a window); every call is logged locally.
Set-up
SAP side: build
ZCFG_READ_SRVwith the guide insap_side/README.mdand activate it in your systems.Your systems: copy
site.example.jsontosite.jsonand fill in your Gateway addresses, clients and a one-line company note (company codes, chart of accounts, currency). Without it, the login window asks each user for the server address.Build the plugin:
python tools/build_plugin.pycreates../sap-plugin, with yoursite.jsoninside.Publish that folder to your Claude organisation's plugin library, or add it as a local plugin.
Use it: in Claude, say "log in to SAP", then ask your question.
Users need network access to your SAP Gateway (office network or VPN for internal systems).
Development
python -m venv .venv
.venv\Scripts\pip install -e ".[dev]" # macOS: .venv/bin/pip
.venv\Scripts\python -m pytest # offline, SAP calls are mockedDesign rules and lessons learned are in CLAUDE.md.
Licence
MIT, see LICENSE. SAP and S/4HANA are trademarks of SAP SE; this project is not affiliated with SAP.
Available Tools
22 toolsaccount_determinationA
MM account determination (OBYC / T030) with G/L names. transaction key e.g. WRX (GR/IR), BSX (inventory), GBB (offsetting), PRD (price diff), KDM (FX diff). chart_of_accounts: empty = the configured chart(s); "*" = all incl. SAP sample charts (only if asked). Optional valuation_class (BKLAS), account_modifier (KOMOK), valuation_modifier (BWMOD).
Inputs: language, transaction, valuation_class, account_modifier, +2 more. Returns: result
aggregate_sap_tableA
Totals computed in SAP: one call instead of paging rows. measures: comma list of SUM:f, AVG:f, MIN:f, MAX:f, COUNT, COUNTD:f (results named SUM_HSL, ROW_COUNT, COUNTD_BELNR...). group_by: comma fields (empty = one row). where: ABAP Open SQL. order_by: result columns, e.g. "SUM_HSL DESC" with top=20. top max 1000. E.g. TB: table=ACDOCA, measures=SUM:HSL, group_by=RACCT, where="RLDNR = '0L' AND RBUKRS = '1000' AND GJAHR = '2026'".
Inputs: table (required), top, where, group_by, +2 more. Returns: result
condition_typesA
Pricing condition types (T685/T685T/T685A) with texts, access sequence and control data. No condition_type: paged list (limit/offset; prefer search, sales has ~1000); with one: all filled fields. application: V sales, M purchasing, TX tax. usage A = pricing. language: 1-letter key.
Inputs: limit, usage, offset, search, +3 more. Returns: result
describe_sap_tableA
A table's fields (name, type, length, key, description); cached 7 days. search filters by name or description; refresh re-reads from SAP.
Inputs: table (required), search, refresh. Returns: result
find_duplicatesA
Groups of rows sharing the same values on fields (comma list), computed in SAP, most frequent first. E.g. duplicate invoices: table=RBKP, fields=LIFNR,XBLNR,RMWWR. where: ABAP Open SQL. min_count default 2; top max 1000.
Inputs: table (required), fields (required), top, where, +1 more. Returns: result
find_sap_reportsA
Find reports by name pattern (programs and their transaction codes, with titles), e.g. "ZFI*", "AGEING".
Inputs: top, pattern. Returns: result
get_attachmentsA
GOS attachments of an SAP document: lists them and saves the files to Downloads/SAP attachments (content is never returned; open the saved file). kind: invoice (MIRO, needs year), material_doc (needs year), po, fi (needs year + company_code). Or raw object_type + object_key (e.g. BUS2091). download=false only lists.
Inputs: kind, year, folder, number, +4 more. Returns: result
get_service_metadataB
OData service structure: entity sets, or one entity's keys and fields (cached 7 days). raw=true returns the full EDMX (very large; avoid). refresh re-downloads.
Inputs: service (required), raw, entity, refresh. Returns: result
grir_differencesA
GR/IR differences computed in SAP from EKBE: per PO item, GR vs IR quantity and value, only mismatches. Optional vendor, po, key_date (YYYY-MM-DD, default today). top max 1000.
Inputs: company_code (required), po, top, vendor, +1 more. Returns: result
list_environmentsB
SAP systems available, which is active, and login status. No SAP call.
Inputs: no named parameters. Returns: result
list_servicesB
Search the Gateway catalog for OData services by name/title substring. Prefer a search term over paging.
Inputs: limit, offset, search. Returns: result
open_items_ageingA
Vendor/customer ageing computed in SAP: open items at key_date (YYYY-MM-DD, default today) per partner in buckets by days past net due (not due, 1-30, 31-60, 61-90, 91-180, >180), with names. account_type: vendor | customer. top max 1000.
Inputs: account_type (required), company_code (required), top, partner, +1 more. Returns: result
pricing_procedureB
Steps of a pricing procedure (T683S, as in V/08 / M/08) with texts; only filled fields, field_legend explains columns. application V/M/TX or empty for all; usage A = pricing.
Inputs: name (required), usage, language, application. Returns: result
query_entityC
Generic OData v2 query ($select/$filter/$orderby/$top/$skip/$expand) on a service's entity set.
Inputs: service (required), entity_set (required), top, skip, +4 more. Returns: result
read_sap_tableA
Read rows of any SAP table or DB view, like SE16. FIRST CHOICE for SAP data. For totals use aggregate_sap_table; unsure of field names: describe_sap_table. where: ABAP Open SQL, not OData: 'quoted' literals, internal formats (leading zeros, dates '20250401'), e.g. "KAPPL = 'M' AND KSCHL LIKE 'Z%'". fields: comma list (keys always included); name them, wide tables get large. top max 1000; page with skip (answer gives next_skip). drop_empty omits blank fields.
Inputs: table (required), top, skip, where, +2 more. Returns: result
run_sap_reportA
Run an SAP GUI report (tcode or program) and save its output: ALV to Excel with the report's own headings (Downloads/SAP reports), classic lists to text. Returns path, columns, preview; read the file for the rest. ASK THE USER FIRST before any report that may post, change or send anything. variant: saved variant (easiest). selections override it: {"S_BUKRS": "1000", "P_KEYDT": "20260930", "S_KUNNR": ["1000","1001"], "S_BUDAT": {"low": "20260401", "high": "20260930"}}, internal formats. max_rows max 5000. No popups; must finish in ~55 s.
Inputs: report (required), folder, variant, max_rows, +1 more. Returns: result
sap_loginA
Opens a login window on the user's screen for their own SAP user (password never in chat; kept in the OS keychain). Use when a tool reports missing or rejected credentials, or when asked. env: prod (default) | dev. Waits up to 10 min.
Inputs: env. Returns: result
sap_report_infoA
A report's selection fields and saved variants (report = tcode or program). Call before run_sap_report.
Inputs: report (required). Returns: result
switch_environmentA
Point all SAP tools at prod or dev (also production/development/test/SID) for this session. Non-prod answers carry _sap_env: never report them as live books. Same env = reload login.
Inputs: env (required). Returns: result
token_budgetB
SAP data pulled in this conversation, per tool, and the limits. No SAP call. reset=true asks the USER in a window for more allowance.
Inputs: reset. Returns: result
trial_balance_by_periodA
Trial balance from ACDOCA computed in SAP: per G/L account opening (incl. carry-forward), period debit/credit, closing, with names. periods 1-16 (opening = periods before period_from); optional account range; ledger default 0L. Full-year results are also saved to Excel.
Inputs: fiscal_year (required), company_code (required), ledger, period_to, +3 more. Returns: result
whoamiC
Active SAP system, host, client and user.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Most tools occupy distinct niches: purpose-built analytics (trial_balance_by_period, open_items_ageing, grir_differences, account_determination, pricing_procedure) are clearly separable, and descriptions explicitly steer choices (read_sap_table 'FIRST CHOICE', aggregate for totals, describe for field names). Minor overlap remains between query_entity (OData) and read_sap_table (Open SQL/SE16) and between find_duplicates and aggregate_sap_table with group_by, but the descriptions disambiguate them adequately.
All names are lowercase snake_case, giving a predictable surface. However the convention mixes verb_noun (list_services, query_entity, read_sap_table, run_sap_report) with bare noun phrases for report-style tools (grir_differences, trial_balance_by_period, token_budget, condition_types), which is a readable but noticeable deviation rather than a single unified pattern.
22 tools is on the high side of the ideal range, but each maps to a genuinely distinct SAP capability (connectivity/auth, metadata discovery, generic table access, aggregation, and several packaged finance/MM analyses). Nothing looks like filler, though a couple of generic query tools could in principle be folded together.
The surface covers the full read/analysis lifecycle: environment and login management, service and table metadata, raw and aggregated reads, duplicate detection, targeted finance/MM reports, report discovery/execution, and attachment retrieval. Gaps are mainly by design (no write/update/post operations, no master-data lookup helpers), which agents can work around via read_sap_table and run_sap_report.
Maintenance
Related MCP Connectors
Read and write Sage Intacct from Claude or ChatGPT. Write tools are flagged for approval.
Read-only access to a company's ERP for Claude, ChatGPT and Gemini, with OAuth and an audit trail.
Read-only finance and operations controls for AI agents with evidence and safe next actions.
Connect Claude to Dutch accounting software: e-Boekhouden invoices, contacts and ledgers.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables Claude, ChatGPT, Copilot and Cursor to explore and query SAP S/4HANA's HANA database using SAP's data dictionary, organization structure, CDS views, and read-only SQL, with tools for finding tables, fields, joins, code values, and running SELECT queries. All access is read-only, with encrypted credentials and audited calls.4AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables Claude to read SAP ECC and S/4HANA data through OData and RFC/BAPI calls, with writes gated behind a human confirmation step and every call written to an audit log. No proprietary SAP NetWeaver RFC SDK is required.6MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude to query a SAP system in natural language and read ABAP programs, classes, tables, and other object definitions through the SAP ADT protocol, with read-only access and table content disabled by default in quality and production systems. Credentials are stored in the Windows Credential Manager, and a guided setup assistant tests and wires the connection to Claude Desktop and Claude Code.MIT
- AlicenseAqualityCmaintenanceEnables Claude and other MCP clients to query Stripe receivables, payouts, disputes, balance, approved supplier bills, and cash forecasts in plain English through read-only finance tools.8MIT