Python-based MCP server for SAP HANA and ODBC with read-only access and CSV output.
Configuration
View docs{
"mcpServers": {
"amistaus-ava-sbo-mcp-hana": {
"command": "python",
"args": [
"-m",
"sap_mcp",
"D:\\_projects\\sap-mcp-server-python\\config.yaml"
]
}
}
}You run a Python-based MCP server that lets AI clients query live SAP data in a safe, read-only way. It supports SAP HANA connections and generic SQL via ODBC, formats results as CSV for easy AI consumption, and serves requests through an MCP interface you can connect to from clients like Claude Desktop.
You use this MCP server by configuring a client to connect through the MCP interface and then issuing specialized tools that expose your database capabilities. The server runs locally or remotely and exposes read-only access to the data, returning results in CSV format for straightforward ingestion by AI models. Typical use patterns include listing available tables, inspecting table schemas, and executing safe SELECT queries against your SAP HANA or ODBC-connected databases.
Prerequisites you need before installation are Python 3.10 or higher, SAP HANA client libraries for HANA connections, and appropriate ODBC drivers for other databases.
# 1) Install the package for SAP HANA if you will connect to HANA
pip install -e ".[hana]"
# 2) Install the package for ODBC connections if you will connect via ODBC
pip install -e ".[odbc]"
# 3) Install the package for both SAP HANA and ODBC
pip install -e ".[all]"
# 4) Ensure SAP HANA Client is installed if you plan HANA connections
# The hdbcli library requires the SAP HANA Client
# You can install hdbcli via pip if available
pip install hdbcli
# 5) Run a standalone test (example)
python -m sap_mcp config.yamlConfiguration details you will typically see include a YAML file that defines the server, the connector, and which tables to expose. The SAP HANA connector requires host, port, user, and password, while the ODBC connector uses a connection_string. The server version is optional, and you can enable SSL encryption for HANA Cloud connections. You can start with an example configuration and adjust values for your environment.
Security note: this MCP server is read-only by design. Only SELECT queries are allowed, ensuring that data cannot be modified through the MCP interface.
If you are integrating with Claude Desktop or another MCP client, you will typically configure an MCP entry that points to the local Python runtime and the path to your configuration file. For example, you can run the MCP server with the following command structure locally, then reference it from your client configuration.
Common issues include version mismatches, missing SAP HANA client libraries, or incorrect connection details. Verify Python 3.10+ is installed, confirm that the sap-mcp-server package is installed, and ensure your configuration file is syntactically correct. If you encounter connection failures, test connectivity to your SAP HANA server, validate credentials, and ensure any required SSL settings (encrypt, sslValidateCertificate) are configured correctly for HANA Cloud. Check firewall rules to allow the MCP port.
If tools do not appear in your MCP client, fully quit the client, verify the config path, check for JSON/YAML typos, and review client logs for errors.
Enable debug logging by configuring a log_file path in your configuration, then inspect the log for detailed information.
This MCP server supports two connection modes: SAP HANA via hdbcli and generic SQL via ODBC. It presents a CSV-formatted output suitable for AI consumption and is intended to be used in read-only scenarios. A simple YAML configuration governs server behavior, connectors, and exposed tables.
List all tables/views exposed by the server for the connected SAP HANA or ODBC data sources.
List columns for a specific table to understand schema before querying.
Execute a SQL SELECT statement against the exposed data sources and return results in CSV format.