Enables querying live data from SAP HANA and SAP HANA Cloud databases through read-only SQL SELECT queries, with tools for listing tables, inspecting columns, and executing queries with CSV-formatted results.
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 MCP Servershow me the top 10 customers by total sales this month"
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 MCP Server (Python)
A Python-based Model Context Protocol (MCP) Server for SAP HANA and SQL databases. This allows AI clients like Claude Desktop to query live data from SAP systems.
Features
SAP HANA support via
hdbcli(SAP's official Python client)Generic SQL support via ODBC for other databases
Read-only access - Only SELECT queries are allowed
CSV output - Results formatted for easy AI consumption
Simple YAML configuration
Prerequisites
Python 3.10 or higher
SAP HANA client libraries (for HANA connections)
ODBC drivers (for ODBC connections)
Installation
1. Clone or download this project
cd D:\_projects\sap-mcp-server-python2. Install the package
For SAP HANA:
pip install -e ".[hana]"For ODBC connections:
pip install -e ".[odbc]"For both:
pip install -e ".[all]"3. Install SAP HANA Client (for HANA connections)
The hdbcli package requires the SAP HANA Client to be installed:
Download from SAP Development Tools
Install the SAP HANA Client
The
hdbclipackage will be available
Alternatively, install directly via pip (if available):
pip install hdbcliConfiguration
1. Create a configuration file
Copy the example configuration:
cp config.example.yaml config.yaml2. Edit the configuration
For SAP HANA:
server:
name: sap-hana
prefix: sap_hana
version: "1.0"
connector:
type: hana
host: your-hana-server.example.com
port: 30015
user: SYSTEM
password: your-password
tables: []For SAP HANA Cloud:
server:
name: hana-cloud
prefix: hana_cloud
version: "1.0"
connector:
type: hana
host: your-instance.hana.ondemand.com
port: 443
user: DBADMIN
password: your-password
encrypt: true
sslValidateCertificate: true
tables: []For ODBC (SQL Server, etc.):
server:
name: sql-server
prefix: sql
version: "1.0"
connector:
type: odbc
connection_string: "Driver={ODBC Driver 17 for SQL Server};Server=localhost;Database=mydb;UID=user;PWD=password"
tables: []Running the Server
Standalone test
python -m sap_mcp config.yamlIf the configuration is correct, the server will start and wait for MCP requests via stdin.
With Claude Desktop
Edit Claude Desktop's configuration file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonMac:
~/Library/Application Support/Claude/claude_desktop_config.jsonAdd the MCP server configuration:
{
"mcpServers": {
"sap-hana": {
"command": "python",
"args": [
"-m",
"sap_mcp",
"D:\\_projects\\sap-mcp-server-python\\config.yaml"
]
}
}
}Restart Claude Desktop (fully quit and reopen)
Look for the MCP tools icon (hammer) in Claude Desktop
Available Tools
Once configured, the AI client will have access to these tools:
Tool | Description |
| List all tables/views in the database |
| List columns for a specific table |
| Execute a SQL SELECT statement |
Example Usage
Ask Claude:
"What tables are available in SAP HANA?"
"Show me the columns in the CUSTOMERS table"
"Get the top 10 orders by value"
Configuration Reference
Field | Required | Description |
| Yes | Name of the MCP server |
| Yes | Prefix for tool names (e.g., |
| No | Server version (default: "1.0") |
| Yes | Connector type: |
| HANA | HANA server hostname |
| HANA | HANA server port (default: 30015) |
| HANA | Database username |
| HANA | Database password |
| No | Enable SSL encryption (default: false) |
| No | Validate SSL cert (default: true) |
| ODBC | ODBC connection string |
| No | List of tables to expose (empty = all) |
| No | Path to debug log file |
Troubleshooting
Server won't start
Check that Python 3.10+ is installed:
python --versionVerify the package is installed:
pip show sap-mcp-serverCheck configuration file syntax:
python -c "import yaml; yaml.safe_load(open('config.yaml'))"
Connection fails
Test connectivity to your SAP HANA server
Verify credentials are correct
For HANA Cloud, ensure
encrypt: trueis setCheck firewall rules allow the port
Tools not showing in Claude Desktop
Fully quit Claude Desktop (check Task Manager / Activity Monitor)
Verify the config path in
claude_desktop_config.jsonCheck for typos in the JSON configuration
Look at Claude Desktop logs for errors
Debug logging
Enable logging in your config:
log_file: /path/to/debug.logThen check the log file for detailed information.
Project Structure
sap-mcp-server-python/
├── pyproject.toml # Package configuration
├── config.example.yaml # Example configuration
├── README.md # This file
└── src/sap_mcp/
├── __init__.py
├── __main__.py # Entry point
├── server.py # MCP server setup
├── config.py # Configuration loader
├── csv_utils.py # CSV formatting
├── connectors/
│ ├── base.py # Abstract connector
│ ├── hana.py # SAP HANA connector
│ └── odbc.py # ODBC connector
└── tools/
├── get_tables.py # List tables tool
├── get_columns.py # List columns tool
└── run_query.py # SQL query toolLicense
MIT License - See LICENSE file for details.
Credits
Based on the CData MCP Server for SAP Business One.