SAP MCP Server
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.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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
Related MCP server: Database MCP Server
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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Query, explore, and manage your databases through natural conversation.
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Ask questions in plain language, get answers from your business database. No SQL required.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to connect and query Microsoft SQL Server databases using natural language, executing read-only SQL queries for safe data inspection and analysis.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely query and explore SQL Server and PostgreSQL databases with read-only access, supporting schema discovery, relationship exploration, and query execution.3MIT
- 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.2AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI applications to discover MySQL and PostgreSQL database schemas and run validated read-only SELECT queries against a configured database, with result limits and SQL safety controls.20MIT