SAP HANA MCP Server
Provides integration with SAP HANA and SAP HANA Cloud databases, enabling schema discovery, SQL query execution with guardrails, structural analysis, code object inspection, performance monitoring, and health checks.
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., "@SAP HANA MCP ServerList all tables in the SAPABAP1 schema"
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 (latest | |
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: SAP Datasphere MCP Server
โ 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
43 tools across seven areas, all verified on HANA Cloud.
Area | Tools | What you get |
Connection & config |
| Verify connectivity, inspect configuration, see current user / schema / database / version |
Schema browsing |
| Paginated schema/table lists, column metadata, cross-schema search, optional business-meaning overlay |
SQL execution |
| Parameterized SQL with optional row/column/cell caps, paging ( |
Structural analysis |
| PK/UK/FK/check constraints, indexes, views with SQL definition, synonyms, effective privileges, CREATE statement DDL |
Code objects |
| Stored procedures, scalar/table functions, SAP BW/S4 calculation views ( |
Data & performance |
| Row counts, sample rows, distinct/null stats, query execution plan, object dependency graph, partition info, top expensive statements |
Health & monitoring |
| Database health reports, indexserver memory snapshots with allocation-limit alerts, live performance indicators (open transactions, hot queries, long connections, column-store deltas, blocked transactions) |
DML guard | โ | INSERT / UPDATE / DELETE / TRUNCATE blocked by default; opt-in individually via |
Resources |
| MCP resource URIs for schema and table enumeration; |
Domain knowledge | via | Optional JSON semantics overlay (table descriptions, column meanings, code-value maps) โ configuration-samples.md |
๐ ๏ธ 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 |
|
| Set to |
|
| Statement timeout (ms); |
|
| Max rows per |
|
| Max columns per row returned (active when limits enabled) |
|
| Truncate long cell text (active when limits enabled) |
|
| Default |
|
| List tools: default and max page size |
|
| Cap embedded names in |
|
| Snapshot id lifetime for query paging |
|
| HANA connection pool size (1โ20) |
DML permissions
INSERT, UPDATE, and DELETE are blocked by default. Set each to true to permit:
Parameter | Default | Purpose |
|
| Permit |
|
| Permit |
|
| Permit |
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 |
| Client cannot find |
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.
Client cannot find npx (spawn ENOENT)
GUI clients launched from the Dock or Start Menu (Claude Desktop, Cursor, VS Code, โฆ) inherit a minimal PATH and may not see Node tooling installed under /opt/homebrew/bin, ~/.nvm/..., mise, or volta. This affects every npx-based MCP, not just this server. The error appears in MCP client logs as:
Connection failed: spawn npx ENOENTPick one fix:
Symlink
npx/nodeinto a GUI-visible path (macOS, Homebrew):ln -s "$(which npx)" /usr/local/bin/npx ln -s "$(which node)" /usr/local/bin/nodeUse absolute paths in the MCP config โ most portable, no
PATHdependency. Resolve paths withwhich nodeandnpm root -g:{ "mcpServers": { "hana": { "type": "stdio", "command": "/opt/homebrew/bin/node", "args": ["/opt/homebrew/lib/node_modules/hana-mcp-server/hana-mcp-server.js"], "env": { "HANA_HOST": "...", "HANA_USER": "...", "HANA_PASSWORD": "..." } } } }Requires a one-time
npm install -g hana-mcp-server.Inject
PATHinto the MCPenvblock โ keeps thenpxform:"env": { "PATH": "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin", "HANA_HOST": "...", "HANA_USER": "...", "HANA_PASSWORD": "..." }
Restart the MCP client after the change. If npx then fails with EPERM on ~/.npm/_cacache, the npm cache has root-owned files from a previous sudo npm โ fix with sudo chown -R "$(whoami)" ~/.npm or set "NPM_CONFIG_CACHE": "/tmp/hana-mcp-npm-cache" in the same env block.
๐ฅ๏ธ HANA MCP UI
npx hana-mcp-ui
๐๏ธ Architecture
hana-mcp-server/
โโโ src/
โ โโโ server/ # MCP lifecycle, resources, HTTP transport
โ โโโ tools/ # 34 tools: schema, SQL, discovery, config
โ โโโ database/ # HANA client, connection pool, 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
Proprietary โ see LICENSE (End User License Agreement).
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBquality-maintenanceAn MCP server that enables AI assistants to interact with SAP systems via the ABAP Development Tools (ADT) REST API. It allows users to read ABAP source code, inspect DDIC objects, and execute SQL queries directly.Last updated66
- AlicenseAqualityCmaintenanceProduction-ready MCP server that enables AI assistants to seamlessly interact with SAP Datasphere environments for real tenant data discovery, metadata exploration, analytics operations, ETL data extraction, database user management, data lineage analysis, and column-level data profiling.Last updated3927440MIT
- Alicense-qualityDmaintenanceAn MCP server for SAP HANA that enables listing tables, columns, running SQL queries, and looking up SAP table descriptions, all through natural language via AI assistants.Last updatedMIT
- Alicense-qualityDmaintenanceA config-driven MCP server that exposes OData and REST APIs as MCP tools, enabling AI assistants to query, manage, and monitor SAP backends through natural language.Last updated7126MIT
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/josecarlos3390/sap-hana-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server