Sap Hana
БесплатноНе проверенAn 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
Описание
An 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.
README
A Model Context Protocol (MCP) server for SAP HANA, built with FastMCP and the official SAP HANA Python driver (hdbcli).
This server exposes SAP HANA database capabilities (listing tables, columns, running queries) as MCP tools that AI assistants can use.
Prerequisites
- Python 3.12+
- Access to a SAP HANA instance (on-premise or SAP HANA Cloud)
- SAP HANA client libraries (installed automatically with
hdbcli)
Installation
# Clone and enter the directory
cd sap-hana-mcp-server-python
# Install dependencies
pip install -r requirements.txt
Configuration
Copy the example environment file and fill in your SAP HANA connection details:
cp .env.example .env
Edit .env with your server settings:
| Variable | Description | Default |
|---|---|---|
HANA_HOST |
SAP HANA server hostname | (required) |
HANA_PORT |
SAP HANA server port | 443 |
HANA_SCHEMA |
Default schema to filter tables | (optional) |
SERVER_PORT |
MCP server HTTP port | 8000 |
Authentication
SAP HANA credentials are provided by each MCP client via HTTP Basic Auth. The server does not store database credentials — each request must include an Authorization header with the user's SAP HANA username and password.
Authorization: Basic <base64(username:password)>
If the header is missing or invalid, the server returns an error. This allows different users to connect with their own SAP HANA accounts.
Running the Server
Locally
python main.py
The server starts on http://localhost:8000/sse using SSE transport.
With Docker
docker build -t sap-hana-mcp .
docker run -p 8000:8000 --env-file .env sap-hana-mcp
MCP Tools
sap_hana_get_tables
Lists tables available in the SAP HANA instance. Returns CSV with columns: Schema, Table, Description.
| Parameter | Type | Required | Description |
|---|---|---|---|
catalog |
string | No | Catalog name filter |
schema |
string | No | Schema name filter (defaults to HANA_SCHEMA) |
sap_hana_get_columns
Lists columns for a specific table. Returns CSV with columns: Schema, Table, Column, DataType, Remarks.
| Parameter | Type | Required | Description |
|---|---|---|---|
table |
string | Yes | Table name |
catalog |
string | No | Catalog name filter |
schema |
string | No | Schema name filter (defaults to HANA_SCHEMA) |
sap_hana_run_query
Executes a SQL SELECT statement. Returns results in CSV format. The SQL dialect is based on SQL-92. Identifiers should be quoted with double quotes.
| Parameter | Type | Required | Description |
|---|---|---|---|
sql |
string | Yes | The SELECT statement to execute |
sap_hana_lookup_table_info
Looks up SAP table and field descriptions from leanx.eu. Useful when the SAP HANA system catalog has no comments or descriptions for tables and columns. Does not require database authentication.
| Parameter | Type | Required | Description |
|---|---|---|---|
table |
string | Yes | SAP table name (e.g. ANLA, BKPF, MARA) |
Returns CSV with columns: Field, Description, DataElement, Datatype, Length, Decimals.
MCP Resources
sap_hana://tables/{schema}/{table}
Returns column metadata for a given schema and table in CSV format.
Connecting to AI Clients
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"sap-hana": {
"url": "http://localhost:8000/sse",
"headers": {
"Authorization": "Basic <base64(username:password)>"
}
}
}
}
Cursor / Other MCP Clients
Use the SSE endpoint http://localhost:8000/sse and configure the Authorization: Basic header with your SAP HANA credentials.
Project Structure
sap-hana-mcp-server-python/
main.py # MCP server with tools and resources
requirements.txt # Python dependencies
.env.example # Environment variable template
Dockerfile # Docker container build
pyproject.toml # Project metadata
README.md # This file
License
MIT
Установка Sap Hana
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/Elkhn/sap-hana-mcpFAQ
Sap Hana MCP бесплатный?
Да, Sap Hana MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Sap Hana?
Нет, Sap Hana работает без API-ключей и переменных окружения.
Sap Hana — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Sap Hana в Claude Desktop, Claude Code или Cursor?
Открой Sap Hana на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
автор: wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
автор: madhurprashPostgres
Query your database in natural language
автор: AnthropicPostgreSQL
Read-only database access with schema inspection.
автор: modelcontextprotocolCompare Sap Hana with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data
