Repository navigation
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 underdefaults, and--profileon the command line.read-onlyandcontentexpose only the bridge commands, which go through Drupal's access checks, plusdrupal_statusanddrupal_field_info;fullexposes all 19. On the restricted profiles the server refuses a bridge without access checks (bridge_too_old). run_as, per site, underdefaultsor--run-as: the account bridge commands act as when the agent names none. Onread-onlyandcontentthe 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 withrun_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_listdrops entities the account may not view and refuses filters and sorts on fields it may not view. fieldsmay 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,0for anonymous, so a 0.5 bridge behind a 0.6 server no longer falls back to uid 1. drupal_statusno longer returnsdb-usernameanddb-password.- No upload may land under
styles/,css/,js/orphp/. - 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'sgroup_content) checks access against the group ingid, as Group's own routes do. Any PHPErrorin 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_blockanddrupal_entity_deleterefuse 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