JUHE API Marketplace
HatriGt avatar
MCP Server

HANA Cloud MCP Server

Enables integration between SAP HANA Cloud Database and Cursor IDE through the Model Context Protocol, providing standardized interfaces for managing ML models and execution contexts.

20
GitHub Stars
10/3/2025
Last Updated
MCP Server Configuration
1{
2 "name": "HANA Database",
3 "command": "hana-mcp-server",
4 "env": {
5 "HANA_HOST": "your-hana-host.com",
6 "HANA_PORT": "443",
7 "HANA_USER": "your-username",
8 "HANA_PASSWORD": "your-password",
9 "HANA_SCHEMA": "your-schema",
10 "HANA_SSL": "true",
11 "HANA_ENCRYPT": "true",
12 "HANA_VALIDATE_CERT": "true",
13 "HANA_CONNECTION_TYPE": "auto",
14 "HANA_INSTANCE_NUMBER": "10",
15 "HANA_DATABASE_NAME": "HQQ",
16 "LOG_LEVEL": "info",
17 "ENABLE_FILE_LOGGING": "true",
18 "ENABLE_CONSOLE_LOGGING": "false"
19 }
20}
JSON20 lines

README Documentation

HANA MCP Server

MCP

Model Context Protocol (MCP) server for seamless SAP HANA database integration with AI agents and development tools.

🚀 Quick Start

1. Install

npm install -g hana-mcp-server

2. Configure Claude Desktop

Update your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json

{
  "mcpServers": {
    "HANA Database": {
      "command": "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"
      }
    }
  }
}

3. Restart Claude Desktop

Close and reopen Claude Desktop to load the configuration.

4. Test It!

Ask Claude: "Show me the available schemas in my HANA database"

🎯 What You Get

Database Operations

  • Schema Exploration: List schemas, tables, and table structures
  • Query Execution: Run SQL queries with natural language
  • Data Sampling: Get sample data from tables
  • System Information: Monitor database status and performance

AI Integration

  • Natural Language Queries: "Show me all tables in the SYSTEM schema"
  • Query Building: "Create a query to find customers with orders > $1000"
  • Data Analysis: "Get sample data from the ORDERS table"
  • Schema Navigation: "Describe the structure of table CUSTOMERS"

🖥️ Visual Configuration (Recommended)

For easier setup and management, use the HANA MCP UI:

npx hana-mcp-ui

This opens a web interface where you can:

  • Configure multiple database environments
  • Deploy configurations to Claude Desktop with one click
  • Manage active connections
  • Test database connectivity

HANA MCP UI

🛠️ Configuration Options

Required Parameters

ParameterDescriptionExample
HANA_HOSTDatabase hostname or IP addresshana.company.com
HANA_USERDatabase usernameDBADMIN
HANA_PASSWORDDatabase passwordyour-secure-password

Optional Parameters

ParameterDescriptionDefaultOptions
HANA_PORTDatabase port443Any valid port number
HANA_SCHEMADefault schema name-Schema name
HANA_CONNECTION_TYPEConnection typeautoauto, single_container, mdc_system, mdc_tenant
HANA_INSTANCE_NUMBERInstance number (MDC)-Instance number (e.g., 10)
HANA_DATABASE_NAMEDatabase name (MDC tenant)-Database name (e.g., HQQ)
HANA_SSLEnable SSL connectiontruetrue, false
HANA_ENCRYPTEnable encryptiontruetrue, false
HANA_VALIDATE_CERTValidate SSL certificatestruetrue, false
LOG_LEVELLogging levelinfoerror, warn, info, debug
ENABLE_FILE_LOGGINGEnable file loggingtruetrue, false
ENABLE_CONSOLE_LOGGINGEnable console loggingfalsetrue, false

Database Connection Types

1. Single-Container Database

Standard HANA database with single tenant.

Required: HANA_HOST, HANA_USER, HANA_PASSWORD
Optional: HANA_PORT, HANA_SCHEMA

{
  "HANA_HOST": "hana.company.com",
  "HANA_PORT": "443",
  "HANA_USER": "DBADMIN",
  "HANA_PASSWORD": "password",
  "HANA_SCHEMA": "SYSTEM",
  "HANA_CONNECTION_TYPE": "single_container"
}

2. MDC System Database

Multi-tenant system database (manages tenants).

Required: HANA_HOST, HANA_PORT, HANA_INSTANCE_NUMBER, HANA_USER, HANA_PASSWORD
Optional: HANA_SCHEMA

{
  "HANA_HOST": "192.168.1.100",
  "HANA_PORT": "31013",
  "HANA_INSTANCE_NUMBER": "10",
  "HANA_USER": "SYSTEM",
  "HANA_PASSWORD": "password",
  "HANA_SCHEMA": "SYSTEM",
  "HANA_CONNECTION_TYPE": "mdc_system"
}

3. MDC Tenant Database

Multi-tenant tenant database (specific tenant).

Required: HANA_HOST, HANA_PORT, HANA_INSTANCE_NUMBER, HANA_DATABASE_NAME, HANA_USER, HANA_PASSWORD
Optional: HANA_SCHEMA

{
  "HANA_HOST": "192.168.1.100",
  "HANA_PORT": "31013",
  "HANA_INSTANCE_NUMBER": "10",
  "HANA_DATABASE_NAME": "HQQ",
  "HANA_USER": "DBADMIN",
  "HANA_PASSWORD": "password",
  "HANA_SCHEMA": "SYSTEM",
  "HANA_CONNECTION_TYPE": "mdc_tenant"
}

Auto-Detection

When HANA_CONNECTION_TYPE is set to auto (default), the server automatically detects the type:

  • If HANA_INSTANCE_NUMBER + HANA_DATABASE_NAMEMDC Tenant
  • If only HANA_INSTANCE_NUMBERMDC System
  • If neither → Single-Container

🏗️ Architecture

System Architecture

HANA MCP Server Architecture

Component Structure

hana-mcp-server/
├── 📁 src/
│   ├── 🏗️ server/           # MCP Protocol & Server Management
│   │   ├── index.js         # Main server entry point
│   │   ├── mcp-handler.js   # JSON-RPC 2.0 implementation
│   │   └── lifecycle-manager.js # Server lifecycle management
│   ├── 🛠️ tools/            # Tool Implementations
│   │   ├── index.js         # Tool registry & discovery
│   │   ├── config-tools.js  # Configuration management
│   │   ├── schema-tools.js  # Schema exploration
│   │   ├── table-tools.js   # Table operations
│   │   ├── index-tools.js   # Index management
│   │   └── query-tools.js   # Query execution
│   ├── 🗄️ database/         # Database Layer
│   │   ├── hana-client.js   # HANA client wrapper
│   │   ├── connection-manager.js # Connection management
│   │   └── query-executor.js # Query execution utilities
│   ├── 🔧 utils/            # Shared Utilities
│   │   ├── logger.js        # Structured logging
│   │   ├── config.js        # Configuration management
│   │   ├── validators.js    # Input validation
│   │   └── formatters.js    # Response formatting
│   └── 📋 constants/        # Constants & Definitions
│       ├── mcp-constants.js # MCP protocol constants
│       └── tool-definitions.js # Tool schemas
├── 🧪 tests/                # Testing Framework
├── 📚 docs/                 # Documentation
├── 📦 package.json          # Dependencies & Scripts
└── 🚀 hana-mcp-server.js    # Main entry point

📚 Available Commands

Once configured, you can ask Claude to:

  • "List all schemas in the database"
  • "Show me tables in the SYSTEM schema"
  • "Describe the CUSTOMERS table structure"
  • "Execute: SELECT * FROM SYSTEM.TABLES LIMIT 10"
  • "Get sample data from ORDERS table"
  • "Count rows in CUSTOMERS table"

🔧 Troubleshooting

Connection Issues

  • "Connection refused": Check HANA host and port
  • "Authentication failed": Verify username/password
  • "SSL certificate error": Set HANA_VALIDATE_CERT=false or install valid certificates

Debug Mode

export LOG_LEVEL="debug"
export ENABLE_CONSOLE_LOGGING="true"
hana-mcp-server

📦 Package Info

  • Size: 21.7 kB
  • Dependencies: @sap/hana-client, axios
  • Node.js: 18+ required
  • Platforms: macOS, Linux, Windows

🤝 Support

📄 License

MIT License - see LICENSE file for details.

Quick Install

Quick Actions

Key Features

Model Context Protocol
Secure Communication
Real-time Updates
Open Source

Boost your projects with Wisdom Gate LLM API

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.