Files
PaperClipAI/packages/shared/src/app-definitions/gmail.json
T
DottaandPaperclip 8c3b8c432a Simplify app connections and enable managed Google access (#12728)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The Apps subsystem gives humans and agents governed access to
external tools.
> - The current connection flow hides Apps behind an experimental gate
and repeats setup text.
> - Google sharing choices and generic MCP permissions do not use one
consistent opening model.
> - Self-hosted installs also need a safe default origin for managed
OAuth without a manual config file.
> - This pull request makes Apps available, simplifies connection setup,
and applies one governed permissions model.
> - The benefit is a shorter connection flow that works on a clean
self-hosted install.

## Linked Issues or Issue Description

**What existing behavior does this improve?**

This improves the Apps connection setup flow, managed Google connection
flow, generic MCP connection flow, navigation, and runtime origin
discovery.

**Subsystem affected**

Cross-cutting. This changes `ui/`, `server/`, `packages/shared/`,
connector documentation, and browser tests.

**Current behavior**

Apps require an experimental switch. Setup pages repeat titles and
explanatory copy. Connection names require manual input. Google
credential sharing does not always offer both personal and organization
access. Generic MCP providers do not start with the same permission
choices. Managed OAuth needs a public URL setting even when the request
already has a safe HTTPS origin.

**Proposed behavior**

Apps are available by default. Setup asks only for required permissions
and sharing choices. Paperclip creates conflict-free connection names.
Google apps and generic MCP providers use the same human and agent
access model. Managed OAuth derives a validated same-origin HTTPS URL
when no explicit public URL is set.

**Reason and benefit**

A clean self-hosted install can connect a managed Google app without
hidden setup. Humans can share a service account with their
organization. The shorter flow reduces duplicated choices and setup
errors.

**Breaking changes**

The Apps experimental switch is removed. Existing connection APIs remain
compatible. New connections can receive a numeric suffix when a name
already exists.

No duplicate or related public issue was found.

## What Changed

- Removed the Apps experimental gate and the breadcrumb that leaves the
Apps section.
- Simplified all connection setup pages and moved optional provider
requirements into one small link.
- Added consistent human and agent access choices for Google apps,
Zapier, and generic MCP connections.
- Added organization sharing to Google Workspace credentials while
keeping personal access available.
- Generated connection names automatically and resolved name conflicts
with numeric suffixes.
- Derived a validated public HTTPS origin from the request for
config-free managed OAuth.
- Updated connector contracts, tests, browser coverage, and authoring
documentation.

## Verification

- `pnpm check:token-gates`
- `pnpm -r typecheck`
- `pnpm build`
- `pnpm exec vitest run server/src/__tests__/tool-access-service.test.ts
server/src/__tests__/generic-mcp-connection.test.ts` (273 passed)
- Targeted UI/service regression suite (308 passed)
- Six targeted Playwright connection journeys on a fresh onboarding
instance (6 passed)
- Fresh-install browser proof through Tailscale HTTPS: enrolled with
Paperclip Cloud, connected managed Google Drive, and completed a real
read operation.
- [Exact-head CI
run](https://github.com/paperclipai/paperclip/actions/runs/33669760711):
all 23 matrix jobs passed, including build, typecheck, server,
serialized, canary, and all browser shards.
- Greptile 5/5 on `0ae2a859f269984ee950d0af231a5b09a06f3dfd`, with no
unresolved review threads.

## Risks

Apps are now visible to all operators. The removed experimental flag no
longer hides unfinished app definitions. Managed Google availability
still depends on the Cloud profile rollout and active instance
enrollment. Automatic conflict handling changes only the display name of
a newly conflicting connection.

> I checked [`ROADMAP.md`](ROADMAP.md). MCP Tool Gateway and Apps are
shipped. Connected Apps is planned, and this change improves the
existing shipped connection flow.

## Model Used

OpenAI Codex, GPT-5, with reasoning, browser control, tool use, and code
execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-09-02 14:05:53 -05:00

183 lines
6.6 KiB
JSON

{
"schemaVersion": 1,
"slug": "gmail",
"name": "Gmail",
"description": "Search and read Gmail messages and create drafts without enabling mail sending.",
"categories": [
"communication",
"productivity"
],
"featured": true,
"branding": {
"logoUrl": "/brands/apps/gmail.svg"
},
"urlPatterns": [
"https://gmailmcp.googleapis.com/*"
],
"docsUrl": "https://developers.google.com/workspace/gmail/api/reference/mcp",
"setupPrerequisite": {
"title": "Google Developer Preview access required",
"description": "Google must register both the Workspace email used to authorize Paperclip and the Google Cloud project that owns the OAuth client. Registration is limited to those emails and projects; it does not enable unrelated Paperclip customers.",
"steps": [
"Apply with the Workspace email that will sign in and the Google Cloud project that owns the OAuth client.",
"Wait for the Google Group notification and then Google's final project-registration email, usually within a couple of days.",
"Add every additional tester email or Cloud project through Google's member request forms before connecting."
],
"actionLabel": "Apply or verify Developer Preview enrollment",
"actionUrl": "https://developers.google.com/workspace/preview"
},
"redirectConstraints": "https-or-loopback-http",
"methods": [
{
"key": "paperclip-read",
"label": "Connect with Paperclip",
"transport": "mcp_remote",
"auth": "oauth",
"oauthStrategy": "paperclip_cloud_connector",
"connectorProfile": "gmail.read",
"capabilityProfile": {
"key": "read",
"label": "Read only",
"description": "Search and read messages, threads, drafts, and labels."
},
"grantKinds": [
"user",
"organization"
],
"ownershipModes": [
"platform_shared"
],
"whenToUse": "Use Paperclip-managed Google OAuth for read-only Gmail access.",
"defaults": {
"serverUrl": "https://gmailmcp.googleapis.com/mcp/v1",
"scopesHint": [
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"guidanceMd": "Connect Gmail with read-only access. Sending, deleting, moving, and relabeling mail are not enabled.",
"warnings": [
"Google Workspace MCP servers are in Developer Preview."
],
"riskTier": "S3"
},
{
"key": "customer-read-oauth",
"label": "Use your own Google OAuth app",
"transport": "mcp_remote",
"auth": "oauth",
"capabilityProfile": {
"key": "read",
"label": "Read only",
"description": "Search and read messages, threads, drafts, and labels."
},
"grantKinds": [
"user",
"organization"
],
"ownershipModes": [
"customer"
],
"whenToUse": "Use a customer-owned Google OAuth client for read-only Gmail access.",
"defaults": {
"serverUrl": "https://gmailmcp.googleapis.com/mcp/v1",
"authorizationEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
"tokenEndpoint": "https://oauth2.googleapis.com/token",
"metadataUrl": "https://accounts.google.com/.well-known/openid-configuration",
"scopesHint": [
"https://www.googleapis.com/auth/gmail.readonly"
],
"oauthAuthorizationParams": {
"access_type": "offline",
"prompt": "consent"
}
},
"guidanceMd": "Enable the Gmail and Gmail MCP APIs in your Google Cloud project, then register Paperclip's callback URI.",
"consoleLinks": {
"register": "https://console.cloud.google.com/auth/clients",
"docs": "https://developers.google.com/workspace/guides/configure-mcp-servers"
},
"warnings": [
"Google Workspace MCP servers are in Developer Preview."
],
"riskTier": "S3"
},
{
"key": "paperclip-draft",
"label": "Connect with Paperclip",
"transport": "mcp_remote",
"auth": "oauth",
"oauthStrategy": "paperclip_cloud_connector",
"connectorProfile": "gmail.draft",
"capabilityProfile": {
"key": "draft",
"label": "Read & create drafts",
"description": "Read Gmail and create drafts for review in Gmail."
},
"grantKinds": [
"user",
"organization"
],
"ownershipModes": [
"platform_shared"
],
"whenToUse": "Use Paperclip-managed Google OAuth to read Gmail and create drafts.",
"defaults": {
"serverUrl": "https://gmailmcp.googleapis.com/mcp/v1",
"scopesHint": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.compose"
]
},
"guidanceMd": "Connect Gmail to search and read mail and create drafts. Sending mail is permanently disabled.",
"warnings": [
"Draft creation requires approval. Sending mail is not enabled.",
"Google Workspace MCP servers are in Developer Preview."
],
"riskTier": "S4"
},
{
"key": "customer-draft-oauth",
"label": "Use your own Google OAuth app",
"transport": "mcp_remote",
"auth": "oauth",
"capabilityProfile": {
"key": "draft",
"label": "Read & create drafts",
"description": "Read Gmail and create drafts for review in Gmail."
},
"grantKinds": [
"user",
"organization"
],
"ownershipModes": [
"customer"
],
"whenToUse": "Use a customer-owned Google OAuth client to read Gmail and create drafts.",
"defaults": {
"serverUrl": "https://gmailmcp.googleapis.com/mcp/v1",
"authorizationEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
"tokenEndpoint": "https://oauth2.googleapis.com/token",
"metadataUrl": "https://accounts.google.com/.well-known/openid-configuration",
"scopesHint": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.compose"
],
"oauthAuthorizationParams": {
"access_type": "offline",
"prompt": "consent"
}
},
"guidanceMd": "Enable the Gmail and Gmail MCP APIs in your Google Cloud project, then register Paperclip's callback URI.",
"consoleLinks": {
"register": "https://console.cloud.google.com/auth/clients",
"docs": "https://developers.google.com/workspace/guides/configure-mcp-servers"
},
"warnings": [
"Draft creation requires approval. Sending mail is not enabled.",
"Google Workspace MCP servers are in Developer Preview."
],
"riskTier": "S4"
}
]
}