The HANA MCP Server enables seamless integration between SAP HANA databases and AI agents like Claude, allowing you to interact with your database using natural language through the Model Context Protocol (MCP).
Install the HANA MCP Server globally using npm:
npm install -g hana-mcp-server
To connect Claude with your HANA database, update your Claude Desktop configuration file located at:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\claude\claude_desktop_config.json
~/.config/claude/claude_desktop_config.json
Add the following configuration to the file:
{
"mcpServers": {
"HANA Database": {
"command": "hana-mcp-server",
"env": {
"HANA_HOST": "your-hana-host.com",
"HANA_PORT": "443",
"HANA_USER": "your-username",
"HANA_PASSWORD": "your-password",
"HANA_SCHEMA": "your-schema",
"HANA_SSL": "true",
"HANA_ENCRYPT": "true",
"HANA_VALIDATE_CERT": "true",
"HANA_CONNECTION_TYPE": "auto",
"HANA_INSTANCE_NUMBER": "10",
"HANA_DATABASE_NAME": "HQQ",
"LOG_LEVEL": "info",
"ENABLE_FILE_LOGGING": "true",
"ENABLE_CONSOLE_LOGGING": "false"
}
}
}
}
After updating the configuration file, restart Claude Desktop to load the new settings.
For easier setup, you can use the HANA MCP UI tool:
npx hana-mcp-ui
This web interface allows you to:
Parameter | Description | Example |
---|---|---|
HANA_HOST |
Database hostname or IP address | hana.company.com |
HANA_USER |
Database username | DBADMIN |
HANA_PASSWORD |
Database password | your-secure-password |
Parameter | Description | Default | Options |
---|---|---|---|
HANA_PORT |
Database port | 443 |
Any valid port number |
HANA_SCHEMA |
Default schema name | - | Schema name |
HANA_CONNECTION_TYPE |
Connection type | auto |
auto , single_container , mdc_system , mdc_tenant |
HANA_INSTANCE_NUMBER |
Instance number (MDC) | - | Instance number (e.g., 10 ) |
HANA_DATABASE_NAME |
Database name (MDC tenant) | - | Database name (e.g., HQQ ) |
HANA_SSL |
Enable SSL connection | true |
true , false |
HANA_ENCRYPT |
Enable encryption | true |
true , false |
HANA_VALIDATE_CERT |
Validate SSL certificates | true |
true , false |
LOG_LEVEL |
Logging level | info |
error , warn , info , debug |
ENABLE_FILE_LOGGING |
Enable file logging | true |
true , false |
ENABLE_CONSOLE_LOGGING |
Enable console logging | false |
true , false |
For standard HANA databases with a single tenant:
{
"HANA_HOST": "hana.company.com",
"HANA_PORT": "443",
"HANA_USER": "DBADMIN",
"HANA_PASSWORD": "password",
"HANA_SCHEMA": "SYSTEM",
"HANA_CONNECTION_TYPE": "single_container"
}
For multi-tenant system databases that manage tenants:
{
"HANA_HOST": "192.168.1.100",
"HANA_PORT": "31013",
"HANA_INSTANCE_NUMBER": "10",
"HANA_USER": "SYSTEM",
"HANA_PASSWORD": "password",
"HANA_SCHEMA": "SYSTEM",
"HANA_CONNECTION_TYPE": "mdc_system"
}
For specific multi-tenant tenant databases:
{
"HANA_HOST": "192.168.1.100",
"HANA_PORT": "31013",
"HANA_INSTANCE_NUMBER": "10",
"HANA_DATABASE_NAME": "HQQ",
"HANA_USER": "DBADMIN",
"HANA_PASSWORD": "password",
"HANA_SCHEMA": "SYSTEM",
"HANA_CONNECTION_TYPE": "mdc_tenant"
}
Once configured, you can ask Claude questions about your database:
HANA_VALIDATE_CERT=false
or install valid certificatesTo run the server with debug logging:
export LOG_LEVEL="debug"
export ENABLE_CONSOLE_LOGGING="true"
hana-mcp-server
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "hana-mcp-server" '{"command":"python","args":["app.py"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"hana-mcp-server": {
"command": "python",
"args": [
"app.py"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"hana-mcp-server": {
"command": "python",
"args": [
"app.py"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect