Alibaba Cloud AnalyticDB for PostgreSQL + Windsurf Editor: Complete MCP Integration
Alibaba Cloud AnalyticDB for PostgreSQL is a MCP server that An MCP server to connect to AnalyticDB for PostgreSQL instances, query and analyze data..
When integrated with Windsurf Editor, you can:
- Execute SQL queries (SELECT, DML, DDL) on PostgreSQL
- Get comprehensive table statistics and metadata
- Retrieve and analyze query execution plans
This guide provides step-by-step instructions to set up Alibaba Cloud AnalyticDB for PostgreSQL in Windsurf Editor, including configuration, examples, and troubleshooting.
What You'll Achieve
After completing this setup:
- Alibaba Cloud AnalyticDB for PostgreSQL will be fully integrated and operational
- You can use Alibaba Cloud AnalyticDB for PostgreSQL tools directly in Windsurf Editor
- All Alibaba Cloud AnalyticDB for PostgreSQL capabilities will be available for your workflows
- Access to 6 different tools
Prerequisites
Before starting, ensure you have:
- AnalyticDB for PostgreSQL host endpoint
- Database username
- Database password
- Database name
- Windsurf Editor installed and configured
- Compatible operating system (Desktop App)
Installation
Step 1: Install Alibaba Cloud AnalyticDB for PostgreSQL
Configuration
Step 2: Configure Windsurf Editor
-
Locate your configuration file:
- Windows:
%USERPROFILE%\.codeium\windsurf\mcp_config.json - macOS:
~/.codeium/windsurf/mcp_config.json - Linux:
~/.codeium/windsurf/mcp_config.json
- Windows:
-
Add server configuration:
{
"mcpServers": {
"alibaba-cloud-analyticdb-for-postgresql": {
"command": "alibaba cloud analyticdb for postgresql",
"args": []
}
}
}
Note: If Alibaba Cloud AnalyticDB for PostgreSQL requires environment variables, add them to the server configuration:
"env": {
"ADBPG_HOST": "adbpg-cluster-123.ads.aliyuncs.com",
"ADBPG_PORT": "5432",
"ADBPG_USER": "analytics_user",
"ADBPG_PASSWORD": "secure_password123",
"ADBPG_DATABASE": "analytics_db",
"GRAPHRAG_ENABLED": "true",
"LLM_MEMORY_SERVICE_URL": "https://memory-service.example.com"
}
- Restart Windsurf Editor
Completely quit and restart Windsurf Editor to load the new configuration.
Examples
Once configured, you can use Alibaba Cloud AnalyticDB for PostgreSQL in Windsurf Editor:
Advanced Analytics Pipeline
undefined
Ask Windsurf Editor: "Analyze customer behavior patterns and generate insights"
Expected Result: undefined
Knowledge Graph Construction
undefined
Ask Windsurf Editor: "Create knowledge graph connecting customers, products, and transactions"
Expected Result: undefined
Intelligent Memory Management
undefined
Ask Windsurf Editor: "Store and retrieve conversation history for personalized responses"
Expected Result: undefined
Testing Your Setup
- Launch Windsurf Editor
- Verify Alibaba Cloud AnalyticDB for PostgreSQL is available in the tools list
- Test basic Alibaba Cloud AnalyticDB for PostgreSQL functionality
Troubleshooting
Common Issues
Tools Not Appearing
Symptoms: Cascade does not see new tools, Hammer icon missing
Cause: Configuration syntax error or server failed to start.
Solution:
- Check the JSON configuration for syntax errors.
- Verify the command (e.g.,
npx,python) is in your system PATH. - Check Windsurf logs for MCP connection errors.
Environment Variables
Symptoms: Authentication failed, Permission denied
Cause: Missing API keys in configuration.
Solution:
- Ensure
envblock is correctly defined inside the server config. - Restart Windsurf after changing environment variables.
Alibaba Cloud AnalyticDB for PostgreSQL not appearing in Windsurf Editor
Symptoms: Server not listed, Tools not available
Cause: Configuration or installation issue
Solution:
- Verify configuration syntax
- Check Alibaba Cloud AnalyticDB for PostgreSQL installation
- Restart Windsurf Editor
- Check logs for error messages
Next Steps
Now that Alibaba Cloud AnalyticDB for PostgreSQL is integrated with Windsurf Editor:
- Explore all Alibaba Cloud AnalyticDB for PostgreSQL capabilities through Windsurf Editor
- Check out other MCP servers that work with Windsurf Editor
- Join the MCP community for tips and support
- Consider contributing to Alibaba Cloud AnalyticDB for PostgreSQL development
Need Help?
- Search for Alibaba Cloud AnalyticDB for PostgreSQL documentation
- Check the Windsurf Editor MCP guide
- Join the MCP community discussions