Model Context Protocol (MCP) Integration
Integrate HANA CLI with AI coding assistants via the Model Context Protocol.
What is MCP?
The Model Context Protocol enables AI assistants to interact with external tools and databases. HANA CLI implements MCP to allow:
- AI-assisted database queries
- Automated schema analysis
- Intelligent data recommendations
- Code generation for data operations
Resources
See the MCP Server documentation in the repository for complete setup and usage guides.
Key Features
- Resources - Access database metadata and schemas
- Tools - Execute data operations
- Prompts - Pre-built interaction templates
Quick Start
Install MCP Server
bash
cd mcp-server
npm install
npm run buildConfigure in IDE
VS Code with Claude Extension:
json
{
"mcpServers": {
"hana-cli": {
"command": "node",
"args": ["../mcp-server/build/index.js"],
"env": {
"HANA_HOST": "your-server.com",
"HANA_PORT": "30013",
"HANA_USER": "dbuser",
"HANA_PASSWORD": "password"
}
}
}
}Available Tools
Database Inspection
Query database metadata:
Tool: inspect_tables
Parameters: schema, pattern
Returns: list of tables matching patternData Operations
Execute data commands:
Tool: run_command
Parameters: command, args
Returns: command outputQuery Assistance
Get help crafting queries:
Tool: suggest_query
Parameters: intent, schema, tables
Returns: suggested SQL or commandUse Cases
Generate Import Scripts
Ask Claude:
"Generate an import command script for CSV files in the data/ folder into my HR schema"
Claude will:
- Use MCP to inspect available table structures
- Generate appropriate import commands
- Recommend column mapping
Database Analysis
"Analyze data quality in my SALES schema"
Claude will:
- Use inspection tools to understand structure
- Run data profile and validation
- Generate analysis report
Schema Migration
"What are the differences between my DEV and PROD schemas?"
Claude will:
- Inspect both schemas
- Run compareSchema command
- Provide detailed comparison
