# SAP HANA CLI

Wires more than 150 SAP HANA tools into your AI assistant: queries, schema objects, plan analysis. Useful when you build against HANA outside SAP tooling.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 114
- Author: SAP-samples
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/SAP-samples/hana-developer-cli-tool-example
- Updated: 2026-10-11
- HTML: https://affpapa.org/en/nevibecode/mcp/sap-hana-cli

## What it does

SAP HANA CLI wraps `hana-cli`, a command line tool for local SAP HANA development in editors like VSCode. Over MCP it hands the assistant a long list of commands: inspecting tables and views, reading execution plans, running administrative operations against the database. It starts with `npx -y hana-cli` — no separate server process to manage.

Some commands talk to SAP Business Technology Platform. Those need SAP's official `btp` CLI installed and present in `PATH`; without it they fail outright. Database connectivity comes from `default-env.json`, the file you already keep around for local work. A local SAP HANA, express edition instance works, and so does a remote one, including SAP HANA Cloud.

Node.js 22 or later is required. The 4.x line moved to Express 5 and reworked connection handling, so unusual setups can hit rough edges — if something breaks, roll back with `npm install -g hana-cli@3.202601.0`.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add hana-cli -- npx -y hana-cli
```

### Codex

**Platform CLI**
```bash
codex mcp add sap-hana-cli -- npx -y hana-cli
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "sap-hana-cli": {
            "command": "npx",
            "args": [
                "-y",
                "hana-cli"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "sap-hana-cli": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "hana-cli"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add sap-hana-cli npx -y hana-cli
```

## When to use it
- inspect a table's columns and indexes without leaving the editor
- read an execution plan for a slow query
- export rows from SAP HANA Cloud to a file
- diff schema objects between two HANA instances
- check a database user's roles and privileges

## Example prompts
- Show me the structure of `SALES_ORDERS` and its indexes
- Walk through the execution plan for this query and point out the bottleneck
- Export the first 100 rows of `CUSTOMERS` to CSV

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
