Skip to content

v0.6.0

Latest

Choose a tag to compare

@introfini introfini released this 12 Oct 14:05

drush-mcp v0.6.0

The bridge now asks Drupal whether the acting account may do what the agent asks, and each site can expose only part of the tools. Upgrade the npm package and the Composer bridge together: Composer's ^0.5 does not reach 0.6, so bump the constraint to ^0.6.

Added

  • Tool profiles. tools: { profile, allow, deny } per site or under defaults, and --profile on the command line. read-only and content expose only the bridge commands, which go through Drupal's access checks, plus drupal_status and drupal_field_info; full exposes all 19. On the restricted profiles the server refuses a bridge without access checks (bridge_too_old).
  • run_as, per site, under defaults or --run-as: the account bridge commands act as when the agent names none. On read-only and content the agent may not name any other account.
  • Audit log. One JSON line per tool call in ~/.drush-mcp/audit.jsonl, with secrets redacted and file bytes reduced to a hash.

Changed defaults

  • The bridge acts as anonymous when no account is named, where it acted as uid 1. Calls that relied on the admin fallback now answer access_denied. Keep the old behaviour with run_as: 1; better, name the account the agent should have.
  • Bridge commands apply Drupal's access checks for the acting account: create, view and update access on the entity, view access on each field returned, edit access on every field whose value changes, and update access on the entity a file is attached to. drupal_entity_list drops entities the account may not view and refuses filters and sorts on fields it may not view.
  • fields may not carry entity keys or names that are not fields, so a create can no longer name an existing id and save over that entity.
  • Entity tools always send --user, 0 for anonymous, so a 0.5 bridge behind a 0.6 server no longer falls back to uid 1.
  • drupal_status no longer returns db-username and db-password.
  • No upload may land under styles/, css/, js/ or php/.
  • The audit log is on. Turn it off with defaults.audit_log: false.
  • The file commands take --user, the acting account, apart from --uid, the owner.

Fixes

  • Creating a group_relationship (or Group 1's group_content) checks access against the group in gid, as Group's own routes do. Any PHP Error in a bridge command now comes back as JSON instead of a bare Drush failure.
  • drupal_config_get, drupal_config_set, drupal_user_create, drupal_user_block and drupal_entity_delete refuse a positional value starting with -, which Drush read as an option.

Details, and how to get each previous behaviour back, in CHANGELOG.md.

Install

npm install -g @bloomidea/drush-mcp@0.6.0
composer require bloomidea/drush-mcp-bridge:^0.6