Skip to content

MCP tools for Drive and WorkDrive connector grants #15

Closed

Description

@serge-ivo

Summary

Add MCP tools so an authenticated user/agent can inspect and manage per-instance Google Drive and Zoho WorkDrive folder grants without using the console UI.

Why

Connector sync triggers can now be created over MCP, but sync_connector requires a grantId. Today that grant id is only discoverable/configurable from the console or direct REST calls. This leaves the account-level connection + per-agent grant model incomplete for MCP-first operation.

Scope

  • Add read tools for connector status:
    • drive_status
    • workdrive_status
  • Add per-instance grant tools:
    • list_instance_connector_grants
    • grant_instance_connector_folder
    • delete_instance_connector_grant
  • Support providers: google_drive, zoho_workdrive.
  • Use existing API routes and server-side grant validation.
  • Respect MCP scopes:
    • list/status: read
    • grant folder: write
    • delete grant: destructive with exact confirm.
  • Add audit entries for mutations and dry runs.
  • Update MCP landing text/docs/tool count.

Acceptance Criteria

  • A user can list Drive and WorkDrive connection status through MCP.
  • A user can list grants for an instance through MCP and receive grant ids, resource names, provider, type, and URLs where present.
  • A user can grant a Drive/WorkDrive folder by URL or resource id through MCP.
  • A user can delete a connector grant only with confirm: "delete_instance_connector_grant".
  • MCP read-only mode blocks grant creation/deletion.
  • Unit tests cover status/list/grant/delete happy path and permission failures.
  • Docs show the full MCP flow: connect account in console once -> grant folder -> create sync_connector trigger.

Activity

  1. serge-ivo commented on Aug 6, 2026

    @serge-ivo
    ContributorAuthor

    Shipped in 565d8cf, MCP worker deployed.

    Four tools, thin proxies over routes that already existed — all validation, folder-vs-file checking and token minting stay server-side:

    tool scope
    connector_status read
    list_instance_connector_grants read
    grant_instance_connector_folder write
    delete_instance_connector_grant destructive (exact confirm + dry-run)

    One provider enum instead of the eight drive_*/workdrive_* tools the ticket listed. The two connectors differ only in their API base, so splitting them would double the tool count and the drift for no gain. If you specifically want drive_status/workdrive_status as separate names, say so and I'll alias them.

    Two things worth noting:

    • The account CONNECTION still has to be made once in the console — it is an OAuth flow and cannot be anything else. Everything after it is now reachable over MCP, which was the actual gap.
    • connector_status reports configured separately from connected, so an operator can distinguish "this deployment has no OAuth client for Drive" from "you haven't connected yet". The first is not fixable by clicking.

    Grant listing doubles as an audit surface: an agent can only read a folder that appears in it, so the grant IS the permission.

    Tests cover registration, per-provider routing, the grant id being surfaced, missing-argument refusal without a network call, read-only blocking, exact-confirm on delete, and dry-run. 2849 green.

    Docs (the console → grant → sync_connector flow) not written — flagging rather than claiming it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions