-
Notifications
You must be signed in to change notification settings - Fork 657
feat(mcp): config-driven capability policy (per-account, default-upstream) #913
Copy link
Copy link
Closed
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Description
Metadata
Metadata
Assignees
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Type
Fields
Priority
None yet
Summary
Add an optional, declarative MCP capability policy to
config.jsonso operators can pin which MCP tools are exposed — globally and per account — without assembling long--allow-tool/--enable-commands-exactargument strings in every client config.The default (no config) is unchanged: read-only, exactly like today. This is a governance/ergonomics layer for operators who run
gog mcpacross several accounts, not a way to widen the tool surface.Motivation
gog mcpalready has excellent runtime controls (--allow-tool,--allow-write,--enable-commands-exact,--disable-commands,--gmail-no-send,--readonly) plus baked safety profiles. In practice, two gaps remain for operators wiring MCP into clients like Claude Desktop:mcpServersentries. The CLI has no per-account MCP policy, even though the config layer already models per-account safety for sending (gmail_no_send+no_send_accountsininternal/config/config.go).--allow-tool read,tool_a,tool_b,...argv that's easy to get wrong and invisible to review.This proposal reuses the existing
gmail_no_send/no_send_accountsidiom — a global default plus a per-account override map — and extends it to MCP tool exposure.Prior art / concerns this tries to respect
--enable-commandslacks sub-command granularity for agent/MCP): the risk of an agent reachinggmail send/filters create --forwardwhen granted a top-level command. This proposal only ever narrows exposure and defaults to read-only, so it can't widen that surface.--allow-*gates. Explicit non-goal: nogog_exec/ generic command bridge.Proposed shape
A new optional
mcpblock inconfig.json(JSON5, so comments are fine):Resolution precedence (most specific wins), so nothing surprising:
Baked safety profiles remain the tamper-proof ceiling and are unaffected (still checked before any handler).
Non-goals
mcpblock == today).Alternatives considered
config.jsonalready owns account-scoped policy (no_send_accounts), so extending it is the smaller, more idiomatic change.Willing to implement
Happy to send a PR (config struct + resolver +
gog mcpwiring + docs + tests) if the shape looks acceptable. Wanted to align on the design and confirm it's welcome before writing it, given this touches the MCP capability surface. Open to a narrower cut (e.g. per-accountprofileonly, dropping thetools/profilesmaps) if you'd prefer to start minimal.