SAP HANA CLI

Runs the hana-cli developer toolkit's SAP HANA commands as MCP tools for querying and managing a database

Official · SAP Samples TypeScript Local · stdio DatabasesDeveloper tools

58 popularity score ★ 115 ↓ 1.5k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add sap-hana-cli -- npx -y -p hana-cli hana-cli-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "sap-hana-cli": {
      "command": "npx",
      "args": [
        "-y",
        "-p",
        "hana-cli",
        "hana-cli-mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "sap-hana-cli": {
      "command": "npx",
      "args": [
        "-y",
        "-p",
        "hana-cli",
        "hana-cli-mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "sap-hana-cli": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "-p",
        "hana-cli",
        "hana-cli-mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.sap-hana-cli]
command = "npx"
args = ["-y", "-p", "hana-cli", "hana-cli-mcp"]
Gemini CLITerminal
gemini mcp add --scope user sap-hana-cli npx -- -y -p hana-cli hana-cli-mcp

What it does

hana-cli is SAP's sample command line tool for SAP HANA development, and its npm package ships a second program, hana-cli-mcp, that exposes the CLI's commands to an MCP client over stdio. An assistant can list schemas, tables and views, inspect a table's structure, run SQL, check the connection, and reach the rest of the CLI: imports and exports, data profiling and comparison, HDI container management, user and grant tasks, and Cloud Foundry and BTP helpers.

To keep the tool list short, the server starts with 22 tools in version 4.202609.0: five core database tools, a router called hana_execute that runs any other CLI command by name, and helper tools for discovery, examples, parameter presets, workflow templates and searching the bundled documentation. Browsing a category with hana_discover_by_category registers that category's commands as tools of their own, up to 50 at a time, with the oldest category dropped first. Starting it with --full registers all 186 tools at once; in that mode the router tool is not listed (src/index.ts).

Each call spawns the hana-cli program as a child process with the arguments turned into command-line flags, and kills it after 30 seconds if it has not finished (src/executor.ts). Connection details come from the same files the CLI uses, such as default-env.json or .env in the project folder; a tool call can also point at another project folder or pass host, user and password directly.

What it needs

RuntimeNode.js 22+

Node.js 22 or later (24 LTS recommended). Access to an SAP HANA database (HANA Cloud, HANA on BTP, HANA express or on-premise) and its credentials, stored in default-env.json or .env in the project folder; create them with hana-cli connect or hana-cli serviceKey after npm install -g hana-cli. Cloud Foundry and BTP commands need the cf or btp CLI on PATH and a login.

Limits

Version 4.x is a large rewrite and its makers warn of possible problems in some environments; they name 3.202601.0 as the release to roll back to. Every command run through the server is stopped after 30 seconds (src/executor.ts), so long imports or exports may need the command's timeoutSeconds setting or the CLI itself. Without --full only 22 tools are listed at start; other commands go through hana_execute or appear after a category is browsed, and at most 50 promoted tools are kept. The server picks its working folder from where it is launched: if that folder has no default-env.json, .env, package.json or .cdsrc-private.json, it falls back to the install folder.

Who it suits

Developers who already work with SAP HANA, especially CAP or HDI projects that keep a default-env.json, and want an assistant to explore schemas, run queries and carry out routine admin or data tasks from the editor. It runs on your machine and writes to the database with whatever rights the configured user has, so a read-only database user is the way to limit it. Someone who only needs plain SQL access to HANA, or who wants a small fixed tool list, may find the 186 commands and the discovery layer more than they need.

Tools 22 of 186

hana_status
Checks that the database connection works
hana_tables
Lists tables in a schema
hana_inspect_table
Shows a table's columns, keys and other metadata
hana_views
Lists views in a schema
hana_query_simple
Runs a SQL statement and returns the result
hana_execute
Runs any other hana-cli command by name with its arguments
hana_discover_categories
Lists the command categories
hana_discover_by_category
Lists one category's commands and registers them as tools
hana_discover_by_tag
Finds commands carrying a given tag
hana_workflows
Lists the multi-step workflow templates
hana_workflow_by_id
Returns the steps of one workflow template
hana_search_workflows
Searches workflow templates by tag or purpose
hana_examples
Gives worked usage examples for a command
hana_parameter_presets
Gives ready parameter sets for a command and use case
hana_recommend
Suggests commands for a task described in plain words, five by default
hana_quickstart
Returns a short guide to the most used commands
hana_troubleshoot
Gives troubleshooting help for a command
hana_interpret_result
Explains the output of a command that was run
hana_conversation_templates
Lists guided task templates
hana_get_template
Returns one guided template, such as data migration or a security audit
hana_search
Searches commands, workflows, examples, presets and docs, 10 results by default
hana_get_doc
Returns the full text of a bundled documentation page

Similar servers