oladejibidmus/DigitalOcean-Database-MCP-Server
If you are the rightful owner of DigitalOcean-Database-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The DigitalOcean Database MCP Server facilitates seamless integration between AI-powered development environments and DigitalOcean managed databases using a Model Context Protocol (MCP) server.
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
(orCmd+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
- Name:
- 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 tokenlist_database_clusters
- List all your database clustersconnect_by_name
- Connect to a cluster by name
๐๏ธ Database Operations
execute_query
- Run SQL queries with optional parameterslist_tables
- Show all tables in the databasedescribe_table
- Get detailed table schemaget_database_info
- Database version and cluster informationdisconnect_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 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
Works with: ๐ฏ Cursor AI โข ๐ค Claude Desktop โข ๐ Windsurf โข ๐ป VS Code โข โก Zed โข ๐ง Any MCP Client