Логотип DDEV MCP

DDEV MCP

Сообщество
codingsasi

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

Издательcodingsasi
Репозиторийddev-mcp
ЯзыкTypeScript
Форки
1
Звёзды
13
Доступные инструменты
48
Тип транспортаstdio
Категории
ЛицензияGPL-2.0
Ссылки
  • Подключайте инструменты к рабочим процессам с ИИ

    DDEV MCP предоставляет возможности MCP, доступные совместимым ИИ-клиентам и агентам.

  • Доступные инструменты: 48

    Ниже представлены доступные для вызова действия с названиями и описаниями, если сервер их предоставляет.

  • Готовая конфигурация для копирования

    Используйте примеры конфигурации, чтобы настроить этот сервер в предпочитаемом MCP-клиенте.

  • Показатели интереса к открытому проекту

    Звёзды: 13, форки: 1 — в связанном репозитории.

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! 🚀

Установка

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

Доступные инструменты

  • 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

Используйте MCP DDEV MCP с разными ИИ-моделями

TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому после подключения DDEV MCP вы можете использовать их с разными моделями ИИ в TypingMind, не настраивая подключение отдельно для каждой модели. Эта интеграция MCP работает локально на вашем устройстве через коннектор MCP TypingMind.

Руководство по настройке локального коннектора

Выберите этот способ, если серверу MCP нужен доступ к локальным файлам, приложениям или закрытым ресурсам на вашем компьютере.

1

Откройте настройки MCP

В TypingMind откройте «Настройки», затем «Расширенные настройки», перейдите в раздел «Протокол контекста модели» и выберите «Настроить коннектор».

  1. Откройте TypingMind в браузере.
  2. Нажмите значок настроек.
  3. Перейдите в «Расширенные настройки».
  4. Откройте раздел «Протокол контекста модели».
  5. Нажмите «Настроить коннектор» и выберите «Это устройство».
Экран настройки коннектора MCP в TypingMind с выбранным вариантом «Это устройство»
2

Выполните команду коннектора

Выберите «Это устройство», скопируйте команду из TypingMind и выполните её в терминале. Не останавливайте процесс, пока используете MCP.

  1. Скопируйте команду настройки, показанную в TypingMind.
  2. Откройте «Терминал» в macOS или Windows Terminal в Windows.
  3. Вставьте и выполните команду.
  4. Подтвердите установку пакета, если терминал запросит разрешение продолжить.
  5. Не закрывайте окно терминала и не останавливайте процесс, пока используете инструменты MCP.
3

Добавьте DDEV MCP как сервер

Когда статус коннектора сменится на «Готов», нажмите «Изменить серверы» и вставьте конфигурацию сервера MCP.

  1. Дождитесь, пока статус коннектора сменится на «Готов».
  2. Нажмите «Изменить серверы».
  3. Вставьте конфигурацию сервера MCP для DDEV MCP.
  4. Сохраните список серверов.
  5. Обновите статус, если хотите убедиться, что коннектор по-прежнему готов к работе.
Настройки MCP в TypingMind с активным сервером и кнопкой «Изменить серверы»
{
  "mcpServers": {
    "ddev-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ddev-mcp"
      ]
    }
  }
}
4

Используйте подключение с разными моделями

Сохраните список серверов, откройте раздел «Плагины», включите инструменты MCP для DDEV MCP, затем выберите любую поддерживаемую модель ИИ в TypingMind и используйте инструменты в чате или назначьте их ИИ-агенту.

  1. Откройте страницу «Плагины» в TypingMind.
  2. Включите инструменты MCP для DDEV MCP.
  3. Начните чат и выберите модель ИИ, которую хотите использовать.
  4. Используйте инструменты MCP в чате или назначьте их ИИ-агенту.
  5. При необходимости переключайтесь на другую модель ИИ без повторного подключения MCP.
Чат TypingMind с включёнными инструментами MCP и выбранной ИИ-моделью
Можете помочь мне с этой задачей с помощью DDEV MCP?
DDEV MCP
Конечно. Я всё прочитал.
Вот что я нашёл с помощью DDEV MCP.

Часто задаваемые вопросы

Для чего используется сервер MCP DDEV MCP?

DDEV MCP — это сервер MCP, который позволяет совместимым ИИ-клиентам подключаться к внешним инструментам и получать контекст. В TypingMind достаточно один раз добавить этот сервер MCP, чтобы его инструменты стали доступны в вашем рабочем пространстве с ИИ.

Можно ли использовать сервер MCP DDEV MCP с несколькими ИИ-моделями в TypingMind?

Да. TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому вы можете использовать DDEV MCP с разными ИИ-моделями, например Claude, ChatGPT, Gemini или другими моделями, настроенными в TypingMind, без отдельной настройки сервера MCP для каждой модели.

Зачем использовать MCP DDEV MCP с TypingMind?

TypingMind — один из лучших интерфейсов для чата с LLM: он объединяет разные ИИ-модели, промпты, плагины, ИИ-агентов, ключи API и инструменты MCP в одном рабочем пространстве. Подключив DDEV MCP, вы сможете использовать его инструменты MCP с предпочитаемыми моделями, сохраняя удобную организацию работы с чатами в TypingMind.

Как подключить сервер MCP DDEV MCP к TypingMind?

DDEV MCP работает через локальный коннектор MCP TypingMind. Этот вариант лучше всего подходит, когда серверу MCP нужен доступ к локальным файлам, настольным приложениям, инструментам командной строки или закрытым ресурсам на вашем компьютере.

Какие инструменты предоставляет сервер MCP DDEV MCP в TypingMind?

DDEV MCP предоставляет инструменты MCP (48), которые можно включить на странице «Плагины» в TypingMind и использовать в чате или назначить ИИ-агентам.

Нужно ли передавать TypingMind свои ключи API для использования сервера MCP DDEV MCP?

Нет. TypingMind ориентирован прежде всего на локальную работу и позволяет вам контролировать выбор провайдеров моделей, ключи API, промпты и конфигурацию MCP. Если DDEV MCP требует аутентификации, при создании подключения добавьте необходимые заголовки, настройки OAuth или локальную конфигурацию для этого сервера MCP.

Похожие серверы MCP

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇