Allows executing Composer commands within the DDEV web service container for dependency management.
Enables querying, schema inspection, and database management for MariaDB instances within DDEV environments.
Enables querying, schema inspection, and database management for MySQL instances within DDEV environments.
Supports sharing local DDEV projects with external users via ngrok tunnels.
Enables querying, schema inspection, and database management for PostgreSQL instances within DDEV environments.
Allows for the execution of commands within Redis service containers in the DDEV environment.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DDEV MCP Serverlist my ddev projects and check their status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DDEV MCP Server
Overview
This project provides a Model Context Protocol (MCP) server that enables Large Language Models (LLMs) and AI assistants to interact with DDEV local development environments.
Features include:
ποΈ Query databases directly - Execute SQL queries, inspect schemas, and analyze data in your DDEV MySQL/PostgreSQL databases
π Manage DDEV projects - Start, stop, restart projects and check their status
π§ Execute development commands - Run Composer, access logs, control Xdebug, and execute shell commands in containers
π‘οΈ Maintain security - Whitelist-based protection ensures only safe operations are allowed by default
Use Cases:
Database Development: "Show me all users with pending orders" β LLM queries your local database directly
Debugging: "Check the error logs for the last hour" β LLM retrieves and analyzes DDEV service logs
Project Management: "Start my e-commerce project and check if the database is ready" β LLM manages your DDEV environment
Schema Analysis: "What's the relationship between users and orders tables?" β LLM inspects your actual database structure
Development Workflow: "Run the latest migrations and show me the updated schema" β LLM executes commands and verifies results
Features
Tools
Database Operations
ddev_db_backup- Create database snapshotsddev_db_describe_table- Get table structure/schema (PostgreSQL \d or MySQL DESCRIBE)ddev_db_list_backups- List available database backupsddev_db_list_databases- List all databases (PostgreSQL \l or MySQL SHOW DATABASES)ddev_db_list_tables- List all tables in the database (auto-detects database type)ddev_db_query- Execute SQL queries with detailed error reporting (supports PostgreSQL, MySQL, MariaDB)ddev_db_restore- Restore from database snapshots
Project Management
ddev_list_projects- List all DDEV projects with statusddev_project_status- Get current status and configuration of a DDEV projectddev_start_project- Start a DDEV projectddev_stop_project- Stop a DDEV projectddev_restart_project- Restart a DDEV project
DDEV Service Operations
ddev_exec_command- Execute commands in DDEV web serviceddev_exec_service- Execute commands in specific DDEV services (web, db, redis, etc.)ddev_ssh- SSH access and connection informationddev_logs- Get service logs
Development Tools
ddev_composer_command- Run Composer commandsddev_xdebug- Control Xdebug (on/off/toggle/status)ddev_share- Share project via ngrok tunnelddev_mailpit- Access Mailpit for email testing
Database Management
ddev_export_db- Export database dumpsddev_import_db- Import database dumps
π Security Features:
Whitelist Security Model: Only explicitly allowed read-only operations are permitted (default deny)
Comprehensive Protection: Blocks hundreds of potentially dangerous operations by default
Write Protection: All data modification blocked by default unless
--allow-writeis usedCatastrophic Operation Blocking: DROP DATABASE, SHUTDOWN, file operations always blocked
Configuration Protection: Blocks SET, FLUSH, GRANT, and other config changes
Resources
ddev://current- Current project context and server configurationddev://config- Current project DDEV configuration
Security Features
π Whitelist Security Model (Default Deny) The MCP server uses a comprehensive whitelist approach where only explicitly allowed read-only operations are permitted. Any query not matching the whitelist is automatically blocked.
β Allowed Operations (Whitelist)
SELECT- Data queries and joinsSHOW- Database/table inspection (TABLES, DATABASES, COLUMNS, etc.)DESCRIBE/DESC- Table structureEXPLAIN- Query execution plansWITH ... SELECT- Common Table Expressions (read-only)PostgreSQL meta-commands (
\dt,\d,\l, etc.)System catalog queries (
INFORMATION_SCHEMA,pg_catalog)
π« Always Blocked (Even with --allow-write)
DROP DATABASE/DROP SCHEMA- Catastrophic deletionsSHUTDOWN,KILL- System controlFile system access (
LOAD_FILE,INTO OUTFILE)Shell commands (
\!,COPY ... FROM PROGRAM)Other system-level operations
Enabling Write Operations
To enable write operations, use the --allow-write flag:
β οΈ Warning: Only enable write operations when necessary and ensure you trust the LLM application accessing the server.
Multi-Database Support
The MCP server automatically detects the database type from your DDEV configuration and uses the appropriate commands:
PostgreSQL Projects
Commands:
psql,\dt,\d table_name,\lDetected from:
database.type: postgresin.ddev/config.yaml
MySQL/MariaDB Projects
Commands:
mysql,SHOW TABLES,DESCRIBE table_name,SHOW DATABASESDetected from:
database.type: mysqlordatabase.type: mariadbin.ddev/config.yaml
Automatic Detection
Reads
.ddev/config.yamlto determine database typeFalls back to MySQL if no configuration found
Database type is shown in command output for clarity
Installation & Deployment
Option 1: Download from GitHub Releases (Recommended)
Download the NPM package from the latest release and install locally:
Option 2: NPM Installation (Currently Unavailable)
Option 3: Build from Source
Option 4: Quick Installation Script
This will:
β Check system requirements (Node.js 20+, DDEV)
π¦ Install the server globally via npm
π Provide MCP client configuration
MCP Client Configuration
Basic Configuration
Global Installation
Local Installation
Advanced Configuration with Single Project Mode
β οΈ Important: When you configure single project mode, the MCP server becomes limited to that single project only. All tools will automatically target the configured project, project selection parameters (project_name) will be hidden from the interface, and the ddev_list_projects command will be disabled for security reasons (to prevent information disclosure about other projects on the system).
Single Project Mode (Recommended for dedicated development)
Use Case: Perfect when working on a single project and you want a clean, dedicated interface without repetitive project parameters.
Enable Write Operations (Use with Caution)
Multi-Project Mode (Flexible for multiple projects)
Use Case: When working with multiple DDEV projects, you can specify project_name or project_path for each command.
All tools will show project selection parameters.
Multiple Dedicated Servers (Different projects and security levels)
Use Case: Separate MCP servers for different projects with different security levels (e.g., read-only for production, write-enabled for development).
Configuration Summary
Mode | Configuration | Project Parameters |
| Use Case |
Single Project |
| Hidden (automatic) | Disabled (security) | Dedicated development on one project |
Multi-Project | No default args | Visible (required) | Available | Working across multiple projects |
Multiple Servers | Multiple servers with different single projects | Hidden per server | Disabled per server | Different projects with different access levels |
Configuration File Locations
Configuration file locations depend on your MCP client. Common examples:
Generic MCP Client:
~/.config/mcp/config.jsonApplication-specific: Check your MCP client documentation for the correct path
Project Context Features
π― Intelligent Project Context
When you configure single project mode, the MCP server provides rich contextual information to LLMs through the
ddev://current resource.
Current Project Information
The ddev://current resource provides real-time:
Project Details: Name, status, database type, URL
Server Configuration: Security mode, default settings
Dynamic Status: Current project state (updated when accessed)
Example Response:
Usage Examples
Project Targeting Options
The MCP server supports different project targeting modes depending on your configuration:
Single Project Mode (Single Project Configured)
All commands automatically target the configured single project.
Multi-Project Mode (No Single Project Restriction)
Project parameters are visible and required for targeting specific projects.
Project Resolution (Multi-Project Mode Only)
When no single project restriction is configured, the server resolves projects in this order:
Explicit - Uses the specified DDEV project name
Current directory - Fallback if no project name provided
Note: In single project mode, all commands automatically use the configured project.
Testing & Debugging
Test with MCP Inspector
Verify Installation
Requirements
Node.js 20+
DDEV installed and accessible via PATH
DDEV projects configured