# hana-mcp-server [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/hatrigt/hana-mcp-server  
**GitHub Stars:** 71  
**npm Downloads (last month):** 1765  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/hana-mcp-server

## Description
SAP HANA MCP server — Model Context Protocol server for SAP HANA and HANA Cloud. Use with Claude Code, VS Code, and other AI agents.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "hana-mcp-server": {
    "command": "npx",
    "args": ["-y","hana-mcp-server"],
    "env": {
      "HANA_HOST": "",
      "HANA_PORT": "",
      "HANA_USER": "",
      "HANA_PASSWORD": "",
      "HANA_SCHEMA": ""
    }
  }
}
```

**Requires environment variables:** `HANA_HOST`, `HANA_PORT`, `HANA_USER`, `HANA_PASSWORD`, `HANA_SCHEMA` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What hana-mcp-server does

The hana-mcp-server MCP server exposes SAP HANA and SAP HANA Cloud through the Model Context Protocol. It is intended for AI clients that need to inspect database structure, understand available objects, and retrieve data through SQL. The project is listed in the 🗄️ Databases category and supports both single-container and multitenant database connection scenarios.

Its capabilities cover connection and session details, schema and table browsing, column searches, table descriptions, and structural metadata. Agents can also inspect constraints, foreign keys, indexes, views, synonyms, privileges, DDL, stored procedures, functions, calculation views, and sequences. Optional business or domain metadata can be merged into schema results so agents have additional context for codes and tables.

## How it works

The published package is normally started as a stdio MCP server with `npx -y hana-mcp-server`. MCP clients pass the HANA connection settings through environment variables, and the process connects to the database over its SQL port. The server can use SSL, encryption, and certificate validation settings when connecting.

SQL is exposed through `hana_execute_query` and can use parameterized statements, row, column, and cell limits, offsets, total-count requests, and continuation snapshots. `hana_query_next_page` retrieves later pages when a result is paginated. Other tools provide sample data, column statistics, query execution plans, table statistics, dependencies, partition information, and expensive-query information.

A separate HTTP entry point is available from a repository checkout after installing dependencies. `npm run start:http` serves MCP at `/mcp`, defaults to `127.0.0.1:3100`, and provides `/health`. Host and port settings can be changed with HTTP transport environment variables. Bearer JWT validation is available for HTTP deployments, including configurations using SAP BTP XSUAA.

## Setup and configuration

The hana-mcp-server MCP server requires Node.js 18 or newer, a reachable SAP HANA or HANA Cloud database, and an MCP client. Installation options include running the package with `npx`, installing it globally with npm, or running a checked-out copy with Node.js.

Set the HANA host, SQL port, user, password, and schema in the client’s `env` block. Depending on the deployment, also configure SSL, encryption, certificate validation, connection type, instance number, or database name. MDC connections may need `HANA_DATABASE_NAME` and, in the documented example, `HANA_INSTANCE_NUMBER`; these settings can be omitted for applicable single-container setups.

Claude Desktop, Claude Code, VS Code, Cursor, Cline, and Windsurf can use the stdio configuration. After changing environment values, restart the MCP connection. For HTTP use, run the repository’s HTTP command and configure the client with the `/mcp` URL instead of the published stdio command.

## Tools and capabilities

The documented tool set contains 34 tools in six functional groups:

- Connection and configuration inspection, including connectivity, session, and environment details.
- Schema browsing with paginated lists, table and column searches, and table explanations.
- SQL execution with parameter handling, result limits, and continuation paging.
- Structural analysis for constraints, indexes, views, synonyms, privileges, dependencies, and DDL.
- Code-object inspection for procedures, functions, calculation views, and sequences.
- Data and performance inspection covering samples, statistics, plans, partitions, and expensive statements.

## Limitations and notes

The published `npx hana-mcp-server` path is documented as stdio-only. HTTP requires a checkout of the repository and local installation. The database must be reachable from the machine or process running the server.

Store database passwords, JWT material, and credential-bearing URLs in environment variables or a secret manager rather than source control. For HTTP use beyond localhost, the documentation recommends JWT validation, TLS termination through a reverse proxy, and suitable network policy. hana-mcp-server MCP server provides an interface for agents; SAP HANA remains the system of record.

_Full upstream README: https://allmcps.com/mcp/hana-mcp-server/readme_

