Enterprise5-minute read10 MCP tools7 languages

SAP HANA MCP Server: Read S/4HANA with SAP's Data Dictionary

An open-source SAP HANA MCP server for Claude, ChatGPT and Copilot: SAP's data dictionary and CDS views as tools, read-only SQL, self-hosted with Docker.

HCBy HelpCode teamUpdated 5 min read Open-source on GitHub

Open source · AGPL-3.0 · runs on your own server

SAP S/4HANA (HANA SQL)

SAP S/4HANA (HANA SQL)

Read SAP S/4HANA straight from its HANA database with SQL, with SAP's own data dictionary turned into tools: table and field labels, code values, join paths, released CDS views and a guide to the finance, sales and inventory data model. Read-only.

tools

10

Region

INTL

Category

ERP

Authentication

Connection string

Required env vars

SAP_HANA_HOSTSAP_HANA_PORTSAP_HANA_TENANTSAP_HANA_SCHEMASAP_CLIENTSAP_LANGUAGESAP_HANA_TLSSAP_HANA_USERSAP_HANA_PASSWORD
Self-host with Docker

Open source · AGPL-3.0 · runs on your own server

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Summary

An open-source SAP HANA MCP server for Claude, ChatGPT and Copilot: SAP's data dictionary and CDS views as tools, read-only SQL, self-hosted with Docker.

Try asking

Example prompts for SAP S/4HANA (HANA SQL)

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

SAP S/4HANA (HANA SQL) · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

TL;DR: AnythingMCP is an open-source MCP server that reads SAP HANA. Any HANA database works as a plain database connector; for SAP S/4HANA there is a dedicated connector that turns SAP's own data dictionary and CDS views into tools, so the model knows what BUKRS, HSL or VBRK mean before it writes SQL. Every session is read-only in HANA itself, capped at 1,000 rows and timed out. It runs with Docker Compose inside the network that reaches HANA, and Claude, ChatGPT, Copilot, Cursor and Claude Code connect to it over MCP.

AI client
Claude
ChatGPT
Copilot
MCP over HTTPS · OAuth
Inside your network
AnythingMCP
self-hosted
  • 10 sap_* tools
  • Roles and tool access
  • Read-only by default
  • Audit log
SQL · TLS
SAP
SAP S/4HANA
HANA · SAPHANADB
SQL user with SELECT only
AMCP_READER
Data dictionary
DD02L · DD03L · DD04T
The MCP server runs next to SAP. Clients reach it over MCP; only it reaches HANA.

Two ways to use HANA

Database connector (hana://)SAP S/4HANA (HANA SQL) connector
ForAny SAP HANA databaseThe HANA database under S/4HANA
ToolsSchema, example and query tools generated from the database, or your own parameterized queries10 ready tools: sap_guide, SAP's dictionary, CDS views, org structure, sap_query
What the model seesTable and column namesSAP's business labels, currency fields, code values, joins, released views
SetupConnection string and a userConnection details, a read-only user and the grants in the setup guide

Quick start

On a host that reaches the HANA SQL port:

mkdir anythingmcp && cd anythingmcp
curl -fsSLo docker-compose.yml \
  https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
echo 'SSRF_ALLOWED_HOSTS=hana.internal' >> .env   # private hosts are refused otherwise
docker compose up -d   # → http://localhost:3000

Then Connectors → Marketplace → SAP S/4HANA (HANA SQL), or Add Connector → Database with a hana:// connection string for any other HANA database. The sap-hana-mcp-server repository packages the same connector with an install script and a smoke test.

Connection string

hana://host:port/?databaseName=TENANT&currentSchema=SCHEMA&sapClient=100&tls=verify
OptionMeaning
host, portThe tenant database's SQL port: 3<instance>15 for the first tenant, 3<instance>41 and up for further tenants. The system database port 3<instance>13 works with databaseName, but may redirect to an internal host name.
databaseNameTenant name in a multi-container system. Also accepted as the path: hana://host:30013/S4P.
currentSchemaSchema for unqualified names, e.g. SAPHANADB or SAPABAP1.
sapClientThe three-digit SAP client. Sets the CDS_CLIENT session variable, without which SAP's CDS views return no rows.
tlsverify (default), no-verify for a self-signed certificate, or off.
statementTimeoutSeconds before a statement is cancelled. Default 60, maximum 600.
driverhdb (default, bundled) or hana-client.

User and password go into the connector's credentials, stored encrypted, never into the URL.

How Claude finds the data

  1. sap_guide explains SAP's data model for SQL by topic: basics, finance, sales, inventory, procurement, operations, pitfalls and query recipes.
  2. sap_org_structure scopes the question: company codes with currency and fiscal year variant, plants, sales and purchasing organizations.
  3. sap_search_cds_views and sap_search_tables find where the data lives, flagging compatibility views that plain SQL would read wrongly.
  4. sap_describe_table, sap_find_fields, sap_field_values and sap_table_relations give labels, currency fields, code meanings and joins.
  5. sap_query runs one read-only SELECT.

The dictionary tools are fixed, read-only queries on SAP's own tables (DD02L, DD03L, DD04T, DD07T, DD08L, DDHEADANNO, DDFIELDANNO). Every tool and its SQL is visible on the connector page.

Guarantees

The database grants remain the real boundary: SQL does not apply SAP's application authorizations, so create a user that can read only what the model may see. Direct SQL on the ABAP schema by a third-party application is governed by your HANA licence: a runtime licence bundled with S/4HANA usually does not cover it, a full-use licence does.

Drivers

AnythingMCP ships hdb, SAP's pure-JavaScript HANA driver (Apache-2.0): user and password, TLS, multi-tenant systems. SAP's native @sap/hana-client adds Kerberos, hdbuserstore and connection pooling, but its licence does not allow redistribution, so you install it into your own deployment and select it with driver=hana-client or HANA_DRIVER=hana-client. Details: SAP HANA in the AnythingMCP docs.

Compared with a generic HANA MCP server

A generic HANA MCP server lists schemas and runs SQL. On an S/4HANA system that is not enough: the model sees tens of thousands of tables with abbreviated names, amounts without their currency field, and compatibility views that return wrong totals. The S/4HANA connector adds SAP's data dictionary, CDS views and a guide to the data model, so the model picks the right table and states its assumptions. It also works from any MCP client, with roles, an audit log and the read-only guarantees above.

FAQ

Is there an SAP MCP server? Yes. AnythingMCP includes MCP connectors for SAP S/4HANA (HANA SQL and OData), S/4HANA Cloud, SAP Business One and SAP Concur, open source and self-hosted. This page covers the HANA one; Connect SAP to Claude lists them all.

How do I get started with the HANA MCP server? Run AnythingMCP with Docker Compose on a host that reaches the HANA SQL port, add the host to SSRF_ALLOWED_HOSTS, install the SAP S/4HANA (HANA SQL) connector with a read-only database user and add the MCP server to your client. The setup guide has the SQL for the user and its grants.

Can the model write to HANA? No. The session is read-only in HANA, only a single SELECT runs, and writes and locking reads are refused.

Does it work with SAP ECC or Business One? Not through this connector: it reads S/4HANA's tables and CDS views. ECC connects through its SAP Gateway OData services, Business One through its Service Layer.

Which MCP clients work? Claude (claude.ai, Desktop and Code), ChatGPT (paid plans), GitHub Copilot, Cursor and any other client that speaks MCP over HTTP.

Next steps

Was this guide helpful?

Your SAP S/4HANA agent is one click away.

Install the connector, paste the key, prompt your AI client. Free for 7 days, no credit card.

Related guides

Enterprise

Connect SAP S/4HANA to Cursor via SAP HANA (Read-Only SQL)

Let Cursor answer business questions from SAP S/4HANA on-premise or Private Cloud, straight from HANA, with SAP's own data dictionary as tools. Read-only, self-hosted, no BTP.

Enterprise

Connect SAP S/4HANA to Gemini via SAP HANA (Read-Only SQL)

Let Gemini answer business questions from SAP S/4HANA on-premise or Private Cloud, straight from HANA, with SAP's own data dictionary as tools. Read-only, self-hosted, no BTP.

Enterprise

Connect SAP S/4HANA to Meta Muse via SAP HANA (Read-Only SQL)

Let Muse answer business questions from SAP S/4HANA on-premise or Private Cloud, straight from HANA, with SAP's own data dictionary as tools. Read-only, self-hosted, no BTP.

Enterprise

Connect SAP S/4HANA to Claude via SAP HANA (Read-Only SQL)

Let Claude answer business questions from SAP S/4HANA on-premise or Private Cloud, straight from HANA, with SAP's own data dictionary as tools. Read-only, self-hosted, no BTP.

Connectors

Cal.com to MCP: Bookings, Free Slots and Call Transcripts in any AI Agent

Read a Cal.com scheduling account from Claude, ChatGPT or Copilot: event types, bookings with attendees, Cal Video recordings and transcripts, free time slots, availability schedules and connected calendars. Booking, rescheduling and cancelling are included but installed switched off.

Connectors

DaData to MCP: Russian Companies by INN, Addresses and Banks in any AI Agent

Suggest and look up Russian addresses, companies and sole proprietors by INN or OGRN (ЕГРЮЛ/ЕГРИП), banks by BIC, full names and emails, reverse geocode coordinates, find the city of an IP and search Russian reference lists with DaData. Optional paid standardisation of addresses, phones and names, switched off until you allow it.