feat: add workspace-scoped read-only API and MCP - #84
Open
nikolajIvanov wants to merge 1 commit into
Open
nikolajIvanov wants to merge 1 commit into
nikolajIvanov wants to merge 1 commit into
Conversation
|
@nikolajIvanov is attempting to deploy a commit to the diwenne's projects Team on Vercel. A member of the Team first needs to authorize it. |
nikolajIvanov
force-pushed
the
feat/upstream-scoped-mcp
branch
from
October 3, 2026 12:17
7379d80 to
5d214f8
Compare
This was referenced Oct 3, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a self-contained, read-only integration layer on top of upstream main:
campaigns:read./api/mcp:list_campaigns,get_campaign,get_campaign_stats./api/v1/campaigns.This is a focused read-only subset, not a port of the entire fork. No campaign creation/activation, messaging tools, library/lifecycle changes, events feed or conversion writes.
Security and operational behavior
Workspace filtering, scope checks, explicit output allowlists, no provider tokens/report secrets/recipient logs. Redis rate limiter (120 requests/key/minute) fails closed with 503. Same-origin checks, streamed JSON body limit of 64 KiB, and no-store responses. API/MCP use Bearer headers; no OAuth server or dynamic client registration. A client supporting custom headers is required.
Keys belong to the workspace and are not auto-revoked when their creator leaves; admins should review them during offboarding. Lists are capped at 100 without pagination.
Migration
One additive migration creates
ServiceKeyand its workspace FK/indexes. It does not alter existing campaign state. Run migrations and regenerate Prisma before deploying. Redis is required for integration requests.SMTP/Resend authentication, Docker, worker code, package.json and lockfile are unchanged.
Verification
npm testwith disposableTEST_DATABASE_URL: 354 tests / 30 files passed, including all PostgreSQL suites.npm run lint: passed.git diff --check: passed.Existing upstream blocker:
npm run typecheckandnpm run buildfail atlib/queue/dm-worker.ts:855(string | nullpassed tostring). That file is byte-identical to base257e38d; this PR does not introduce or modify the error. Production compilation succeeds, then the existing TypeScript error stops the build. See #83 for the separate fix. This PR is for review, not a claim of green build/deployment readiness.