DigitalOcean Database MCP Server
🌊 DigitalOcean • ⚡ TypeScript • 🐘 PostgreSQL • 🐬 MySQL
Connect AI-powered IDEs to your DigitalOcean databases with just an API token!
Compatible with: 🎯 Cursor AI • 🤖 Claude Desktop • 🌊 Windsurf • 💻 VS Code • ⚡ Zed • 🔧 Any MCP Client
GitHub badges (will display properly on GitHub):
🚀 Overview
This Model Context Protocol (MCP) server enables seamless integration between AI-powered development environments and your DigitalOcean managed databases. Works with Cursor AI, Claude Desktop, Windsurf, VS Code with AI extensions, and any other IDE that supports MCP. Instead of manually managing database credentials, simply use your DigitalOcean API token to automatically discover and connect to any of your database clusters.
✨ Key Features
- 🔑 Token-Based Authentication - Use your DigitalOcean API token instead of managing database credentials
 
- 🔍 Auto-Discovery - Automatically list all your database clusters
 
- 🎯 Connect by Name - Simply specify cluster names, no complex connection strings
 
- 🗄️ Multi-Database Support - Works with PostgreSQL and MySQL clusters
 
- 🔒 Secure Connections - SSL support enabled by default
 
- 🛠️ Full SQL Support - Execute queries, manage schemas, analyze data
 
- 🔄 Connection Pooling - Optimized performance with automatic connection management
 
🎯 What You Can Do
Once connected, you can interact with your databases through natural language:
- "Show me all my database clusters"
 
- "Connect to my production database"
 
- "List all tables and describe the users table"
 
- "Run this analytics query and explain the results"
 
- "Create a new table for storing blog posts"
 
- "Show me the top 10 customers by revenue"
 
🔧 Compatible IDEs & AI Tools
- Cursor AI - AI-first code editor
 
- Claude Desktop - Anthropic's desktop app with MCP support
 
- Windsurf - AI-powered IDE by Codeium
 
- VS Code - With Continue.dev, Codeium, or other MCP-compatible extensions
 
- Zed - High-performance editor with AI assistant support
 
- Neovim - With AI plugins that support MCP
 
- Any IDE with MCP client support
 
🛠️ Installation
1. Clone the Repository
git clone https://github.com/oladejibidmus/DigitalOcean-Database-MCP-Server.git
cd digitalocean-database-mcp
2. Install Dependencies
npm install
3. Build the Project
npm run build
4. Get Your DigitalOcean API Token
- Go to DigitalOcean API Tokens
 
- Click "Generate New Token"
 
- Name it something like "Cursor Database MCP"
 
- Select "Read" permissions (or "Read & Write" for full access)
 
- Copy the token (you'll only see it once!)
 
5. Configure Your IDE
Choose your development environment and follow the corresponding setup:
🎯 Cursor AI
- Open Cursor Settings: Press 
Ctrl+Shift+P (or Cmd+Shift+P on Mac) and search for "Cursor Settings" 
- Find MCP Servers: Look for the MCP option in the sidebar and enable it
 
- Add New MCP Server: Click "Add New MCP Server"
 
- Configure the server:
- Name: 
digitalocean-database 
- Command: 
node 
- Args: 
/absolute/path/to/digitalocean-database-mcp/dist/index.js 
 
- Enable: Toggle the server to active (green dot should appear)
 
Alternatively, create a .cursor/mcp.json file in your project directory:
{
  "mcpServers": {
    "digitalocean-database": {
      "command": "node",
      "args": ["/absolute/path/to/digitalocean-database-mcp/dist/index.js"]
    }
  }
}
🤖 Claude Desktop
- Open Claude Desktop Settings: Go to Settings → Developer
 
- Click "Edit Config": This opens 
claude_desktop_config.json 
- Add the server configuration:
 
{
  "mcpServers": {
    "digitalocean-database": {
      "command": "node",
      "args": ["/absolute/path/to/digitalocean-database-mcp/dist/index.js"]
    }
  }
}
- Save and restart Claude Desktop
 
🌊 Windsurf
- Open Windsurf Settings: Click the "Windsurf - Settings" button (bottom right) or press 
Ctrl+Shift+P and search "Open Windsurf Settings" 
- Navigate to Cascade: Find the "Cascade" section in Advanced Settings
 
- Enable MCP: Look for the "Model Context Protocol" option and enable it
 
- Click the hammer icon in the Cascade toolbar
 
- Configure MCP: Click "Configure" to open the MCP configuration file
 
- Add your server:
 
{
  "mcpServers": {
    "digitalocean-database": {
      "command": "node",
      "args": ["/absolute/path/to/digitalocean-database-mcp/dist/index.js"]
    }
  }
}
- Refresh: Click the refresh button to start the server
 
💻 VS Code
For GitHub Copilot Agent Mode (Built-in):
- Enable MCP support: Go to Settings and enable 
chat.mcp.enabled 
- Create MCP configuration: Add a 
.vscode/mcp.json file to your workspace: 
{
  "servers": {
    "digitalocean-database": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/digitalocean-database-mcp/dist/index.js"]
    }
  }
}
- Use Agent Mode: Select "Agent" from the chat mode dropdown
 
For Continue.dev Extension:
- Install Continue.dev extension from the marketplace
 
- Configure MCP: Create 
.continue/mcpServers/digitalocean-db.yaml: 
name: DigitalOcean Database
mcpServer:
  version: 0.0.1
  schema: v1
mcpServers:
  - name: DigitalOcean DB
    command: node
    args:
      - "/absolute/path/to/digitalocean-database-mcp/dist/index.js"
⚡ Zed
- Open Zed: Launch the Zed editor
 
- Access Agent Panel Settings: Go to the Agent Panel and click the settings gear
 
- Add Context Server: Click "Add Context Server" or edit settings manually
 
- Configure in settings.json:
 
{
  "context_servers": {
    "digitalocean-database": {
      "source": "custom",
      "command": {
        "path": "node",
        "args": ["/absolute/path/to/digitalocean-database-mcp/dist/index.js"],
        "env": {}
      }
    }
  }
}
🔧 Generic MCP Client Setup
For any other MCP-compatible client, use these standard parameters:
- Transport Type: 
stdio 
- Command: 
node 
- Arguments: 
["/absolute/path/to/digitalocean-database-mcp/dist/index.js"] 
- Working Directory: Your project directory
 
- Environment Variables: Optional 
DO_API_TOKEN for pre-set authentication 
6. Verify Installation
After configuration:
- Restart your IDE/editor
 
- Look for MCP indicators: Most IDEs show a tools/server icon when MCP servers are active
 
- Test the connection: Try saying "Set my DigitalOcean API token" to verify the server is responding
 
Note: Replace /absolute/path/to/digitalocean-database-mcp with the actual full path to your cloned repository.
🎮 Usage
Step 1: Set Your API Token
In your AI assistant (Cursor, Claude Desktop, Windsurf, etc.), simply say:
Set my DigitalOcean API token: dop_v1_your_actual_token_here
Step 2: Discover Your Databases
Show me all my database clusters
Step 3: Connect to a Database
Connect to my database cluster named "production-api"
Step 4: Start Querying!
Show me all tables in this database
Execute this query: SELECT COUNT(*) FROM users WHERE created_at > '2024-01-01'
Describe the structure of the orders table
📋 Available Commands
🔐 Authentication & Discovery
set_api_token - Set your DigitalOcean API token 
list_database_clusters - List all your database clusters 
connect_by_name - Connect to a cluster by name 
🗄️ Database Operations
execute_query - Run SQL queries with optional parameters 
list_tables - Show all tables in the database 
describe_table - Get detailed table schema 
get_database_info - Database version and cluster information 
disconnect_database - Close current connection 
🔧 Manual Connection (Optional)
connect_database - Connect with manual credentials if needed 
🏗️ Architecture
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   AI Assistant  │◄──►│   MCP Server    │◄──►│ DigitalOcean DB │
│                 │    │                 │    │    Clusters     │
│ • Cursor AI     │    │ • API Client    │    │ • PostgreSQL    │
│ • Claude Desktop│    │ • DB Connectors │    │ • MySQL         │
│ • Windsurf      │    │ • Query Engine  │    │ • SSL Enabled   │
│ • VS Code       │    │ • Pool Manager  │    │ • Auto-scaling  │
│ • Any MCP Client│    │                 │    │                 │
└─────────────────┘    └─────────────────┘    └─────────────────┘
🔒 Security Best Practices
- ✅ API Token Permissions - Use read-only tokens when possible
 
- ✅ SSL Connections - Enabled by default for all connections
 
- ✅ No Credential Storage - Tokens are only stored in memory during session
 
- ✅ Connection Pooling - Automatic cleanup and resource management
 
- ✅ Parameter Binding - Prepared statements prevent SQL injection
 
🛠️ Development
Project Structure
digitalocean-database-mcp/
├── src/
│   └── index.ts          # Main MCP server implementation
├── dist/                 # Compiled JavaScript output
├── package.json          # Dependencies and scripts
├── tsconfig.json         # TypeScript configuration
└── README.md            # This file
Development Scripts
# Development with hot reload
npm run dev
# Build for production
npm run build
# Start production server
npm start
Adding New Features
- Fork the repository
 
- Create a feature branch: 
git checkout -b feature/new-feature 
- Make your changes in 
src/index.ts 
- Test thoroughly with your DigitalOcean databases
 
- Submit a pull request
 
🚨 Troubleshooting
Connection Issues
"Invalid API token"
- Verify your token is correct and not expired
 
- Check that the token has sufficient permissions
 
- Ensure you're using the full token including the 
dop_v1_ prefix 
"Database cluster not found"
- Run 
list_database_clusters to see available clusters 
- Check that the cluster name is spelled correctly
 
- Verify the cluster is in a running state
 
"SSL connection failed"
- DigitalOcean requires SSL for managed databases
 
- The server handles SSL automatically, but check firewall settings
 
- Verify your cluster allows connections from your IP
 
MCP Integration Issues
"MCP server not found"
- Check that the path in your IDE configuration is absolute and correct
 
- Verify Node.js is installed and accessible in your system PATH
 
- Try running the server manually: 
node dist/index.js 
- Restart your IDE after configuration changes
 
"Server not responding"
- Ensure the MCP server process is running
 
- Check IDE-specific MCP logs:
- Cursor: Check the output panel for MCP server logs
 
- Claude Desktop: Look in the application logs
 
- Windsurf: Check the developer tools console
 
- VS Code: Check the extension output panel
 
 
"Connection timeout"
- Increase the connection timeout in your database settings
 
- Check that your cluster is not overloaded
 
- Verify network connectivity to DigitalOcean
 
📚 Examples
Basic Data Analysis
// Connect to your analytics database
"Connect to my cluster named 'analytics-prod'"
// Explore the data
"Show me all tables and describe the events table"
// Run analysis
"SELECT DATE(created_at) as date, COUNT(*) as events 
 FROM events 
 WHERE created_at >= CURRENT_DATE - INTERVAL '30 days'
 GROUP BY DATE(created_at)
 ORDER BY date"
Schema Management
// Check current schema
"List all tables and their row counts"
// Create new table
"CREATE TABLE blog_posts (
  id SERIAL PRIMARY KEY,
  title VARCHAR(255) NOT NULL,
  content TEXT,
  author_id INTEGER,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)"
// Verify creation
"Describe the blog_posts table"
IDE-Specific Usage Tips
Cursor AI
- Use natural language for complex queries
 
- Ask for code generation with database context
 
- Request data visualization suggestions
 
Claude Desktop
- Great for data analysis and reporting
 
- Ask for explanations of query results
 
- Request database optimization suggestions
 
Windsurf
- Excellent for collaborative database work
 
- Use for real-time query debugging
 
- Leverage AI pair programming for schema design
 
VS Code
- Integrate with existing database workflows
 
- Use alongside database extension tools
 
- Great for migration script generation
 
🤝 Contributing
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
 
- Create a feature branch
 
- Make your changes
 
- Test thoroughly
 
- Submit a pull request
 
Development Environment
- Node.js 18+
 
- TypeScript 5+
 
- Access to DigitalOcean databases for testing
 
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- DigitalOcean for their excellent managed database service
 
- Model Context Protocol for the MCP specification
 
- Anthropic for Claude and MCP development
 
- Cursor for pioneering AI-first development
 
- Codeium for Windsurf and advancing AI-powered coding
 
- The open-source community for MCP adoption and tooling
 
📞 Support
- 🐛 Bug Reports: Open an issue
 
- 💡 Feature Requests: Start a discussion
 
- 📚 Documentation: Check the wiki
 
Made with ❤️ for the AI-powered development community
GitHub star badge: https://github.com/oladejibidmus/DigitalOcean-Database-MCP-Server
🌟 Star this repo on GitHub
Works with: 🎯 Cursor AI • 🤖 Claude Desktop • 🌊 Windsurf • 💻 VS Code • ⚡ Zed • 🔧 Any MCP Client