sap-hana-mcp
Provides tools for interacting with SAP HANA databases, enabling listing tables, columns, executing SQL queries, and looking up SAP table descriptions from leanx.eu.
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-hana-mcpShow me the columns in 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 HANA MCP Server (Python)
A Model Context Protocol (MCP) server for SAP HANA, built with FastMCP and the official SAP HANA Python driver (hdbcli).
This server exposes SAP HANA database capabilities (listing tables, columns, running queries) as MCP tools that AI assistants can use.
Prerequisites
Python 3.12+
Access to a SAP HANA instance (on-premise or SAP HANA Cloud)
SAP HANA client libraries (installed automatically with
hdbcli)
Related MCP server: odata-mcp-proxy
Installation
# Clone and enter the directory
cd sap-hana-mcp-server-python
# Install dependencies
pip install -r requirements.txtConfiguration
Copy the example environment file and fill in your SAP HANA connection details:
cp .env.example .envEdit .env with your server settings:
Variable | Description | Default |
| SAP HANA server hostname | (required) |
| SAP HANA server port |
|
| Default schema to filter tables | (optional) |
| MCP server HTTP port |
|
Authentication
SAP HANA credentials are provided by each MCP client via HTTP Basic Auth. The server does not store database credentials — each request must include an Authorization header with the user's SAP HANA username and password.
Authorization: Basic <base64(username:password)>If the header is missing or invalid, the server returns an error. This allows different users to connect with their own SAP HANA accounts.
Running the Server
Locally
python main.pyThe server starts on http://localhost:8000/sse using SSE transport.
With Docker
docker build -t sap-hana-mcp .
docker run -p 8000:8000 --env-file .env sap-hana-mcpMCP Tools
sap_hana_get_tables
Lists tables available in the SAP HANA instance. Returns CSV with columns: Schema, Table, Description.
Parameter | Type | Required | Description |
| string | No | Catalog name filter |
| string | No | Schema name filter (defaults to |
sap_hana_get_columns
Lists columns for a specific table. Returns CSV with columns: Schema, Table, Column, DataType, Remarks.
Parameter | Type | Required | Description |
| string | Yes | Table name |
| string | No | Catalog name filter |
| string | No | Schema name filter (defaults to |
sap_hana_run_query
Executes a SQL SELECT statement. Returns results in CSV format. The SQL dialect is based on SQL-92. Identifiers should be quoted with double quotes.
Parameter | Type | Required | Description |
| string | Yes | The SELECT statement to execute |
sap_hana_lookup_table_info
Looks up SAP table and field descriptions from leanx.eu. Useful when the SAP HANA system catalog has no comments or descriptions for tables and columns. Does not require database authentication.
Parameter | Type | Required | Description |
| string | Yes | SAP table name (e.g. ANLA, BKPF, MARA) |
Returns CSV with columns: Field, Description, DataElement, Datatype, Length, Decimals.
MCP Resources
sap_hana://tables/{schema}/{table}
Returns column metadata for a given schema and table in CSV format.
Connecting to AI Clients
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"sap-hana": {
"url": "http://localhost:8000/sse",
"headers": {
"Authorization": "Basic <base64(username:password)>"
}
}
}
}Cursor / Other MCP Clients
Use the SSE endpoint http://localhost:8000/sse and configure the Authorization: Basic header with your SAP HANA credentials.
Project Structure
sap-hana-mcp-server-python/
main.py # MCP server with tools and resources
requirements.txt # Python dependencies
.env.example # Environment variable template
Dockerfile # Docker container build
pyproject.toml # Project metadata
README.md # This fileLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
The Ramp MCP server enables users to securely connect Ramp with AI assistants like ChatGPT and Claude to query financial data and take actions using natural language. It transforms Ramp's developer API into a SQL interface that LLMs can query, allowing admins to analyze spend trends, identify cost savings, and run complex SQL analyses on comprehensive datasets (transactions, purchase orders, vendors, users), while all users can manage cards, view transactions, request reimbursements, and get expense policy answers.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Cloud-hosted MCP server for secure AI access to enterprise data sources via CData Connect AI.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
Related MCP Servers
- FlicenseBqualityNot gradedmaintenanceAn MCP server that enables AI assistants to interact with SAP systems via the ABAP Development Tools (ADT) REST API. It allows users to read ABAP source code, inspect DDIC objects, and execute SQL queries directly.66-
- AlicenseNot gradedqualityDmaintenanceA config-driven MCP server that exposes OData and REST APIs as MCP tools, enabling AI assistants to query, manage, and monitor SAP backends through natural language.5929MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI assistants direct access to SAP HANA performance data — query plans, execution stats, memory usage.MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that connects AI assistants to SAP systems via the ADT REST API, enabling read, write, syntax-check, and activation of ABAP code directly from the chat.3MIT