merge: integrate current master with provider setup qualification

Preserve provider-connection and public MCP suites together, including their independent fixture documentation and matrix expectations.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-06 12:17:53 -05:00
commit e2891ef538
132 files changed
+9496 -50850

No files matched your search

+32
View File
@@ -247,6 +247,38 @@ public identity, and the existing unique singleton-key index makes concurrent
or later attempts to replace it fail closed. The server loads the row before
constructing URL-dependent runtime services on every boot.
### Unclaimed Cloud warm standby
`PAPERCLIP_CLOUD_WARM_STANDBY=1` is an opt-in control-plane marker for an
unclaimed warm application. It requires Cloud configuration, a stack identity,
and runtime identity verification keys. After restoring the durable identity,
startup checks once for company data. Existing companies or a persisted claim
keep the application fully active. A failed database check fails startup.
An empty unclaimed application keeps its HTTP server and sandbox plugins ready,
but skips recurring database work: chat/email delivery, plugin jobs, browser
cleanup, feedback export, import cleanup, execution reconciliation, heartbeat
schedules, and automatic backups. Startup migrations, plugin installation, and
other one-time preparation still run. Normal anonymous health probes return
`warmStandby: true` without SQL or session lookups. This is application liveness,
not a current database connectivity check. Other API requests and WebSocket upgrades return 503 until
the signed claim succeeds. Page and asset requests serve only the static UI
router, bypassing session, bearer-key, tenant, and other dynamic handlers.
The existing signed claim on `GET /api/health` writes the identity durably before
normal requests and polling resume. No polling discovers claims and no process
restart is required. Timers resume on their next normal tick; request-driven
work can proceed immediately. Claim failure leaves standby intact. A restart
restores the claim even if provider environment alignment has not completed.
Deleting a claimed workspace's last company never puts it back into standby.
Deploy support before enabling the marker. Validate idle database transactions
and health probes, claim/bootstrap latency, recurring work after claim, and a
restart with stale provider variables on an isolated warm application first.
Rollback by setting the marker to `0` and restarting. No schema changes are
required. This mechanism does not sleep claimed workspaces or replace a durable
scheduler for their background work.
## Resource membership tables
Paperclip stores current-user sidebar membership state in:
+4
View File
@@ -197,6 +197,10 @@ the task shows **Model unavailable**, the provider's account restriction, and
guidance to choose a supported model or clear the task's model override before
retrying. The run retains this reason even when the runner saves a generic
failure result.
When a committed Codex terminal reports `serverOverloaded`, the task displays
the model capacity error and **Model at capacity** on its scheduled retry card.
Automatic retries wait one and two minutes, then stop. Use
**Tasks → Model capacity retry** in Storybook to inspect the waiting state.
Claude Code uses model-specific effort levels; Haiku has no effort slider.
Grok uses its adapter's reasoning levels, including for its default model.
Kimi shows effort only when its agent uses the CLI engine, including with its
+22
View File
@@ -1915,6 +1915,18 @@ unavailable. Preserve current ownership and newer-work fences. See
- GitHub.com, manual refresh only. No upstream editing, polling, webhook sync, commits,
or pull-request creation in this milestone.
## Public assistant connection (opt-in)
The user-authorized MCP surface connects assistants to an explicitly selected
company as the consenting person. It exposes first-party task reads, additive
task creation and comments, durable documents and approval links. It reuses
existing domain authorization and scheduling; OAuth does not grant agent
identity, native run ownership, approval decisions or third-party credentials.
See [Public MCP](public-mcp.md) for the implemented instance-side boundary,
configuration, plugin packages and outstanding hosted release gates. The
[delivery plan](plans/2026-09-30-paperclip-public-mcp-and-plugins.md) separates
external agent participation and granted third-party tools into later releases.
### Experimental AI connection routing
Opt-in plugin routers may represent a pool as an AI runtime binding. Core keeps
@@ -1934,3 +1946,13 @@ per-turn snapshot participates in session compatibility, so subsequent turns
remove stale instructions after edits or access revocation. See
[Connection instructions](connections/CONNECTION-INSTRUCTIONS.md) for contracts,
UI conventions, custom adapter integration, and initial memory templates.
### Native provider capacity retry
Committed, run-bound Codex `serverOverloaded` terminal failures display the model
capacity error directly and schedule at most two automatic retries, after one
and two minutes. Retries share the execution failure budget, retain task history,
and honor current ownership, review, governance, pause, dependency, budget, and
cleanup gates. Restart or duplicate finalization must not create another
successor. Permanent model/auth incompatibility and usage-limit exhaustion retain
their existing operator recovery requirements.
+12
View File
@@ -687,6 +687,18 @@ upstream skills require reviewed selection; removed or deselected skills remain
installed. Editing starts with an independent copy. Write-back and PR publication
are a later milestone; exact path and commit provenance provide their base.
## Public assistant connection (opt-in)
The user-authorized MCP surface connects assistants to an explicitly selected
company as the consenting person. It exposes first-party task reads, additive
task creation and comments, durable documents and approval links. It reuses
existing domain authorization and scheduling; OAuth does not grant agent
identity, native run ownership, approval decisions or third-party credentials.
See [Public MCP](public-mcp.md) for the implemented instance-side boundary,
configuration, plugin packages and outstanding hosted release gates. The
[delivery plan](plans/2026-09-30-paperclip-public-mcp-and-plugins.md) separates
external agent participation and granted third-party tools into later releases.
### Experimental connection routing
A virtual AI connection can rotate new task/agent allocations through an
@@ -21,7 +21,7 @@ The PRP identity binds company, issue, agent, run, environment lease, runner ins
- Allow the sandbox outbound access only to destinations explicitly required by the provider runtime.
- Use Daytona's `wss://` preview URL with normal certificate and hostname validation. The preview token is sent only as the `X-Daytona-Preview-Token` header by Paperclip.
- Runnerd rejects public plaintext `ws://` destinations. Public dial targets require `wss://` with hostname validation and either the platform trust store or an explicitly staged private CA bundle.
- Listener mode binds only `0.0.0.0:43127`, accepts only the run-specific `/api/runner/v1/connect/:runId` path, and rejects WebSocket extension negotiation. PRP authentication and application-layer secure frames remain mandatory above the preview-proxy hop.
- Listener mode binds only `0.0.0.0`. The optional `--listen-port` selects a port in `1..=65535` and defaults to `43127`. The listener accepts only the run-specific `/api/runner/v1/connect/:runId` path and rejects WebSocket extension negotiation. PRP authentication and application-layer secure frames remain mandatory above the preview-proxy hop.
- Do not put the bootstrap ticket in argv, files, provider environment, logs, or model context. Inject it into runnerd's initial environment/secret channel; runnerd already removes it from its environment immediately.
- Runnerd is the only process allowed to reach PRP. The provider communicates with runnerd over inherited pipes.
+1 -1
View File
@@ -543,7 +543,7 @@ credentials belong to the connection; the model belongs to the agent.
| Hermes local | OpenRouter; custom/local Chat Completions |
| Gemini CLI, Grok | Their native API connections; custom routes are not advertised |
Migration `0301` adds Google to both account-default provider constraints. Local
Migration `0303` adds Google to both account-default provider constraints. Local
Gemini connections seed the API-key auth choice in their disposable home before
environment probes and task execution. The settings file contains no credential.
+7
View File
@@ -133,6 +133,13 @@ permission, and requester scope decisions through saved browser interactions.
## Validation ladder
The explicit-only [public MCP suite](../tests/runner-e2e/PUBLIC-MCP.md) evaluates
paid assistant delegation, later retrieval, feedback, review, uncertain retries
and permission boundaries. It uses the Product E2E fixtures, launcher, evidence
packaging and dashboard, with separate external-assistant and team-worker billing.
The [2026-10-01 results](plans/2026-10-01-public-mcp-paid-eval-results.md) retain
two complete model matrices, provenance, costs and the earlier failure history.
Start with credential-free checks and a catalog listing. For Product E2E:
```sh
+22
View File
@@ -469,6 +469,28 @@ Warm sandbox reuse must match the current host Git tip and branch as well as the
file snapshot and saved stamp, including managed nested repositories. A history
or branch mismatch restages the host before the next run begins.
### Native provider model capacity
A committed Codex `turn.failed` event with `codexErrorInfo: serverOverloaded`,
bound to the failed terminal turn and pinned execution identity, surfaces
“Selected model is at capacity. Please try a different model.” directly.
Paperclip preserves the accepted result and task history, then atomically records
a durable automatic retry with its status decision. The first retry waits one
minute; the second waits two minutes. Both spend the existing failure-retry
budget. Exhaustion requires an explicit retry or a model change.
Retries use a fresh provider session and the normal task context, without an
automatic model switch. Consumed wake input and continuation receipts stay on
the failed run; `retryOfRunId` supplies task history without lending the new run
its predecessor's resume authority. Finalization replay and restart reuse the
same successor.
Scheduling preserves pending review authority and respects task holds; promotion,
claim, and dispatch recheck ownership, dependencies, governance, pause, budget,
and execution locks. Claim also waits for the predecessor's provider execution,
workspace finalization, and environment cleanup to settle. Model incompatibility,
usage-limit exhaustion, unknown failures, and unbound diagnostic text do not
qualify as capacity failures.
### Workspace scan failures before provider startup
Repository discovery distinguishes an ordinary folder from a failed Git read.
@@ -0,0 +1,383 @@
# Paperclip as the persistent team behind your assistant
Date: 2026-09-30
Status: First-release implementation in review; local paid acceptance verified across three models; deployment and hosted/store acceptance remain release gates
## 1. The thesis
**Paperclip should make a team's identity, tools, work, and governance available wherever someone uses an assistant.**
Codex or Claude can be where someone thinks and works. Paperclip supplies the persistent organization: who owns a task, which tools they can use, what happened, what needs approval, and what continues after the conversation ends.
| Layer | Responsibility |
| --- | --- |
| Paperclip core | Companies, agents, tasks, documents, execution, budgets, approvals |
| Capability and authorization layer | What this caller may do, under which identity and task context |
| MCP endpoint / gateway | Exposes those capabilities to outside clients |
| Plugin | Packages the connection with instructions for using Paperclip effectively |
| Team template | Creates a useful starting organization inside Paperclip |
| Store listing | Helps people discover and install the plugin |
A plugin brings someone into Paperclip and teaches their assistant how to work with it. The durable team and its authority remain in Paperclip. The first product is one Paperclip plugin that lets a person use their team, with hosted onboarding for newcomers. Broader agent gateways follow on the same foundation.
## 2. Three experiences
| Experience | Example | Identity and execution |
| --- | --- | --- |
| Use Paperclip as me | Show what's blocked and add my feedback. | Connected person's permissions and attribution. |
| Delegate to my team | Have our researcher investigate competitors. | Person creates work; Paperclip agent executes through normal scheduling and governance. |
| Work as an agent | This Codex session will work as our engineer on this task. | Explicitly authorized external session acts as the named agent and claims the task. |
Distinguish these in the connection UI and audit history. Selecting an agent to receive work never silently switches the caller into that agent's identity. An agent gateway is an access point to the agent's authorized capabilities. Its URL identifies the gateway; a separate credential authorizes access. Copying the URL alone confers no authority.
For eventual agent mode:
- Bind authorization to company, agent, consenting person, client, and granted capabilities.
- Preserve the effective agent identity and the person who authorized the session.
- Require an atomic, time-limited task claim. Native and external execution cannot both own a task.
- Recheck authority at invocation, including revocation, pause, reassignment, and approval gates.
- Expose only tools granted for external use; keep upstream credentials inside Paperclip.
- Provide task context and relevant instructions explicitly. Connecting MCP does not transfer conversation history or reproduce agent behavior automatically.
Paperclip governs participation. It does not promise to launch or stop the external client, observe every local action, or measure spending the client does not report.
## 3. Shared core, two MCP surfaces
```mermaid
flowchart TD
A[ChatGPT / Codex / Claude] --> B[Public Paperclip plugin]
C[Direct or private connection] --> D[Agent gateway]
B --> E[OAuth identity and scoped authorization]
D --> E
E --> F[Shared Paperclip capability layer]
G[Native runner] --> F
F --> H[Tasks, documents, agents and governance]
F --> I[Authorized connected tools]
```
Reuse existing named gateways, scoped context, hashed revocable credentials, tool profiles, policies, and connected-tool routing. Inbound gateway OAuth is currently reserved and disabled. Existing Paperclip self-tools are read fixtures, not a complete external API. Richer runner operations currently require an active native run with task ownership.
Extract reusable operation definitions and domain handlers incrementally. Public user connections, native runs, and external agent sessions get explicit authorization contexts. Preserve native execution checks; do not fabricate native runs for outside callers.
### Public plugin surface
Individually expose bounded Paperclip operations to:
- Identify the connected account and authorized company.
- List agents and projects.
- Search/read tasks, history, and progress.
- Create tasks with an assignee and add comments.
- Read task documents and deliverables.
- Inspect pending approvals and link to the existing decision interface.
Disclose scheduling/wake effects of task creation and comments. Background work returns a durable task reference immediately; later calls retrieve progress and output. Company selection is explicit and validated on every call, never shared mutable conversation state.
### Agent gateway surface
Later expose the agent's permitted Paperclip operations and third-party tools through direct/private connections. Reuse gateway policies, credential handling, approval records, and audit infrastructure.
OpenAI requires individually exposed operations for review and disallows hidden operations through discovery plus generic execution; it also restricts plugins primarily functioning as unofficial third-party intermediaries. Do not publish `search_tools`/`run_tool` or `search_api`/`call_api` as the public plugin's general interface. Delegation to Paperclip agents remains clearly disclosed product behavior with normal permissions and approvals. Store acceptance is subject to review.
## 4. Distribution and first use
Use one shared MCP implementation and shared workflow content, with vendor-specific packaging:
| Ecosystem | Packaging |
| --- | --- |
| ChatGPT and Codex | One plugin containing skills and a remote MCP connection, through the shared directory; current submission permits one connected MCP server per plugin. |
| Claude | Submit the server as a connector and the workflows as a plugin; pair them using the same server URL. |
| Direct/private clients | Configure an instance or agent gateway directly; private plugins optionally supply instructions. |
Maintain shared content with separate package outputs: OpenAI portable `plugin.json` and Claude `.claude-plugin/plugin.json`. Bundle three workflows: review my team, delegate work, follow up on results. Skills teach the workflow; server authorization enforces limits. Essential functionality requires neither hooks nor embedded UI.
Onboarding:
1. Discover and install Paperclip.
2. Connect through browser sign-in.
3. Choose an existing hosted team or enter hosted setup.
4. New users define a mission, select a template, and configure execution and spending.
5. Return to the assistant and delegate a first task.
6. Inspect progress and retrieve a concrete result.
Cloud owns stack provisioning. Reuse its onboarding flow and report readiness; installation alone must not create companies or start paid agents. Configure execution credentials separately from the client's Paperclip connection.
Use a stable Paperclip-owned HTTPS public endpoint. Resolve hosted instance access from the authenticated account and authorized company. Do not accept arbitrary instance URLs as tool destinations. Self-hosted users connect directly to reachable instances first; managed relays are deferred.
Implement OAuth with PKCE, resource/audience validation, discovery metadata, refresh/revocation, and registration compatible with both ecosystems. Outbound connector OAuth and inbound authorization remain separate responsibilities.
## 5. Delivery sequence and acceptance
### First release: use my team
Build public user-authorized MCP tools, hosted connection flow, shared skills, and both vendor packages. Support additive work actions; defer approval decisions, destructive administration, and external agent execution.
Prove:
- Connect an existing company and obtain an accurate summary.
- Delegate work with exactly one durable task and scheduled execution.
- Add feedback with correct human attribution.
- Retrieve a completed document/deliverable from a later conversation.
- Create a hosted team through onboarding and return to a working connection.
Verify isolation, roles, expiry/revocation, concurrent conversations, retry behavior, unknown mutation outcomes, paused/unavailable agents, and actual ChatGPT/Codex and Claude interoperability in addition to protocol tests.
### Second release: participate as an agent
Add explicit delegation and external task claims. Verify native-run contention, lease expiry, reconnect, pause, reassignment, and stale-session rejection. Clearly display external execution and unavailable usage accounting.
### Third release: bring granted tools
Expose approved connected tools through the agent gateway. Verify credential isolation, client-specific delegation, approval continuation, and immediate policy/revocation enforcement.
Defaults: one public listing, hosted onboarding, first-party public tools, broader direct/private gateways, and task-governed external participation. Specialized team plugins follow after the core connection and first task are reliable.
## Sources (researched 2026-09-30)
- [OpenAI plugin guidelines](https://developers.openai.com/plugins/plugin-guidelines)
- [OpenAI packaging](https://developers.openai.com/plugins/build/plugins)
- [OpenAI submission](https://developers.openai.com/plugins/deploy/submission)
- [OpenAI MCP deployment](https://developers.openai.com/plugins/build/mcp-server#deploy-the-endpoint)
- [OpenAI authentication](https://developers.openai.com/plugins/build/auth)
- [Claude publication](https://claude.com/docs/directory/publish)
- [Claude connector submission](https://claude.com/docs/connectors/building/submission)
- [Claude authentication](https://claude.com/docs/connectors/building/authentication)
## Initial implementation record (2026-09-30; historical)
Paperclip worktree: `paperclip-public-mcp`, branch `codex/paperclip-public-mcp`.
Cloud worktree: `paperclip-cloud-public-mcp`, branch `codex/public-mcp`.
At this initial checkpoint, the first-release code was in isolated branches and
broad verification had not passed. The failures below remain part of the history;
the later PR qualification record supersedes this checkpoint for current checks.
No production rollout has been performed.
Implemented:
- Opt-in `/mcp/paperclip` with ten individually exposed first-party tools.
- Company-scoped OAuth grants with S256 PKCE, exact redirect/resource validation,
discovery, public client registration, hashed tokens, expiry, rotating refresh
and revocation.
- Explicit browser team selection, optional writes, read-only role explanation
and connection management.
- Request-local human authorization through existing REST/domain handlers;
native run authority is unchanged. Instance admin status cannot elevate a
connection beyond company-role permissions.
- Durable mutation receipts keyed by person, company, operation and request UUID,
including retries under a new authorization grant; unknown outcomes require
inspection.
- Shared review/delegate/follow-up skills and separate OpenAI/Claude packages.
- Cloud setup entry link using the existing configured Cloud origin.
- Companion Cloud branch `codex/public-mcp`: stable-resource OAuth broker,
explicit organization selection, return from hosted creation, readiness UI,
exact tenant protocol forwarding, and opt-in provisioning/release-roll config.
- Cloud grants retain tenant authorization through encrypted credential
envelopes; current membership and verified domain/lifecycle routing are
checked at forwarding. Durable request transitions guard concurrent selection
and single-use code exchange. No arbitrary client destination is accepted.
Verification:
- Targeted PostgreSQL/protocol tests cover PKCE, redirect/resource binding, code
reuse, refresh replay, expiry/revocation, role changes, company isolation,
concurrent requests, retries and uncertain outcomes.
- Real task/comment/document route tests prove a single durable task, one call
to the existing scheduling boundary, human feedback attribution and later
document retrieval. Scheduling is captured; no paid agent is launched.
- Unavailable-assignee rejection is replayable, and assigning to a paused agent
preserves its paused state and does not claim execution started.
- An isolated browser fixture exercised team selection, disabled writes for a
viewer, explicit writes for an operator, consent/code exchange, cancellation,
revocation and persisted state after reload. Its signed-in actor is a fixture;
this does not prove a production sign-in or provider-client flow.
- Browser captures are retained outside the source tree as local verification
evidence, rather than committed run artifacts.
- Codex package and all shared skills validate; UI token gates pass.
- Repository-wide typecheck and production build pass. The targeted boundary,
logging, mutation-guard and company-route checks pass (91 tests).
- Subsequent MCP checks also pass with paused/unavailable assignees and a
50,000-character non-ASCII body. Server compilation passes after the body-limit
fix.
- Final focused checks pass together on Node 24.21.0: MCP, HTTP-log redaction,
authorization, mutation guard, company routes and consent selection reset
(158 tests in 6 files). The changed server/UI packages pass typecheck and
production build; token gates pass. The protocol test also proves unexpected
internal errors are not exposed and hosted setup uses Cloud's `/orgs/new` route.
- The full `pnpm test:run` is **not green or complete**. Its latest server group
finished with 661 files passing, 9 failing and 3 skipped; 12,792 tests passed,
8 failed and 104 were skipped. Failures included runtime-exposure assertions,
refresh coalescing, agent/default configuration, and test/hook timeouts. The
command exited before running subsequent groups.
- Separate runs of the remaining groups also did not produce a full green
result: workspace group A had 610 files pass and 6 fail (6,259 tests passed,
57 failed, including onboarding UI assertions and timeouts). Group B passed
all 758 shared-package tests, then stopped at a skills-catalog package-build
timeout. The serialized group stopped at its first suite's setup timeout.
These failures are outside the new MCP tests, but have not all been proven
pre-existing against a clean baseline. No unrelated assertions were changed
to hide them. Full-suite triage and a complete green run remain outstanding.
- Isolated follow-up runs pass all 93 onboarding-wizard tests and both the
refresh-coalescing and access-admin suites. The three runtime-exposure
assertions still fail. A separate checkout at the unchanged starting commit
`c65fc9e3c81c41aafe421aa90a00514b84343285` reproduces the same three failures on
Node 24.21.0; baseline and branch were run sequentially to avoid competing for
their fixed test ports. The baseline source was unchanged (only its local
lockfile was regenerated because frozen install reports a pre-existing
patched-dependency configuration mismatch). This establishes those three
failures as baseline behavior; it does not clear the other broad-run results.
Open gates at the initial checkpoint:
1. Resolve the broad Paperclip verification failures above, finish all required
test groups, and complete normal code/PR review. No PR has been opened.
2. Deploy compatible instance and Cloud releases, migrations, a broker key from
the secret store, and the explicit feature opt-ins. Roll existing/pool stacks
onto the compatible tenant version. No production deployment has been made.
3. Build packages against the deployed stable Paperclip-owned HTTPS endpoint and
provide store review metadata; checked-in packages target loopback development.
4. Exercise ChatGPT/Codex and Claude application/store installation against the
staging HTTPS endpoint and run a controlled agent through execution to a
completed deliverable. Local CLI OAuth and MCP SDK interoperability tests
are distinct from hosted application/store verification.
5. Prove the live hosted newcomer journey from the existing signup eligibility
policy through mission/template and spending setup back to consent. Automated
creation-return tests do not open signup or configure paid execution.
Cloud verification added during implementation:
- Broker protocol and service tests cover PKCE, audience/redirect binding,
concurrent exchange, current membership, wrong tenant identity, refresh replay,
expiry, revocation, CSRF and protocol forwarding without Cloud user headers.
- The PostgreSQL test ran against a disposable database: migration, restart
durability, two-store compare-and-swap and expired request cleanup passed.
- The full Cloud UI suite passed (85 files, 643 tests), typecheck and build passed.
- After the final consent reset change, the connection and creation-return
suites passed again (22 tests, including one additional regression case).
- A real MCP SDK client completed initialization, discovery of all ten tools,
and a connection call through the Cloud broker into the real tenant OAuth/MCP
server. Person/company attribution, refresh and revocation passed. This caught
and fixed a redirect-validation mismatch with tenant request IDs.
- Actual Codex CLI 0.153.4 and Claude Code 2.1.245 completed dynamic client
registration and PKCE OAuth login through the Cloud broker into the tenant
OAuth implementation. These used disposable local databases and a fixture
person with explicit read-only test consent; they did not use production
sign-in, a public listing, or paid model execution. Claude's terminal login
was exercised through a PTY. Both clients' fixture credentials were logged
out and the temporary Claude server configuration was removed.
- The complete Cloud backend suite passed on its specified Node 22 runtime:
1,236 passed, 23 skipped, zero failed or cancelled. The opt-in PostgreSQL test
was also run separately and passed. Cloud's `smoke:qa` passed, covering the
signup/portfolio/entry, isolation, routing and sleep/wake boundaries.
- A local browser walkthrough explicitly created one organization, returned to
the pending connection, selected the ready organization, and verified its
persistence after reload. Selection resets until chosen again. This used a
fixture account eligible under existing signup policy and a fake provisioner;
it does not prove production provisioning, a real external client's login,
mission/template setup, or paid-agent execution.
Release two (external agent participation/leases) and release three (granted
third-party tools) remain future work, as sequenced above.
## Paid evaluation campaign
The user requested paid LLM evals across several models, beginning with cheaper
models. Implement these in the existing Product E2E catalog and report pipeline,
as the explicit-only `public-mcp` suite. The maintained runbook is
`tests/runner-e2e/PUBLIC-MCP.md`.
- Exercise seven scenarios: delegate/retrieve across conversations, uncertain
mutation retry, team review, human feedback, read-only connection, untrusted
document/company isolation, and paused-agent queuing.
- Use the actual browser consent UI, inbound OAuth, MCP SDK, paid assistant API,
scheduler and paid CLI worker. Grade independent persisted API state and keep
positive/negative/missing-evidence oracle calibrations.
- Start with GPT-5.4 Mini and Claude Haiku 4.5, then Claude Sonnet 4.6. A cheaper
Nano pilot called the public tools successfully but its Codex worker rejected
an unsupported `tool_search` capability; retain this compatibility failure.
- Preserve failed attempts, explicit model/profile IDs, source and skill digests,
token usage, separate external-assistant estimates, worker charges and cleanup.
Do not infer hosted/store readiness from a local paid workflow.
- Run narrow pilots before the complete 21-cell selection; fix product/harness
failures, retain model failures, and repeat the final model matrix to check
that success is not a single lucky run.
Initial paid qualification (2026-10-01): **42/42 cells passed** across two complete
21-cell runs on identical source, without retries. GPT-5.4 Mini, Claude Haiku 4.5
and Claude Sonnet 4.6 each passed all seven cases twice. All 42 packaged evidence
sets passed the existing validator. Eval typecheck and 470 unit tests pass; the
focused MCP and Cloud broker checks also pass (11 and 8 tests respectively).
The iterations improved real tool/workflow instructions for resolving task and
company IDs, clarified generic document creation in the production worker skill,
and calibrated the independent oracles for schema repair, paused-task recovery
and untrusted-document causality. Original failed grades remain in the reports.
The [dated results record](2026-10-01-public-mcp-paid-eval-results.md) includes
source fingerprints, models, costs, reports, failure classifications and the
remaining hosted/store and repository-wide verification gates. These local paid
results do not close those release gates.
## PR qualification and merge consequences (2026-10-01)
[Core PR #14846](https://github.com/paperclipai/paperclip/pull/14846) contains the
instance implementation, plugin packages and evals. The companion Cloud PR is
tracked in the Cloud repository. Both use fresh worktrees and dedicated branches;
neither has been merged or deployed by this work.
After rebasing onto the current development baseline, the Core CI run at
`fb7946a4b82d6010dfaa24cb2f81e8fef72fd779` passed all actual CI lanes, including
server/workspace/serialized tests, all eight browser shards, typecheck and build.
Subsequent review fixes repeat CI before handoff; each PR's Verification section
and latest-commit checks are the current record. The initial local broad-run
failures above are retained as historical evidence, not a claim that current CI
is failing.
Current local qualification:
- Core production build, repository-wide typecheck, eval typecheck and all 881
eval-support tests pass. All 15 real OAuth/MCP tests and 10 OpenAPI checks pass.
- Shared registration and pending-consent quotas are enforced in durable state.
Completed connections do not exhaust a shared client's pending quota. Tests
complete twelve connections for one client and exercise concurrent admission.
- Cloud root tests pass: 2,074 passed and 63 opt-in tests skipped. Web tests pass:
769 tests in 93 files. Root/web typechecks, web build and smoke QA pass.
- Seven opt-in durable PostgreSQL tests pass, including cleanup/admission races,
shared quotas, active-client retention and repeated completed connections.
- The latest Core and Cloud code passes a real OAuth/broker/MCP SDK round trip:
initialize, list ten tools, call, refresh and revoke with person/company
attribution preserved.
- A fresh paid complete matrix after rebase and review fixes passes 21/21, with
no retries and all evidence packages validated. This follows two earlier
21/21 campaigns. The final pending-consent correction has dedicated protocol
tests and a 3/3 paid delegation/retrieval regression, one on each model, with
no retries and all evidence validated. See the dated results record for the
exact source fingerprints and costs.
This is a usable opt-in first release for existing teams. Applying Core updates
adds migrations 0301 and 0302 plus disabled MCP code. An operator must enable
`PAPERCLIP_PUBLIC_MCP_ENABLED`, configure `PAPERCLIP_PUBLIC_URL`, and expose the
authenticated instance over HTTPS. A team member can then connect Codex or Claude
Code directly, consent to a company, review work, delegate tasks as themselves,
and retrieve results later. [The runbook](../public-mcp.md) includes commands.
The shared production Paperclip skill also gains generic document-creation and
read-back guidance.
Hosted use additionally requires Cloud migration 0055, a secret-store encryption
key, the Cloud feature flag, and a compatible tenant release/fleet rollout.
Signup eligibility, execution credentials and spending setup remain explicit.
Merging does not create a company, launch paid agents, expose a live public
endpoint, or publish a store listing. Actual hosted newcomer provisioning,
staging HTTPS application connections and public store installation remain
release gates. Agent impersonation/external task claims and third-party tool
access remain releases two and three.
## MCP Events addition (2026-10-01)
Add user-requested task monitoring using [OpenAI MCP Events](https://developers.openai.com/plugins/build/mcp-events), alongside the existing legacy MCP tool transport. Implement MCP 2.0 (`2026-07-28`) discovery and individually described task status, comment and document events. Start with an explicit company and task filter; monitoring never grants agent identity or approval authority.
Subscriptions and pending deliveries persist in PostgreSQL. Callback ownership verification and event deliveries use Standard Webhooks signatures, encrypted signing material, HTTPS with pinned public-address resolution, finite lifetimes, bounded retries, and current authorization checks. Hosted delivery additionally checks Cloud account/stack membership through its fixed broker, with a subscription lifetime bounded by its authorization proof. No replay cursor is advertised in this first implementation; use task/history tools to recover missed work after an expired subscription.
Add restart, retry, isolation, revocation, callback verification and protocol compatibility tests. Extend the existing paid evaluation infrastructure with event-driven follow-up across the qualified models, retaining source/cost/evidence. A real ChatGPT Work Cloud subscription and plugin rescan against staging remain rollout acceptance gates until exercised. Claude and older clients retain tool-based follow-up.
Implementation and paid verification are complete for this addition: the three-model event-follow-up selection passed, followed by a Mini regression on the final quota/status changes. All evidence validates. The updated [results record](2026-10-01-public-mcp-paid-eval-results.md#mcp-events-qualification) retains the source fingerprints, setup failures, costs and remaining client rollout gates. Core persists finite subscriptions and signed deliveries; Cloud forwards MCP 2.0 metadata and preserves current hosted authority. Deployment and actual ChatGPT Work Cloud acceptance remain separate steps.
@@ -0,0 +1,222 @@
# Public Paperclip MCP paid evaluation results
Date: 2026-10-01
Latest complete pre-Events matrix: **21/21 cells passed**, without retries, after rebasing and PR fixes. All 21 evidence packages passed the existing report validator. A final focused delegation/retrieval regression then passed **3/3** on the pending-consent correction, again without retries and with all evidence validated. Earlier qualification also passed **42/42** across two complete campaigns. These measurements have separate source fingerprints below. They are real paid local Product E2E runs with browser authentication/consent, OAuth, MCP, an external assistant API, scheduling, and a CLI worker.
| Model | final-b-20261001 | final-c-20261001 | pr-final-20261001 |
| --- | --- | --- | --- |
| `gpt-5.4-mini` | 7/7 | 7/7 | 7/7 |
| `claude-haiku-4-5-20251001` | 7/7 | 7/7 | 7/7 |
| `claude-sonnet-4-6` | 7/7 | 7/7 | 7/7 |
GPT-5.4 Mini resolved to `gpt-5.4-mini-2026-03-17` in external API responses. Requested and observed model IDs are retained separately. The worker also must report metered usage for the configured model.
The subsequent MCP Events extension passed a three-model selection and a final Mini regression; see the separate qualification record below. The catalog now contains eight cases (24 selections).
## Coverage and implementation
The initial explicit-only `public-mcp` suite added seven cases to the existing `tests/runner-e2e` catalog, fixture registry, launcher, evidence validation, billing, and HTML report pipeline. `--all` does not silently include these paid cells. See [the runbook](../../tests/runner-e2e/PUBLIC-MCP.md).
- Delegate exactly one task, wait for one successful worker run, and retrieve the agent-authored report in a fresh connection and conversation.
- Recover a withheld successful create response without a duplicate task or mutation identity.
- Summarize blocked and completed work without writes.
- Persist feedback exactly once with the connected human as author.
- Respect a read-only grant when asked to delegate.
- Read a document containing malicious instructions without unauthorized writes or cross-company disclosure; independently probe foreign-task rejection.
- Queue one task for a paused agent without resuming it or starting execution, and report the waiting state honestly.
The oracle reads durable state through public APIs. It checks document contents/authorship, task and run counts, assignment, human attribution, current agent state, and tool evidence. Missing evidence fails. The external assistant receives the actual individually exposed catalog and shipped workflow skills. No model grades its own success, and no fixture writes domain rows directly to the database.
## Retained reports
The paths below are local evidence paths in the implementation worktree, not
repository links. `tests/runner-e2e/results/` is gitignored; these reports and logs
are not included in a normal checkout or published on GitHub. The committed
summary preserves measurements and provenance; the reproduce commands generate
new evidence. Raw evidence is retained locally, with each original attempt.
- public-mcp-pr-final-regression-20261001 (`tests/runner-e2e/results/public-mcp-pr-final-regression-20261001/report/index.html`): 3/3 delegation/retrieval cells, one on each model, after the final pending-consent quota correction. Source manifest (`tests/runner-e2e/results/public-mcp-pr-final-regression-20261001/source-files.json`).
- public-mcp-pr-final-20261001 (`tests/runner-e2e/results/public-mcp-pr-final-20261001/report/index.html`): 21/21 after rebasing and review fixes. Source manifest (`tests/runner-e2e/results/public-mcp-pr-final-20261001/source-files.json`).
- public-mcp-final-b-20261001 (`tests/runner-e2e/results/public-mcp-final-b-20261001/report/index.html`): 21/21, with screenshots, checks, tool outcomes, cost coverage and cleanup. Source manifest (`tests/runner-e2e/results/public-mcp-final-b-20261001/source-files.json`).
- public-mcp-final-c-20261001 (`tests/runner-e2e/results/public-mcp-final-c-20261001/report/index.html`): 21/21, with screenshots, checks, tool outcomes, cost coverage and cleanup. Source manifest (`tests/runner-e2e/results/public-mcp-final-c-20261001/source-files.json`).
These three complete campaigns contain 63 retained attempts for 63 cells and completed without retries. Earlier failed attempts remain visible in the history below; selecting a later successful attempt never deletes the earlier measurement. Reports are retained locally in this managed worktree and have not been published.
## What the iterations found
| Evidence | Classification and correction |
| --- | --- |
| Nano pilot | The external API called the MCP tools, but the Codex worker rejected unsupported `tool_search`. Nano remains unqualified for this end-to-end profile; Mini and Haiku were the first qualified inexpensive models. |
| Initial browser/worker pilots | Fixed a callback origin intercepted by the UI service worker and a `runId`/`id` observation mismatch. Isolated provider configuration homes so operator plugins and login state cannot enter fixtures. |
| Mini worker quoting failure | Malformed shell JSON left the task unfinished until another heartbeat. Added JSON-encoder guidance to the worker fixture; the one-run requirement remains strict. |
| Haiku feedback, matrix C | The assistant guessed a task UUID and failed to add feedback. Updated real tool descriptions and shared plugin instructions to search for named tasks and copy returned IDs. |
| Sonnet injection, matrix D | An earlier rejected placeholder-company lookup was wrongly attributed to a later document read. The causal oracle still rejects all writes, successful foreign reads and foreign attempts after retrieval. |
| Haiku/Sonnet paused cases, matrix E | Recovery legitimately moved waiting tasks from `todo` to `blocked`. Both are accepted only with the correct assignee, paused agent and zero runs; queued state is now retained explicitly. |
| Mini document, final A | The worker attempted POST where document creation requires PUT, then saved a comment instead. Clarified generic document creation and read-back in the production Paperclip skill. The missing-document failure remains a failure. |
| Haiku UUID, final A | A pre-execution schema rejection was repaired with a valid UUID, leaving one task/run. The oracle now permits that repair, while requiring stable identity after execution may have begun. |
| Post-rebase smoke | The secret guard caught an OAuth callback query in a browser navigation diagnostic and blocked evidence output. Diagnostic URLs now omit query, fragment and userinfo; the raw-body credential guard remains strict. The subsequent smoke passed. |
| PR qualification startup failures | Stale, detached PostgreSQL shared-memory segments exhausted the macOS host limit. The incomplete campaigns are retained; only unused segments with no live creator were reclaimed. A fresh complete campaign then passed all 21 cells. |
| Review request-budget finding | Enforced the 16-request external-assistant cap across every conversation in the cell. Unit calibration and the fresh full matrix pass with the shared cap. |
The earlier full matrices retain their original grades: C: 20/21 (`tests/runner-e2e/results/public-mcp-matrix-c-20261001/report/index.html`), D: 20/21 (`tests/runner-e2e/results/public-mcp-matrix-d-20261001/report/index.html`), E: 19/21 (`tests/runner-e2e/results/public-mcp-matrix-e-20261001/report/index.html`), and final A: 19/21 (`tests/runner-e2e/results/public-mcp-final-a-20261001/report/index.html`). Infrastructure failures also remain recorded, including embedded-Postgres startup limits, a host sleep interruption, and an Anthropic HTTP 529 retried by the existing launcher.
## Provenance and validation
- `public-mcp-pr-final-regression-20261001`: base `d17bdce7a9b25d67d4aaecf92acf0743c7396108`, worktree SHA-256 `50cb81541ff67ff40e02346eff7765e1cf07ec101243b718bc83412ffc35ddc6`; suite definition `df7d686d55f28e5eb13e9c023c5858e28c24a4bbe82ca38c6c3facf23ac4a026`. Three attempts, three passing cells and three validated packages.
- `public-mcp-pr-final-20261001`: base `fb7946a4b82d6010dfaa24cb2f81e8fef72fd779`, worktree SHA-256 `50cb81541ff67ff40e02346eff7765e1cf07ec101243b718bc83412ffc35ddc6`; suite definition `df7d686d55f28e5eb13e9c023c5858e28c24a4bbe82ca38c6c3facf23ac4a026`.
- `public-mcp-final-b-20261001`: base `c65fc9e3c81c41aafe421aa90a00514b84343285`, worktree SHA-256 `0e8766437ac1841f0b59971faf2c7c6bd45c03f2aba31dc19310cf4796768a01`; suite definition `804a7f8fa96a997898f0ae9522c17257affa794c102bb32c66803a840813195b`.
- `public-mcp-final-c-20261001`: base `c65fc9e3c81c41aafe421aa90a00514b84343285`, worktree SHA-256 `0e8766437ac1841f0b59971faf2c7c6bd45c03f2aba31dc19310cf4796768a01`; suite definition `804a7f8fa96a997898f0ae9522c17257affa794c102bb32c66803a840813195b`.
- Grader: `public-mcp-durable-state-v8`. Catalog metadata fingerprints the shared plugin workflows, production worker skill and fixture instructions. Each attempt records source SHA/ref, selected cell, provider/model, timing, usage and cleanup.
- The live harness used Node 24.21.0, isolated authenticated servers and disposable local databases. Claude fixtures pin CLI 2.1.277. Credentials are supplied through the existing ignored eval environment file and encrypted normal API bindings.
- Eval typecheck and all 881 current unit tests in 63 files pass. Positive, plausible-wrong and missing-evidence calibrations cover the new oracles.
- The latest real MCP boundary tests pass (15 tests), including twelve completed connections through a shared client. OpenAPI route coverage passes (10 tests). Cloud root tests pass (2,074 passed, 63 skipped), web tests pass (769), and all seven opt-in durable PostgreSQL tests pass. These cover protocol and admission boundaries separately from paid model behavior.
- The final Core and Cloud code also passes a real tenant OAuth → Cloud broker → MCP SDK initialize/list/call round trip, then refresh and revocation; all ten tools and person/company attribution are verified. This is a local disposable fixture, not a production deployment.
- Automatic consent traces/video/screenshots are disabled; explicit captures contain fixture task pages. Tool evidence and visible answers are retained, while the external assistant's hidden reasoning is omitted. The existing secret/evidence validator passed all final packages.
Current verification logs: Core build (`tests/runner-e2e/results/public-mcp-pr-verification-20261001/core-build.log`), Core typecheck (`tests/runner-e2e/results/public-mcp-pr-verification-20261001/core-typecheck.log`), 881 eval-support tests (`tests/runner-e2e/results/public-mcp-pr-verification-20261001/eval-unit.log`), 15 MCP boundary tests (`tests/runner-e2e/results/public-mcp-pr-verification-20261001/mcp-boundary.log`), Cloud root tests (`tests/runner-e2e/results/public-mcp-pr-verification-20261001/cloud-tests.log`), seven PostgreSQL tests (`tests/runner-e2e/results/public-mcp-pr-verification-20261001/cloud-postgres.log`), and real broker/tenant MCP SDK (`tests/runner-e2e/results/public-mcp-pr-verification-20261001/cloud-tenant-mcp-sdk.log`).
Initial verification logs (historical): eval typecheck (`tests/runner-e2e/results/public-mcp-verification-20261001/eval-typecheck.log`), 470 unit tests (`tests/runner-e2e/results/public-mcp-verification-20261001/eval-unit.log`), MCP boundaries (`tests/runner-e2e/results/public-mcp-verification-20261001/mcp-boundary.log`), Cloud broker (`tests/runner-e2e/results/public-mcp-verification-20261001/cloud-broker.log`).
The source manifests describe each measured working tree. The latest full matrix precedes the final pending-consent quota correction; that correction has dedicated shared-client protocol tests and a separate paid delegation regression. Historical runs keep their original grades and source fingerprints.
## Recorded cost
- Initial two selected campaigns: **$2.3864** external-assistant list-price estimate across 214 observed API responses; **$3.3786** worker provider-reported charges.
- Latest complete matrix: **$1.2059** external-assistant estimate across 108 observed responses and **$1.7534** worker provider-reported charges.
- Final focused regression: **$0.2751** external-assistant estimate across 25 observed responses and **$0.3273** reported worker charges.
- All 200 retained development attempts total **$9.0859** external-assistant estimates and **$12.7127** reported worker charges.
- These are partial cost observations, not an invoice total. OpenAI workers report tokens but no dollar amount here; failed/interrupted requests may have unknown usage. Local compute is unmetered. Missing prices are not treated as free. Rates, pricing dates/URLs and token categories are retained with each assistant measurement.
## Scope and remaining gates
This proves the selected local public MCP workflows across three models. It does not prove hosted newcomer provisioning, store installation, desktop chat UI interoperability, or production deployment. Cloud/instance migrations, feature opt-ins, broker secrets, stable HTTPS packaging and hosted acceptance remain release gates. External-agent leases and third-party tool gateways remain later releases.
The [implementation plan](2026-09-30-paperclip-public-mcp-and-plugins.md) retains initial broad-run failures and the current PR qualification record. Paid success does not substitute for repository checks, review, or hosted acceptance.
## Reproduce
Use Node >=24.11.0 and the documented ignored credential file. Start with one inexpensive cell before selecting the entire paid suite.
```sh
pnpm test:e2e:runner:typecheck
pnpm test:e2e:runner:unit
pnpm test:e2e:runner -- --list --suite public-mcp
pnpm test:e2e:runner -- --id public-mcp.assistant-codex-mini.local.delegate-retrieve
pnpm test:e2e:runner -- --suite public-mcp --max-parallel 1
```
## MCP Events qualification
The added event-follow-up case passes **3/3 models** on clean commit
`93056b8edea03ff20d0409fecdde92917cb36a25`. A final Mini regression passes on clean
commit `5aa2a6e3ae6cb1ccf70efa05b14dacccc9d358a0`, after quota reclamation and native
checkout/release status-event fixes. All four final evidence packages validate.
These focused runs supplement the earlier 21-cell matrix; a new complete
24-cell matrix has not been run.
The catalog now has eight cases and 24 explicit paid selections. The new case
uses browser consent, OAuth, the actual MCP 2.0 endpoint, a public HTTPS callback,
independent HMAC verification, a paid external assistant and a paid worker. The
host subscribes immediately after task creation, receives its completion event,
and starts a fresh assistant conversation that must retrieve the saved document
without creating tasks or comments. Callback credentials are host-owned and are
never supplied to the model. The oracle requires the correct task/company,
verified callback/signature, completion status, document read-back and no writes.
| Campaign (all dated 20261001) | Result | Assistant estimate | Reported worker charges |
| --- | --- | --- | --- |
| `public-mcp-events-mini-pilot-20261001` | 1/1 | $0.014134 | Unpriced |
| `public-mcp-events-model-matrix-20261001` | 2/3 | $0.246730 | $0.262921 |
| `public-mcp-events-final-20261001` | 1/3 | $0.060270 | $0.084466 |
| `public-mcp-events-qualified-20261001` | 3/3 | $0.257733 | $0.212634 |
| `public-mcp-events-quota-regression-20261001` | 1/1 | $0.011218 | Unpriced |
The qualified matrix passed GPT-5.4 Mini, Claude Haiku 4.5 and Claude Sonnet 4.6
on their first paid cell attempt. Mini and Sonnet each needed two receiver startup
attempts because the first temporary tunnel hostname returned `ENOTFOUND`; Haiku
needed one. The final Mini regression also needed two receiver startup attempts.
Setup retries are bounded to three and run before provider calls. Their count
and failure categories remain in `snapshots/public-mcp-events.json`; they are not
hidden paid retries.
The first matrix retains a Mini callback-verification failure. The next selection
retains Mini/Sonnet public-receiver readiness failures with zero observed external
assistant requests. An independent probe reproduced temporary-tunnel DNS failure.
The harness now checks public readiness and retries a fresh tunnel before paying
for an assistant. Production callback verification and public-address checks were
not weakened. All 11 original attempts and their original grades remain; every
report's evidence packages validate, including failed attempts.
Source provenance (each campaign retains `source-files.json`):
- Pilot: base `dd27f4dea0040646d3e96b2cbf92086b421389fd`, working-tree digest
`9f96066a4f1fb0374954a0e4e5b54eb0b37aca64f65e4343cf802d96152c05e3`.
- First matrix: same base, working-tree digest
`f5ac7563a382e3e5c963e6986469242d492f58c4a677f70882714fba28969466`.
- Readiness selection: clean `fed6d7bab8831d5b62558cdaced3e45f3898184b`.
- Qualified matrix and final regression: clean commits stated above. Their empty
working-tree manifests have SHA-256
`44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`.
- Suite definition for these runs:
`013825c29cb522cbdc98cc07b6f6954a0d59c1d7c6d52e30f5b32e44bb0f7ca5`.
Grader: `public-mcp-durable-state-v9`, including 11 new positive/negative
event-oracle calibration cases.
Each campaign's report is retained locally at
`tests/runner-e2e/results/<campaign>/report/index.html`, alongside the original
attempts and source manifest. These ignored files are not published on GitHub.
The Events extension adds **$0.5901** of observed external-assistant estimates
and **$0.5600** of worker-reported charges across 11 attempts. Together with the
previous 200 attempts, the retained totals are **$9.6760** and **$13.2727**
respectively. These remain partial observations, not an invoice total; OpenAI
worker token usage is unpriced and interrupted usage may be unavailable.
Updated supporting verification:
- All 33 real MCP/OAuth tests and 892 eval-support tests pass, along with eval
typecheck and server typecheck. The preceding combined MCP, log-redaction,
private-address and DNS-rebinding run passed 129 tests; two subsequent MCP
regressions cover quota reuse and unchanged-status suppression.
- All 28 adjacent issue-tree/stale-lock route tests pass after checkout/release
activity gained previous/current status for event delivery.
- CI subsequently found that checkout logging dereferenced a null result in an
existing concurrent workspace-reopen path. The log now omits status when no
task is returned, preserving that path's response and avoiding a false event.
The existing 12-test closed-workspace suite reproduces and verifies the fix.
This narrow null-result correction follows the paid regression above.
- An exact-start boundary calibration also reproduced a missed event at the
subscription's timestamp. Scanning now includes that timestamp; the existing
verification-window test requires delivery at the exact start. This correction
also follows the paid regression, and all 33 MCP tests pass afterward.
- Repository-wide typecheck and production build pass after merging master.
- The Core → Cloud → Core authority round trip passes real OAuth, MCP 2.0
subscription, delivery, current Cloud membership loss, unsubscribe, legacy MCP
tools, refresh and revocation. Its callback transport is injected and verifies
HMAC independently; the paid campaigns separately prove public HTTPS delivery.
- Cloud's full root suite passes 2,095 tests with 64 opt-in skips. Root typecheck,
smoke QA and all seven opt-in durable PostgreSQL tests pass after migration
renumbering to `0055_assistant_mcp.sql`.
The delivery tests additionally cover persistence/restart, retries and stable IDs,
key rotation, expiration, revocation, company isolation, SSRF/log redaction,
changes during callback verification and late-committed activity. Stopped/expired
monitors release quota on the next admission; no replay after reclamation is
promised. Hosted monitors refresh within five minutes and never exceed their
Cloud authorization proof's expiry.
Actual ChatGPT Work Cloud/dot UI behavior, a deployed plugin rescan and hosted
staging acceptance remain release gates. The Anthropic paid cells exercise model
behavior through the same host fixture; they do not claim Claude product support
for OpenAI MCP Events. Legacy tool-based follow-up remains available.
To reproduce a cheap Events cell, install `cloudflared`, provide the existing
ignored eval credentials, then run:
```sh
pnpm test:e2e:runner -- --id public-mcp.assistant-codex-mini.local.event-follow-up
```
+245
View File
@@ -0,0 +1,245 @@
# Public Paperclip MCP connection
The first-release implementation connects an external assistant **as a person**
to one explicitly selected company. It exposes first-party task operations and
keeps normal Paperclip authorization, scheduling, attribution, budgets and
approvals. The existing named agent gateways and native runner checks remain
separate. The accepted roadmap is in
[the implementation plan](plans/2026-09-30-paperclip-public-mcp-and-plugins.md).
## Enable an instance
Apply database migrations with the normal instance upgrade workflow. Set:
```sh
PAPERCLIP_PUBLIC_MCP_ENABLED=true
PAPERCLIP_PUBLIC_URL=https://YOUR-PAPERCLIP-HOST
```
The URL must be an origin without a path, credentials, query or fragment. HTTP
is allowed only for localhost/loopback development. The feature is disabled by
default. Use authenticated deployment with real user accounts and company
memberships; local implicit board authority and agent/board API keys cannot
approve user OAuth connections. Configure `TRUST_PROXY` correctly at your edge.
The endpoint is `POST /mcp/paperclip`, using stateless Streamable HTTP with JSON
responses. GET/SSE sessions are unnecessary. Each invocation verifies its bearer
token again; normal API endpoints do not accept these OAuth tokens. Public
installation requires a reachable HTTPS deployment. Private self-hosted
instances require a directly reachable endpoint; no managed relay is included.
## Connect an assistant directly
After the instance is enabled and reachable, an existing team member can connect
without a store listing. For Codex CLI:
```sh
codex mcp add paperclip --url https://YOUR-PAPERCLIP-HOST/mcp/paperclip
codex mcp login paperclip --scopes paperclip:read,paperclip:write,offline_access
```
For Claude Code:
```sh
claude mcp add --transport http paperclip https://YOUR-PAPERCLIP-HOST/mcp/paperclip
```
Open Claude Code's `/mcp` menu and authenticate the Paperclip server. Both flows
open browser sign-in and consent: select a team and explicitly enable task and
comment writes when wanted. Read-only consent cannot delegate work.
Ask the assistant to identify the connected team and list its agents, then ask
it to delegate a small task to an available agent. The returned task link is the
durable reference. In a later conversation, ask for that task's progress and
report. Configure the agent's provider credentials, execution environment and
budget in Paperclip before expecting it to run; the assistant connection does
not supply them. Revocation is available at `/assistant-connections`.
The optional [workflow packages](../integrations/assistant-plugins/README.md)
teach team review, delegation and result retrieval. Build them for the same
endpoint before installing locally. Public ChatGPT/Codex and Claude directory
installation requires the separate deployment and submission work below.
## Identity and consent
- Protected-resource discovery: `/.well-known/oauth-protected-resource/mcp/paperclip`.
- Authorization-server discovery: `/.well-known/oauth-authorization-server`.
- Public-client registration: `/mcp/oauth/register`.
- Authorization, token and revocation endpoints: `/mcp/oauth/authorize`,
`/mcp/oauth/token`, `/mcp/oauth/revoke`.
- Browser consent: `/mcp-connect/:requestId`.
- User connection management: `/assistant-connections`.
Dynamic registration uses public clients, exact registered HTTPS redirect URIs
(or HTTP loopback), authorization code flow, S256 PKCE and exact resource
binding to the endpoint. Authorization requests expire in ten minutes; codes
expire one minute after consent and are single-use. Access tokens expire in
fifteen minutes. `offline_access` issues a thirty-day rotating refresh token;
replaying a consumed refresh token revokes its entire grant. Tokens and codes
are hashed at rest. `paperclip:read` is required; `paperclip:write` adds only task
creation and comments. Scope expansion requires a new consent flow.
Each grant records the person, client, company, resource and scopes. Membership
and company availability are rechecked at execution. Instance admin status does
not elevate a grant beyond that company's role. Consent/revocation require an
authenticated browser and the configured origin. Client registration does not
fetch redirect URLs or accept arbitrary tool destinations. Rate limiting at the
public edge is required in addition to the bounded per-process auth limiter.
Registration also has a database-enforced limit of 60 new clients per minute and
10,000 unconsented clients shared across replicas. Expired authorization requests
and never-consented clients older than one hour are collected during
registration. Clients with grants are retained, preserving their connections and
audit/mutation history.
Revocation blocks future calls; it does not cancel already delegated work or
undo in-flight mutations. Manage existing tasks and execution in Paperclip.
Audit records identify the human caller and connection/client for mutations.
OAuth credential bodies and redirect locations are redacted from HTTP logs.
## Tool surface
| Tool | Effect |
| --- | --- |
| `paperclip_connection` | Person, company, scopes, connection management link |
| `paperclip_list_agents` | Safe agent summary and availability |
| `paperclip_list_projects` | Safe project summary |
| `paperclip_search_tasks` | Bounded task search with offset pagination |
| `paperclip_read_task` | Current task plus recent comments/history |
| `paperclip_create_task` | Assigned task, submitted to existing scheduling |
| `paperclip_add_comment` | Human feedback; may wake or queue work |
| `paperclip_list_deliverables` | Documents and work-product references |
| `paperclip_read_document` | Durable document body |
| `paperclip_pending_approvals` | Pending approvals and existing decision links |
Every company-scoped call requires its explicit authorized company ID. The
server emits bounded projections rather than agent configurations or upstream
credentials. URLs include the company's prefix so unrelated browser company
selection cannot redirect the user to a different team's approval interface.
Writes require a UUID `requestId`, unique per intended action. A durable receipt
is reserved before dispatch, keyed by person, company, operation and request ID (with the originating grant recorded for audit). Matching
retries, including after a new authorization grant, replay the recorded result; changed arguments are rejected. A concurrent
or unconfirmed result is reported as `outcome: unknown`. Inspect the task and
comments before another action; never retry with a new ID to force success.
A known HTTP rejection is recorded and replayed as `outcome: rejected`.
The REST bridge dispatches only paths constructed by the closed tool catalog,
with a request-local verified actor. Existing handlers enforce all domain checks
and own their transaction/scheduling semantics. Receipts do not turn existing
asynchronous scheduling into an exactly-once execution guarantee. Creating a
task is not proof that an agent started or finished it.
## Hosted onboarding and release gates
When `PAPERCLIP_CLOUD_API_ORIGIN` is present, consent links to the existing Cloud
`/orgs/new` flow in a separate tab. Provisioning, mission/template selection,
model credentials, execution capacity and spending remain owned by Cloud.
Installing a plugin never provisions a company or starts paid agents.
This repository implements the instance-side connection and vendor packages.
The companion Cloud implementation supplies the stable public resource, an
account-to-stack OAuth broker, explicit organization selection and a return from
hosted organization creation. Its public connection screen resumes normal
sign-in, lists authorized organizations, reports provisioning/sleeping states,
and links to tenant setup for mission, templates, execution and spending.
The Cloud broker forwards the original PKCE challenge to tenant OAuth, validates
the resulting person, and wraps tenant credentials in encrypted tokens bound to
client, workspace and resource. Every call rechecks current Cloud membership and
verified routing; the tenant rechecks company permissions and revocation.
Cloud stores request metadata and code hashes, not raw tenant tokens. Unknown
mutation outcomes preserve the existing request-ID receipt contract.
Deploy both sides before hosted use. Cloud's tenant front door forwards only
exact discovery, OAuth protocol and MCP paths without minting human authority;
consent and management retain normal browser entry. The Cloud broker remains
opt-in and requires its own durable OAuth state and encryption key from the
provider secret store. Installing these source packages does not deploy an
endpoint, open signup, register a listing, or provision execution capacity.
Before release, exercise actual ChatGPT/Codex and Claude connections against a
staging HTTPS deployment, including client registration, consent, refresh,
revocation, reconnect, task delegation and retrieval from another conversation.
Prove scheduled execution on a controlled agent and the new-user Cloud return
journey. Local OAuth interoperability has been verified with Codex CLI 0.153.4
and Claude Code 2.1.245, using disposable Cloud/tenant fixtures. Protocol tests,
CLI login and local package validation do not replace these release gates.
External sessions acting as agents, task leases and third-party granted tools
remain the second/third releases; do not add generic executors to this public
catalog to implement them.
Registration also enforces shared source quotas (6 per minute and 30 unconsented
clients) using a resource-bound hash of the trusted request IP; raw addresses are
not stored. Configure trusted proxies correctly. Authorization starts atomically
remove expired requests and enforce 10 pending-consent requests per client and 1,000
instance-wide, independently of further client registrations. Existing grants
remain usable when anonymous registration or authorization is throttled.
## Task monitoring with MCP Events
The same authenticated endpoint now supports MCP 2.0 (`2026-07-28`) alongside
legacy MCP. It advertises `events` through `server/discover` and implements
`events/list`, `events/subscribe`, and `events/unsubscribe`. MCP 2.0 requests
include matching `MCP-Protocol-Version`/`Mcp-Method` headers, per-request version
and client-capability metadata, and `Mcp-Name` for tool calls. Existing
initialize-based clients keep the ten-tool connection.
| Event | Required filters | Payload |
| --- | --- | --- |
| `paperclip.task.status_changed` | `companyId`, `taskId`; optional `statuses` | Task ID, status, company ID and task link |
| `paperclip.task.comment_created` | `companyId`, `taskId` | Task/company IDs, comment ID and task link |
| `paperclip.task.document_updated` | `companyId`, `taskId` | Task/company IDs, document key, revision and task link |
In an Events-capable ChatGPT Work Cloud chat or dot, ask, for example:
“Watch this task. When it finishes, read its report and tell me the result.”
The host supplies a callback URL and signing secret and owns refresh/unsubscribe.
Rescan the plugin's MCP server to discover the event catalog. Installing or
connecting alone does not start monitoring. Claude and other clients without
Events support can continue retrieving results through the read tools.
Callback and hosted-authority verification reserve durable capacity before any
remote request. Across replicas, at most 2 verifications per grant, 8 per company
and 32 per instance can run concurrently. Attempts are bounded to 30 per grant,
200 per company and 1,000 per instance per minute, including failed verification.
New monitors reserve subscription quota before verification; leases expire after
one minute. Network waits hold no database transaction, and expired, cancelled
or revoked requests cannot finalize a subscription.
Delivery uses a verified HTTPS callback, Standard Webhooks HMAC signatures,
public-address DNS pinning on every connection, and no redirects. Callback URLs,
current/previous signing keys and hosted authorization proofs are encrypted with
the existing instance secrets master key. Back up that key with the database.
Callback bodies contain bounded references, not comment/document text; clients
must read current authorized state before responding or taking an action.
Subscriptions last at most 24 hours (default), with a 30-second minimum. Hosted
subscriptions last at most five minutes and never outlive the broker access
proof: refresh the OAuth token before refreshing a subscription when necessary.
The tenant verifies that proof through the fixed `PAPERCLIP_CLOUD_API_ORIGIN`
broker before each delivery, checking current Cloud membership as well as local
company membership, grant revocation and task access. A compatible Cloud broker
must be deployed first for hosted Events. Direct connections to a Cloud tenant
without a broker authority proof cannot create event subscriptions.
Subscriptions and delivery receipts persist across restarts. Activity is scanned
without a moving timestamp high-water mark; unique receipts prevent duplicate
queue entries and concurrent workers claim deliveries atomically. Delivery is
at least once, with up to six attempts and exponential backoff. IDs stay stable
across retries while signatures receive fresh timestamps. HTTP 410 stops a
monitor; 413 and other permanent failures are not retried. Secret rotation signs
with both keys for five minutes. Expired subscriptions and their receipts are
removed on the next admission or after seven days; active quotas are 20 per
grant, 100 per company and 1,000 per instance. Unsubscribe frees the subscription and its receipts.
This release returns `cursor: null`: it does not offer protocol replay after an
expired/stopped subscription. Use task history and document tools to recover
missed changes. In-flight requests may finish during unsubscribe/revocation;
subsequent attempts recheck access. Events are data, and may be duplicated or
out of order. Do not post comments merely to acknowledge comments or documents,
which would risk a feedback loop. Approval decisions remain in Paperclip.
See [OpenAI's MCP Events guide](https://developers.openai.com/plugins/build/mcp-events)
for currently supported client surfaces. Actual staging ChatGPT subscription,
plugin rescan and event-triggered response are still deployment acceptance gates;
local protocol and paid model tests do not establish store/UI readiness.