The SAP HANA MCP Server enables AI agents and development tools to securely interact with SAP HANA databases through the Model Context Protocol (MCP).
Database Operations:
Execute custom SQL queries, including parameterized queries for prepared statements
Retrieve sample data and count rows in tables
Test database connectivity and view configuration settings
Schema Management:
List all schemas, tables within schemas, and describe table structures
List and describe indexes for tables
Explore database schema through natural language commands
System Administration:
Monitor memory usage statistics and system information
Get current database user information
Debug environment variables
Integration & Security:
Seamlessly integrates with Claude Desktop, VSCode extensions, and custom AI applications
Features enterprise-grade security with SSL/TLS support and secure credential management
Provides both command-line interface and React-based web UI
Uses JSON-RPC 2.0 with modular architecture for easy extension
Uses .env files for configuration management of server settings and connection parameters
Uses Flask to implement the REST API layer of the MCP server architecture
Utilizes pandas as a prerequisite library, likely for data manipulation and analysis within the model execution context
Built on Python 3.8+ as the core programming language for the server implementation
Provides integration with SAP HANA Cloud Database, allowing for machine learning operations and model management directly with the SAP HANA Cloud environment
SAP HANA MCP Server
Model Context Protocol (MCP) server for seamless SAP HANA database integration with AI agents and development tools.
Table of Contents
- Overview
- Key Features
- Architecture
- Prerequisites
- Quick Setup
- Configure Using UI
- Configuration
- Usage
- API Reference
- Development
- Troubleshooting
- Contributing
- License
- Acknowledgments
🎯 Overview
The SAP HANA MCP Server provides a robust, production-ready bridge between AI applications and SAP HANA databases through the Model Context Protocol (MCP). Designed for enterprise environments, it offers comprehensive database management capabilities with secure, scalable architecture.
Available in two formats:
- CLI Server: Command-line interface for direct integration
- Web UI: Professional React interface for visual configuration management
Supported Platforms
- AI Agents: Custom AI Applications, Claude Desktop, VSCode Extensions
- Databases: SAP HANA (All versions)
- Operating Systems: macOS, Linux, Windows
- Node.js: 18.x and above
✨ Key Features
Enterprise Security
- Secure Credential Management: Environment-based configuration
- SSL/TLS Support: Full encryption for database communications
- Certificate Validation: Configurable certificate verification
Database Operations
- Schema Exploration: Complete database schema discovery and navigation
- Query Execution: Advanced SQL query execution with parameterized support
- Administrative Tools: System monitoring, user management, and performance insights
- Data Management: Sample data retrieval, row counting, and metadata analysis
Architecture Excellence
- Modular Design: Clean separation of concerns with maintainable codebase
- Scalable Architecture: Easy extension and customization for enterprise needs
- Comprehensive Logging: Structured logging with configurable levels
- Error Handling: Robust error management with detailed diagnostics
Developer Experience
- MCP Protocol Compliance: Full Model Context Protocol 2.0 implementation
- Tool Discovery: Automatic tool registration and discovery
- JSON-RPC 2.0: Standardized communication protocol
- Testing Framework: Comprehensive testing suite with multiple validation methods
🏗️ Architecture
System Architecture
Component Architecture
📋 Prerequisites
System Requirements
- Node.js: Version 18.x or higher
- Memory: Minimum 512MB RAM (2GB recommended)
- Storage: 100MB available disk space
- Network: Access to SAP HANA database
Database Requirements
- SAP HANA: Version 2.0 or higher
- User Permissions: SELECT, DESCRIBE, and administrative privileges
- Network Access: TCP/IP connectivity to HANA instance
Development Tools
- Claude Desktop: For AI agent integration
- VSCode: For development and testing (optional)
- Git: For version control
🚀 Quick Setup
Step 1: Install the Package
Step 2: Configure Claude Desktop
Update your Claude Desktop configuration file:
macOS: ~/.config/claude/claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
Windows: %APPDATA%\claude\claude_desktop_config.json
Step 3: Restart Claude Desktop
Close and reopen Claude Desktop to load the new configuration.
Step 4: Test Connection
Ask Claude: "Test the HANA database connection" or "Show me the available schemas"
That's it! 🎉 Your HANA MCP Server is now ready to use.
🖥️ Configure Using UI
For users who prefer a graphical interface, there is a HANA MCP UI - a React-based web application for managing server configurations.
🌟 Why Use the UI?
- Visual Configuration: Intuitive web interface for server management
- Multi-Environment Support: Configure Production, Development, and Staging environments
- Claude Desktop Integration: Deploy configurations directly to Claude Desktop
- Real-time Monitoring: Visual status tracking of active servers
- Backup & Restore: Configuration management with history
🚀 Quick UI Setup
The UI will automatically:
- Start a local web server on port 3001
- Open your browser to the configuration interface
- Guide you through server setup and Claude Desktop integration
📚 UI Documentation
For detailed UI documentation, configuration schemas, and advanced features, visit: HANA MCP UI Documentation
⚙️ Configuration
Environment Variables
Variable | Required | Description | Default |
---|---|---|---|
HANA_HOST | ✅ | HANA database hostname | - |
HANA_PORT | ✅ | HANA database port | 443 |
HANA_USER | ✅ | Database username | - |
HANA_PASSWORD | ✅ | Database password | - |
HANA_SCHEMA | ❌ | Default schema | - |
HANA_SSL | ❌ | Enable SSL connection | true |
HANA_ENCRYPT | ❌ | Enable encryption | true |
HANA_VALIDATE_CERT | ❌ | Validate SSL certificate | true |
LOG_LEVEL | ❌ | Logging level | info |
Default Schema Behavior
The server intelligently handles schema selection:
Scenario | Behavior |
---|---|
HANA_SCHEMA set | Uses default schema for optional parameters |
HANA_SCHEMA not set | Requires explicit schema specification |
Schema parameter provided | Overrides default schema |
🚀 Usage
Claude Desktop Integration
Once configured, you can interact with your HANA database using natural language:
- "Show me all schemas in the database"
- "List tables in the SYSTEM schema"
- "Describe the structure of table CUSTOMERS"
- "Execute this query: SELECT * FROM SYSTEM.TABLES LIMIT 10"
- "Get sample data from table ORDERS"
Command Line Usage
You can also run the server directly:
📚 API Reference
Configuration Tools
Tool | Description | Parameters |
---|---|---|
hana_show_config | Display current HANA configuration | None |
hana_test_connection | Test database connectivity | None |
hana_show_env_vars | Show environment variables (debug) | None |
Schema Exploration Tools
Tool | Description | Parameters |
---|---|---|
hana_list_schemas | List all database schemas | None |
hana_list_tables | List tables in a schema | schema_name (optional) |
hana_describe_table | Show table structure | schema_name , table_name |
hana_list_indexes | List indexes for a table | schema_name , table_name |
hana_describe_index | Show index details | schema_name , table_name , index_name |
Query Execution Tools
Tool | Description | Parameters |
---|---|---|
hana_execute_query | Execute SQL queries | query |
hana_execute_parameterized_query | Execute parameterized queries | query , parameters |
hana_get_sample_data | Get sample data from table | schema_name , table_name , limit |
hana_count_rows | Count rows in a table | schema_name , table_name |
Administrative Tools
Tool | Description | Parameters |
---|---|---|
hana_get_system_info | Get system information | None |
hana_get_user_info | Get current user information | None |
hana_get_memory_usage | Get memory usage statistics | None |
Tool Response Format
All tools return standardized JSON responses:
🔧 Development
Development Setup
Adding New Tools
1. Create Tool Implementation
2. Register Tool
3. Define Tool Schema
Development Scripts
🐛 Troubleshooting
Common Issues & Solutions
Connection Issues
Issue | Cause | Solution |
---|---|---|
"Connection refused" | Network connectivity | Verify HANA host and port accessibility |
"Authentication failed" | Invalid credentials | Check username/password in configuration |
"SSL certificate error" | Certificate validation | Configure HANA_VALIDATE_CERT=false or install valid certificates |
MCP Protocol Issues
Issue | Cause | Solution |
---|---|---|
"MCP server not visible" | Configuration path | Verify Claude Desktop config file location |
"Tools disabled" | Protocol compliance | Check JSON-RPC implementation and tool structure |
"Handler is not a function" | Tool registration | Verify tool implementation and registration |
Debugging
Enable Debug Logging
Manual Server Testing
Error Codes
The server uses standard JSON-RPC 2.0 error codes:
Code | Description | Action |
---|---|---|
-32700 | Parse error | Check JSON format |
-32600 | Invalid request | Verify request structure |
-32601 | Method not found | Check method name |
-32602 | Invalid params | Verify parameter format |
-32603 | Internal error | Check server logs |
🤝 Contributing
We welcome contributions from the community! Please follow these guidelines:
Contribution Process
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes following coding standards
- Add tests for new functionality
- Update documentation as needed
- Test thoroughly using MCP Inspector
- Submit a pull request with detailed description
Development Guidelines
- Code Style: Follow existing code patterns
- Testing: Test new features with MCP Inspector
- Documentation: Update README and inline documentation
- Security: Follow security best practices for database operations
- Performance: Consider performance implications of changes
Pull Request Template
We use a standardized PR template. When you create a pull request, GitHub will automatically load the template with the following sections:
- Description: Brief description of changes
- Type of Change: Bug fix, new feature, documentation, or performance improvement
- Testing: MCP Inspector tests, manual testing, and breaking change verification
- Checklist: Code review, documentation, and quality checks
The template is located at .github/pull_request_template.md
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
License Summary
- Commercial Use: ✅ Allowed
- Modification: ✅ Allowed
- Distribution: ✅ Allowed
- Private Use: ✅ Allowed
- Liability: ❌ No liability
- Warranty: ❌ No warranty
🙏 Acknowledgments
- SAP for HANA database technology and support
- Anthropic for Claude Desktop and MCP specification
- MCP Community for protocol development and standards
- Open Source Contributors for valuable feedback and contributions
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
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.
Related Resources
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that integrates with Cursor IDE, providing real-time communication, modern web dashboards, and extensible tools via SSE and WebSocket connections.Last updated -6491
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to explore and interact with Cursor IDE's SQLite databases, providing access to project data, chat history, and composer information.Last updated -21
- AsecurityAlicenseAqualityA powerful Model Context Protocol framework that extends Cursor IDE with tools for web content retrieval, PDF processing, and Word document parsing.Last updated -813MIT License
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server for Cursor IDE that simplifies the installation and configuration of other MCP servers.Last updated -38068MIT License