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.
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
2. Install the package
For SAP HANA:
For ODBC connections:
For both:
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):
Configuration
1. Create a configuration file
Copy the example configuration:
2. Edit the configuration
For SAP HANA:
For SAP HANA Cloud:
For ODBC (SQL Server, etc.):
Running the Server
Standalone test
If 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:
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:
or
|
| 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:
Then check the log file for detailed information.
Project Structure
License
MIT License - See LICENSE file for details.
Credits
Based on the CData MCP Server for SAP Business One.