MCP Server Development
The Model Context Protocol (MCP) Server implementation for HANA CLI provides AI assistants with comprehensive tools and workflows to interact with SAP HANA databases.
What is MCP Server?
The MCP Server exposes all HANA CLI commands as tools that can be used by AI assistants like Claude, enabling:
- AI-assisted database queries - Natural language interface to database operations
- Automated schema analysis - Intelligent exploration and analysis workflows
- Command recommendations - Intent-based discovery of the right tools
- Guided workflows - Pre-built multi-step task templates
- Real-world examples - Usage examples and parameter presets for every command
Key Features
- 150+ Tools - All
hana-clicommands accessible via standardized MCP interface - 📚 Resources - Browsable documentation and metadata resources
- 🎬 Prompts - Guided conversation workflows for common tasks
- 🔍 Discovery Tools - Intent-based recommendations and smart search
- 📖 Examples - Real-world usage examples and parameter templates for 20+ commands
- 🔄 Workflows - Pre-built multi-step sequences for common scenarios
- 🤖 Result Interpretation - AI-friendly analysis and insights from command results
- 📖 Integrated Docs - 279 documentation pages with full-text search
Quick Start
Installation
cd mcp-server
npm install
npm run buildConfiguration
To use with Claude Dev or Cline in VS Code:
{
"mcpServers": {
"hana-cli": {
"command": "node",
"args": ["../mcp-server/build/index.js"],
"env": {}
}
}
}Documentation Sections
Foundational Topics
- Setup and Configuration - Installation, configuration, and connection setup
- Features Overview - Complete overview of all MCP capabilities
- Troubleshooting - Common issues and solutions
Advanced Features
- Discovery Tools - Command recommendations, search, workflows, and templates
- Advanced Features - Workflow execution, result interpretation, and more
- Prompts and Resources - MCP resources, prompts, and how agents use them
Implementation Details
- Implementation Phases - Phase 1-3 improvements and technical details
- Documentation Search - Access to 279 documentation pages via MCP
Architecture Overview
MCP Server
├── Tools (150+)
│ ├── Database Commands
│ ├── Analysis Tools
│ └── System Commands
├── Discovery
│ ├── Command Recommendations
│ ├── Smart Search
│ └── Workflow Suggestions
├── Resources
│ ├── Documentation
│ ├── Examples
│ └── Presets
└── Prompts
├── Task Workflows
├── Troubleshooting
└── Learning GuidesCommon Use Cases
1. Database Exploration
Goal: Understand database structure and data quality
Workflow:
- Use
hana_statusto verify connection - Use
hana_schemasto list available schemas - Use
hana_tablesto see tables in interesting schemas - Use
hana_dataProfileto analyze data quality
MCP Help: Use hana_recommend with "explore database" for guided steps
2. Data Import with Validation
Goal: Safely import data from a CSV file with validation
Workflow:
- Use
hana_importwithdryRun: trueto preview - Review the dry run output for issues
- Run actual import with error handling
- Use
hana_dataValidatorto verify imported data
MCP Help: Use the import-data prompt for guided workflow
3. Schema Comparison
Goal: Find differences between DEV and PROD schemas
Workflow:
- Execute
hana_compareSchemawith source and target - Analyze differences in objects, columns, types
- Generate migration DDL
- Validate differences with team
MCP Help: Use hana_examples for compareSchema to see parameter options
Key Components
1. Tools (Commands)
All hana-cli commands are exposed as MCP tools with the hana_ prefix:
hana_status- Connection and user informationhana_tables- List database tableshana_import- Import data from files- And 140+ more...
2. Discovery System
hana_recommend- Get command suggestions from natural language intenthana_smart_search- Search commands, examples, presets, and workflowshana_quickstart- Get beginner-friendly first commandshana_conversation_templates- Browse pre-built task workflows
3. Resources
AI agents can browse documentation:
hana://docs/overview- Project overviewhana://docs/commands/import- Command-specific guideshana://docs/categories/data-quality- Category guides- And 276 more...
4. Prompts
Guided workflows for common tasks:
explore-database- Step-by-step database explorationimport-data- Safe data import workflowvalidate-data-quality- Data quality check workflow- And 5 more...
Capabilities Summary
| Feature | Details |
|---|---|
| Tools | 150+ database commands with full parameter support |
| Discovery | Intent-based recommendations, keyword search, category browsing |
| Examples | 40+ real-world usage examples with parameter sets |
| Presets | 30+ parameter templates for common scenarios |
| Workflows | 20+ multi-step task sequences |
| Documentation | 279 searchable documentation pages |
| Error Handling | Intelligent error analysis with actionable suggestions |
| Result Interpretation | AI-friendly analysis and insights from command output |
How Agents Use MCP Server
Example: Data Import Task
Agent: "I need to import customer data from a CSV file"
System:
1. Calls hana_recommend with intent → Gets import command + 4 related commands
2. User confirms import is correct command
3. Agent calls hana_examples with command="import" → Gets 5 usage scenarios
4. Agent calls hana_parameter_presets with command="import" → Gets preset templates
5. Agent executes import with dryRun:true
6. Agent calls hana_interpret_result → Gets AI-friendly analysis
7. Agent reviews results and proceeds with actual import
8. System suggests next steps: dataValidator, dataProfile, duplicateDetectionFor More Information
- Features Overview - Detailed feature list
- Discovery Tools - How to find the right commands
- Advanced Features - Workflows, interpretation, and more
- Implementation Phases - Technical implementation details
- Troubleshooting - Common issues and solutions
Related Documentation
- MCP Feature Documentation - User-facing MCP documentation
- Development Guide - Overall development documentation
- GitHub Repository - Source code and issues
Next Steps
Ready to get started? See:
- Setup and Configuration - Get MCP running
- Features Overview - Understand what's available
- Discovery Tools - Learn how to find commands