HANA Cloud MCP Server
The SAP HANA MCP Server enables AI agents and development tools to securely interact with SAP HANA databases through the Model Context Protocol (MCP).
Database Operations:
Execute custom SQL queries, including parameterized queries for prepared statements
Retrieve sample data and count rows in tables
Test database connectivity and view configuration settings
Schema Management:
List all schemas, tables within schemas, and describe table structures
List and describe indexes for tables
Explore database schema through natural language commands
System Administration:
Monitor memory usage statistics and system information
Get current database user information
Debug environment variables
Integration & Security:
Seamlessly integrates with Claude Desktop, VSCode extensions, and custom AI applications
Features enterprise-grade security with SSL/TLS support and secure credential management
Provides both command-line interface and React-based web UI
Uses JSON-RPC 2.0 with modular architecture for easy extension
Uses .env files for configuration management of server settings and connection parameters
Uses Flask to implement the REST API layer of the MCP server architecture
Utilizes pandas as a prerequisite library, likely for data manipulation and analysis within the model execution context
Built on Python 3.8+ as the core programming language for the server implementation
Provides integration with SAP HANA Cloud Database, allowing for machine learning operations and model management directly with the SAP HANA Cloud environment
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., "@HANA Cloud MCP Servershow me the top 5 customers by total sales"
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 HANA MCP Server
SAP HANA MCP Server implements the Model Context Protocol for SAP HANA and SAP HANA Cloud. AI clients discover schema, run SQL with guardrails, and optionally merge business/domain metadata so agents interpret codes and tables consistently—without replacing your database as the system of record.
📚 Documentation
Document | Purpose |
This README | Prerequisites, install, how to wire each client, capability summary, configuration cheat sheet, troubleshooting |
Release history — features and fixes by version ( | |
Index of | |
Authoritative env reference: every variable, defaults, hard bounds, HTTP auth, security notes | |
Copy-paste: connection profiles (single-container, MDC), semantics JSON, paging pointers | |
Local HTTP MCP: |
Related MCP server: MCP Development Framework
✅ Prerequisites
Node.js 18+
A SAP HANA or SAP HANA Cloud database reachable on the SQL port from the machine running the server
An MCP client (Claude Desktop, Claude Code, VS Code, Cursor, Cline, Windsurf, or custom HTTP client)
Credentials supplied via env (see Security)
📦 Installation
Method | Use when |
| Default — no global install |
| You need |
Clone + | Developing or pinning a local build |
HTTP entrypoint (from a clone): npm run start:http — default bind 127.0.0.1:3100, path /mcp. See Hosted & HTTP.
🎯 Use cases
Audience | Transport | Next step |
Chat / lite users | stdio | |
Developers (Claude Code, VS Code, Cline, Cursor, Windsurf) | stdio | |
Business apps with AI agents (you host MCP over HTTP) | HTTP |
🖥️ Claude Desktop
Config file path:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\claude\claude_desktop_config.jsonLinux:
~/.config/claude/claude_desktop_config.json
Register the server; put connection settings in
env(see Configuration; full profile JSON in configuration-samples.md). The example below includesHANA_INSTANCE_NUMBER/HANA_DATABASE_NAMEfor MDC—remove them if you use a single-container database.
{
"mcpServers": {
"HANA Database": {
"command": "npx",
"args": ["-y", "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"
}
}
}
}If the CLI is on PATH, you may use "command": "hana-mcp-server" and omit args.
Restart Claude Desktop.
Optional: HANA MCP UI — npx hana-mcp-ui for editing envs and deploying to Claude Desktop.
💻 IDEs & code agents
stdio only; same env keys as above. Canonical example — Claude Code (~/.claude.json or project .mcp.json). The env block below includes HANA_DATABASE_NAME for MDC tenant HANA; omit it for most single-container setups.
{
"mcpServers": {
"hana": {
"type": "stdio",
"timeout": 600,
"command": "npx",
"args": ["-y", "hana-mcp-server"],
"env": {
"HANA_HOST": "<host>",
"HANA_PORT": "31013",
"HANA_USER": "<user>",
"HANA_PASSWORD": "<password>",
"HANA_SCHEMA": "SAPABAP1",
"HANA_DATABASE_NAME": "HQQ",
"HANA_SSL": "false",
"HANA_ENCRYPT": "false",
"HANA_VALIDATE_CERT": "false",
"LOG_LEVEL": "info",
"ENABLE_FILE_LOGGING": "true",
"ENABLE_CONSOLE_LOGGING": "false"
}
}
}
}Use the same command, args, and env in VS Code, Cline, Cursor, and Windsurf. After any change to env, restart the MCP server connection in the IDE.
🌐 Hosted & HTTP
Run the HTTP transport from a checkout of this repository (after npm install). The published npx hana-mcp-server path is stdio only.
npm run start:httpCursor / local IDE over HTTP: set HANA_* in the shell (or process manager) that runs start:http, then add an HTTP MCP entry with url http://127.0.0.1:3100/mcp ("type": "fetch" or "type": "http", depending on Cursor version). See docs/local-http-mcp.md and ./scripts/start-http-mcp.sh.
Topic | Detail |
Endpoint |
|
Tuning |
|
Health |
|
CORS |
|
Optional Bearer JWT (OAuth2 / OIDC)
Variable | Role |
|
|
| Issuer / JWKS (omit on SAP BTP with bound XSUAA) |
| Optional expected |
| Optional scope list |
SAP BTP: bind XSUAA, MCP_HTTP_AUTH_ENABLED=true, assign role collections. Details: ENVIRONMENT.md §7.
🔒 Security
Secrets:
HANA_PASSWORD, JWT material, and URLs with embedded credentials belong in env or a secret manager — not in git.Supply chain: Prefer
npx -yfrom the published package in CI and shared desktops instead of a mutable global install.HTTP: Enable JWT validation for anything beyond localhost; put the service behind a reverse proxy for TLS termination and network policy.
Further notes: ENVIRONMENT.md §9.
🎯 Capabilities
Area | What callers get |
Schema | Paged schema/table lists, column metadata, connectivity checks |
SQL | Parameterized execution; caps on SELECT/WITH rows, columns, and cell size; optional totals and continuation via |
Resources |
|
Domain knowledge (optional) | JSON overlay for |
🛠️ Configuration
Variables apply to stdio (env in the client config) and HTTP (process environment). Restart after changes.
Source of truth for names, defaults, and clamp ranges: docs/ENVIRONMENT.md.
Copy-paste connection JSON (single-container / MDC): docs/configuration-samples.md#connection-profiles-env-json.
Required
Parameter | Description | Example |
| Hostname or IP |
|
| Database user |
|
| Database password | (secret) |
Connection & TLS
Parameter | Default | Notes |
|
| MDC SQL ports often |
| — | Default when a tool omits |
|
|
|
| — | MDC instance id (e.g. |
| — | Tenant name for MDC (e.g. |
|
| TLS and cert validation flags for the driver |
Logging
Parameter | Default | Notes |
|
|
|
|
|
|
|
| Often |
*Code default; examples frequently set file logging to true.
Limits (queries, lists, resources)
Parameter | Default | Purpose |
|
| Max rows per |
|
| Max columns per row returned |
|
| Truncate long cell text |
|
| Default |
|
| List tools: default and max page size |
|
| Cap embedded names in |
|
| Snapshot id lifetime for query paging |
Business / domain JSON (HANA_SEMANTICS_*)
Parameter | Default | Purpose |
| — | File path to dictionary JSON (wins over URL) |
| — | HTTPS URL to same format |
|
| Cache / reload behavior |
Samples: configuration-samples.md.
🔧 Troubleshooting
Symptom | Check |
Connection refused |
|
Auth failed / no client | Password, user, |
TLS errors |
|
Wrong or empty objects | MDC: tenant drives visibility; identical schema names can differ by tenant |
SQL needs another database prefix |
|
Debug: LOG_LEVEL=debug, ENABLE_CONSOLE_LOGGING=true, restart.
🖥️ HANA MCP UI
npx hana-mcp-ui
🏗️ Architecture
hana-mcp-server/
├── src/
│ ├── server/ # MCP lifecycle, resources, HTTP transport
│ ├── tools/ # Schema, table, query, index, config tools
│ ├── database/ # HANA client, connection manager, executor, query runner
│ ├── semantics/ # Optional semantics / domain JSON loader
│ ├── utils/ # Logger, config, validators, formatters
│ ├── query-snapshot-store.js
│ └── constants/ # MCP constants, tool definitions
├── tests/
├── docs/ # README index, ENVIRONMENT.md, configuration-samples.md, diagrams
└── hana-mcp-server.js # stdio entry point📦 Package
Runtime | Node.js 18+ |
Platforms | macOS, Linux, Windows |
Dependencies |
|
🤝 Support
Issues: GitHub Issues
UI: HANA MCP UI
📄 License
MIT — see LICENSE.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/HatriGt/hana-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server