Logo di DDEV MCP

DDEV MCP

Community
codingsasi

MCP server for ddev. Tooling for platform.sh, playwright, drush, wp-cli is available

Autorecodingsasi
Repositoryddev-mcp
LinguaTypeScript
Fork
1
Stelle
13
Strumenti disponibili
48
Tipo di trasportostdio
Categorie
LicenzaGPL-2.0
Link
  • Collega gli strumenti ai flussi di lavoro IA

    DDEV MCP mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 48 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    13 stelle e 1 fork nel repository collegato.

DDEV MCP

A production-ready Model Context Protocol (MCP) server that provides AI assistants with DDEV development environment automation. Built with TypeScript using the official MCP SDK.

** 13 Essential Tools**

Streamlined tool set optimized for AI models. Supports all DDEV project types including Drupal, WordPress, Laravel, Symfony, TYPO3, CakePHP, Magento, and many more through the powerful ddev_exec command!

Complete DDEV Development Automation

This DDEV MCP server provides comprehensive development environment automation for any web project:

  • Environment Management: Start, stop, restart DDEV projects
  • Database Operations: Import/export, snapshots, migrations
  • CMS-Specific Workflows: Drupal, WordPress, Laravel, etc

Documentation

  • Tools reference — What each MCP tool does, arguments, and full ddev help output. Use this to see what the AI sees and how tools map to the DDEV CLI.

Features

Environment Management

  • Start, stop, restart DDEV projects
  • Get project status and detailed information
  • Access container logs and SSH into services

Database Operations

  • Import/export databases with various formats
  • Support for compressed database files
  • Target specific databases in multi-db setups

Command Executor (exec)

  • Single ddev_exec tool handles all CMS/framework commands
  • Drupal: Execute Drush commands (drush cr, drush cex, etc.)
  • WordPress: WP-CLI commands (wp plugin list, wp core update, etc.)
  • Laravel: Artisan commands (php artisan migrate, etc.)
  • Symfony: Console commands (symfony console cache:clear, etc.)
  • Composer: Package management (composer install, composer update, etc.)
  • Redis, Solr, MySQL: Direct service commands
  • Testing: Playwright, Cypress, PHPUnit, and custom test runners
  • And more: Any command you can run in a DDEV container!

Production Ready

  • Thorough error handling and logging
  • Input validation and sanitization
  • TypeScript for type safety
  • Dangerous Command Protection: Built-in safety system for production-affecting commands

Installation

Prerequisites

  • Node.js 20+ (Node.js 22+ preferred for best performance)
  • DDEV installed and available in PATH
  • TypeScript knowledge for team contributions

Quick Setup

bash
# Install globally
npm install -g ddev-mcp

# Or run directly with npx
npx ddev-mcp --help

# Verify installation
ddev-mcp --version

Node.js Version Requirements

  • Minimum: Node.js 20.0.0+
  • Recommended: Node.js 22.0.0+ (for best performance and latest features)
  • Check your version: node --version

Development Setup

bash
git clone git@github.com:codingsasi/ddev-mcp.git
cd ddev-mcp
npm install
npm run build
npm run dev

Configuration

MCP Client Configuration

Add to your ~/.cursor/mcp.json:

json
{
  "mcpServers": {
    "ddev": {
      "command": "npx",
      "args": ["ddev-mcp"],
      "env": {
        "ALLOW_DANGEROUS_COMMANDS": "false" // true if you want ddev to run commands like `platform redeploy -emaster`
      },
    }
  }
}

No additional configuration needed! The server automatically detects your DDEV projects.

Environment Variables

bash
# Optional: Configure logging level
export DDEV_MCP_LOG_LEVEL="DEBUG"

# Optional: Max buffer size in bytes for command output (default: 2097152 = 2 MiB).
# If a command's stdout+stderr exceeds this, Node throws ERR_CHILD_PROCESS_STDIO_MAXBUFFER.
export DDEV_MCP_MAX_BUFFER="4194304"

# Safety: Allow dangerous commands (default: false)
export ALLOW_DANGEROUS_COMMANDS="true"

Dangerous Command Protection

The DDEV MCP server includes built-in protection against dangerous commands that could affect production environments:

  • Platform.sh commands like environment:redeploy, environment:delete are blocked by default
  • Database operations that could delete data are protected
  • File operations that could remove important files are safeguarded

Enabling Dangerous Commands

To allow dangerous commands (use with caution):

bash
export ALLOW_DANGEROUS_COMMANDS="true"

Adding New Dangerous Commands

Contributors can easily add dangerous command patterns in src/config/dangerous-commands.ts. See DANGEROUS_COMMANDS.md for detailed instructions.

Simple Directory Handling

The DDEV MCP server operates on the current working directory principle:

  • Runs commands in whatever directory the MCP server is invoked from
  • No complex directory detection or configuration needed
  • User controls the context by navigating to the correct directory

CMS-Specific Development Usage (via ddev_exec)

# Drupal
"Use ddev mcp to clear Drupal cache"
"Use ddev mcp to execute drush cex to export configuration"
"Use ddev mcp to use drush uli to get a one-time login link"

# WordPress
"Use ddev mcp to install and activate the Akismet plugin with wp plugin install"
"ddev mcp: Run wp core update to update WordPress"
"ddev mcp: Run wp cache flush to clear caches"

# Composer
"Use ddev mcp to run composer install using ddev_exec"
"ddev mcp: Update packages with composer update"

Other things you can do

"DDEV MCP: Start fresh development environment with latest DB"
"DDEV MCP: Enable debug mode and clear cache for debugging"
"DDEV MCP: Import test data for testing"

# Add-on specific workflows (via ddev_exec)
"DDEV MCP: Clear Redis cache with redis-cli FLUSHALL"
"DDEV MCP: Check Redis memory with redis-cli INFO memory"
"DDEV MCP: Query Solr with curl commands"
"DDEV MCP: Run MySQL queries with mysql -e"
"DDEV MCP: Execute Playwright tests"

# Directory navigation workflows
"DDEV MCP: Go to my WordPress project at ~/Projects/mysite and start it"
"DDEV MCP: Navigate to /home/user/drupal-site directory and check project status"
"DDEV MCP: Go to the correct project folder and run database import"

Available Tools

Project management (start, stop, restart, describe, list, logs), database (import, export, snapshots), ddev_exec for any in-container command (Drush, WP-CLI, Composer, etc.), plus ddev_help, ddev_version, ddev_poweroff, and message_complete_notification. Full list with arguments and ddev help output: Tools reference.

Development & Testing

Build and Test

  • Clone the repo to /path/to/repo/for/ddev-mcp/
  • Run npm run build
  • and add the following to mcp.json file.
json
{
  "mcpServers": {
    "ddev": {
      "command": "npx",
      "args": [
        "/path/to/repo/for/ddev-mcp/dist/index.js"
      ],
      "env": {
        "DDEV_MCP_LOG_LEVEL": "INFO"
      },
    },
  }
}

Architecture

Project Structure

src/
├── server/          # MCP server implementation
│   ├── index.ts     # Main server class
│   └── tools.ts     # Tool definitions and validation
├── ddev/            # DDEV operations
│   └── operations.ts # Core DDEV command implementations
├── utils/           # Utilities
│   ├── logger.ts    # Structured logging
│   └── command.ts   # Safe command execution
├── types/           # TypeScript definitions
│   └── index.ts     # Type definitions
└── index.ts         # CLI entry point

Contributing

This project is designed for team collaboration with familiar JavaScript/TypeScript patterns:

  1. Fork and Clone: Standard GitHub workflow
  2. Install Dependencies: npm install
  3. Build: npm run build
  4. Make Changes: Follow existing patterns
  5. Test: Manually (Use it in your ddev project)
  6. Submit PR: With clear description

Coding Standards

  • TypeScript strict mode enabled
  • ESLint configuration for consistency
  • Comprehensive error handling
  • Unit tests for new features
  • Documentation updates

🙏 Acknowledgments


External Resources

Ready to supercharge your DDEV development workflow with AI assistance for any web project! 🚀

Installazione

TypingMind
{
  "mcpServers": {
    "ddev-mcp": {
      "command": "npx",
      "args": [
        "ddev-mcp"
      ]
    }
  }
}

Strumenti disponibili

  • ddev_start

    Start a DDEV project environment

  • ddev_stop

    Stop a DDEV project environment

  • ddev_restart

    Restart a DDEV project environment

  • ddev_status

    Get the status of a DDEV project. Same as ddev describe.

  • ddev_describe

    Get detailed information about a DDEV project. Same as ddev status.

  • ddev_list

    List all DDEV projects with their status and information

  • ddev_import_db

    Import a database into DDEV project

  • ddev_export_db

    Export database from DDEV project

  • ddev_drush

    Execute Drush commands in DDEV environment

  • ddev_composer

    Execute Composer commands in DDEV environment

  • ddev_logs

    Get logs from DDEV services

  • ddev_ssh

    Get SSH connection info and container details (AI-friendly)

  • ddev_config

    Show DDEV project configuration or modify it (AI-friendly, non-interactive)

  • ddev_delete

    Remove all project information for an existing project (DESTRUCTIVE - use with caution)

  • ddev_clean

    Remove items DDEV has created (containers, images, volumes)

  • ddev_snapshot

    Create, list, or restore database snapshots

  • ddev_import_files

    Import files directory or archive to DDEV project

  • ddev_debug

    Run DDEV debugging and diagnostic commands

  • ddev_exec

    Execute any command in a DDEV service container (a flexible tool for any operation). Use this when other tools are not sufficient. Dangerous commands blocked unless ALLOW_DANGEROUS_COMMANDS=true.

  • ddev_help

    Get help information for DDEV commands and discover available operations

  • ddev_share

    Share project on the internet via ngrok

  • ddev_hostname

    Manage hostfile entries for DDEV projects

  • ddev_poweroff

    Stop all DDEV projects and containers

  • ddev_version

    Get DDEV version and component information

  • ddev_go_to_project_directory

    Navigate to a DDEV project directory and verify it contains a valid DDEV configuration

  • ddev_redis_cli

    Execute Redis CLI commands (non-interactive, returns output)

  • ddev_redis_info

    Get Redis server information and statistics

  • ddev_solr

    Execute native DDEV Solr commands

  • ddev_solr_zk

    Execute DDEV Solr ZooKeeper commands

  • ddev_mysql

    Execute MySQL/MariaDB commands in database container

  • ddev_platform

    Execute Platform.sh CLI commands in web container (Dangerous commands blocked unless ALLOW_DANGEROUS_COMMANDS=true)

  • ddev_playwright

    Execute Playwright commands for browser testing (AI-friendly, non-interactive)

  • ddev_playwright_install

    Install Playwright browsers and dependencies

  • ddev_wp_cli

    Execute WP-CLI commands in DDEV WordPress environment

  • ddev_wp_site_info

    Get WordPress site information and version details

  • ddev_wp_plugin_install

    Install WordPress plugins via WP-CLI

  • ddev_wp_plugin_toggle

    Activate or deactivate WordPress plugins

  • ddev_wp_plugin_list

    List WordPress plugins with their status

  • ddev_wp_theme_install

    Install WordPress themes via WP-CLI

  • ddev_wp_theme_activate

    Activate a WordPress theme

  • ddev_wp_core_update

    Update WordPress core to latest or specific version

  • ddev_wp_rewrite_flush

    Flush WordPress rewrite rules

  • ddev_wp_search_replace

    WordPress database search and replace (useful for URL changes)

  • ddev_wp_plugin_manage

    Comprehensive WordPress plugin management

  • ddev_wp_theme_manage

    Comprehensive WordPress theme management

  • ddev_wp_user_manage

    WordPress user management operations

  • ddev_wp_maintenance

    WordPress maintenance and cache operations

  • message_complete_notification

    Send a simple OS notification to the user

Usa MCP DDEV MCP con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso DDEV MCP, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi DDEV MCP come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di DDEV MCP.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "ddev-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ddev-mcp"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di DDEV MCP, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di DDEV MCP.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare DDEV MCP per aiutarmi con questa attività?
DDEV MCP
Certo. Ho letto.
Ecco cosa ho trovato con DDEV MCP.

Domande frequenti

A cosa serve il server MCP DDEV MCP?

DDEV MCP è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare DDEV MCP MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare DDEV MCP con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP DDEV MCP con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando DDEV MCP, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego DDEV MCP MCP a TypingMind?

DDEV MCP funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre DDEV MCP MCP in TypingMind?

DDEV MCP mette a disposizione 48 strumenti MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare DDEV MCP MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se DDEV MCP richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇