mcp-drupal-database-server

mcp-drupal-database-server

3.2

If you are the rightful owner of mcp-drupal-database-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.

This project implements a Model Context Protocol (MCP) server that allows AI models and other MCP-compatible clients to interact with a Drupal database.

The MCP Drupal Database Server is a specialized server application designed to facilitate interaction between AI models and Drupal databases using the Model Context Protocol (MCP). It parses Drupal's `settings.php` file to extract database credentials and connects to either MySQL or PostgreSQL databases. The server is built to perform read-only operations, ensuring data safety while providing tools to list tables, retrieve table schemas, and execute SQL queries. It is asynchronous, leveraging Python's `asyncio` for efficient request handling. The server is primarily intended for local development environments or secure private networks, and it integrates seamlessly with MCP clients like Windsurf or Claude for Desktop, using `stdio` transport for communication.

Features

  • Drupal `settings.php` Parsing: Automatically extracts database connection details.
  • Multi-Database Support: Works with both MySQL and PostgreSQL Drupal installations.
  • MCP Compliant: Uses the official `model-context-protocol` Python SDK.
  • Read-Only Operations: Designed for safe data retrieval with a focus on read-only SQL execution.
  • Asynchronous: Built with `asyncio` for efficient handling of requests.

Tools

  1. drupal_database_query

    Interact with a Drupal database. Can list tables, get table schema, and execute read-only SQL queries.

  2. drupal_list_content_types

    Lists all available Drupal content types (node types).

  3. drupal_get_node_by_id

    Fetches detailed information for a specific Drupal node by its ID.

  4. drupal_list_vocabularies

    Lists all taxonomy vocabularies in Drupal.

  5. drupal_get_taxonomy_term_by_id

    Fetches detailed information for a specific taxonomy term by its ID.

  6. drupal_get_user_by_id

    Fetches detailed information for a specific Drupal user by their ID.

  7. drupal_list_paragraphs_by_node_id

    Lists paragraph items referenced by a specific node through a given paragraph field.