MCP Troubleshooting
Resolve common issues when using the Model Context Protocol (MCP) server integration with HANA CLI. This guide covers startup problems, connectivity issues, command execution failures, and AI integration challenges.
Quick Links
- MCP Server Won't Start
- Can't Connect to Database
- Project Context Not Working
- Command Execution Errors
- Permission Denied
- AI Integration Issues
- Performance Issues
- Debugging
Connection Issues
MCP Server Won't Start
Problem: node dist/src/index.js fails to run
Solutions:
Verify Node.js is installed:
node --versionCheck dependencies are installed:
npm installRebuild TypeScript:
npm run buildCheck for port conflicts:
bash# macOS/Linux lsof -i :3000 # Windows (PowerShell) Get-NetTCPConnection -LocalPort 3000
Can't Connect to Database
Problem: MCP executes commands but gets database connection errors
Solutions:
- Verify connection file exists in project:
ls .envorls default-env.json - Check credentials in connection file are correct
- Verify network access to HANA server
- Test direct connection with CLI:
hana-cli status
Project Context Not Working
Problem: MCP ignores projectPath and uses wrong connection
Solutions:
- Ensure
__projectContextis included in tool call - Check projectPath is absolute path (not relative)
- Verify connection file exists at that location
- Enable debug:
DEBUG=hana-cli:* node dist/src/index.js
Command Failures
Command Execution Errors
Problem: Tool call returns error from HANA CLI
Solutions:
- Check command parameters are correct
- Verify schema/table names exist and you have permissions
- Check data types match (especially for import)
- Review error message for specific issue
Permission Denied
Problem: User doesn't have access to schema/table
Solutions:
- Verify user in connection file has necessary permissions
- Check with database admin for grants
- Try with admin/system user temporarily
- Review SAP HANA user privileges
Performance Issues
Slow Queries
Problem: Commands take too long to complete
Solutions:
- Reduce data size with
--limitparameter - Use
--batchSizesmaller values for imports - Add WHERE clause filtering to exports
- Check HANA server load and resources
Memory Issues
Problem: Out of memory errors
Solutions:
- Use smaller
--batchSizevalues - Process data in chunks with
--limit - Use pagination for large result sets
- Increase Node.js heap:
NODE_OPTIONS="--max-old-space-size=4096"
AI Assistant Issues
Claude/LLM Integration Issues
Problem: AI assistant doesn't see available MCP tools
Solutions:
- Restart Claude Desktop or your AI IDE extension
- Verify MCP server is running:
npm run dev - Check your IDE's MCP configuration file (e.g.,
claude_desktop_config.json) - Ensure the correct path to the MCP executable is configured
- Verify the MCP server is accessible on the expected port
AI Returns Incorrect Results
Problem: AI assistant generates incorrect schema names, table names, or commands
Solutions:
- Verify schema and table names exist:
hana-cli inspectTable <schema> <table> - Verify the correct project path is set in the context
- Review actual data in the database to confirm expectations
- Provide explicit parameters instead of relying on AI inference
- Ask the AI tool to verify the database metadata first
Debug & Logs
Enable Debug Logging
# Standard debug
DEBUG=hana-cli:* node dist/src/index.js
# Verbose debug
DEBUG=* node dist/src/index.js
# To file
DEBUG=hana-cli:* node dist/src/index.js > debug.log 2>&1Check MCP Logs
Look for messages starting with:
hana-cli:- General messageshana-cli:executor:- Command executionhana-cli:connection:- Connection issues
Getting Help
- Review error messages carefully - Error output often includes hints about the root cause
- Enable debug logging - Use
DEBUG=hana-cli:*to see detailed execution flow - Check project structure - Verify configuration files exist and contain valid JSON
- Test CLI separately - Run
hana-cli statusandhana-cli systemInfoindependently to isolate MCP issues - Review related documentation: