Skip to content

feat: add redis-backed shadow mcp access API#2763

Merged
alx-xo merged 14 commits into
mainfrom
alexm/shadow-mcp-access-controls-api
May 28, 2026
Merged

feat: add redis-backed shadow mcp access API#2763
alx-xo merged 14 commits into
mainfrom
alexm/shadow-mcp-access-controls-api

Conversation

@alx-xo
Copy link
Copy Markdown
Contributor

@alx-xo alx-xo commented May 12, 2026

Summary

This PR adds the Shadow MCP access management API, with request/rule persistence backed by the temporary generic Redis access-control store instead of database tables.

The public API is still Shadow MCP-specific because that is the alpha product surface, but the internal backing model is generic:

  • accesscontrol.Store owns access requests and access rules
  • Redis stores state by organization and resource type
  • Shadow MCP is represented as resource_type = "shadow_mcp"
  • rules support allow/deny disposition, project/org scope, match kind/value, display metadata, and observed evidence
  • request decisions can atomically approve/deny a request and create resulting rules
  • rule matching/canonicalization is shared through matchvalue

The API provides:

  • list/create approval requests
  • approve/deny approval requests
  • list/create/update/delete access rules
  • signed request-token submission for authenticated users
  • audit events for request and rule mutations
  • generated Goa server/client and TypeScript SDK/react-query clients

This PR also moves the risk approval endpoints onto the new access-rule store and restores the AI integrations service mount that was dropped during the stack work. It intentionally does not add access-control database tables or migrations.

Verification

  • API branch: mise run test:server ./internal/aiintegrations passed, 14 tests
  • API branch: mise run test:server ./internal/risk ./internal/shadowmcp -run 'TestApproveShadowMCP|TestListShadowMCPApprovals|TestRevokeShadowMCPApproval|TestAddAndListShadowMCPApprovals|TestIsShadowMCPApproved' -count=1 passed, 25 tests
  • Top of stack: rg -n "shadow-mcp-allow|AddShadowMCPApproval|RemoveShadowMCPApproval|IsShadowMCPApproved|func CanonicalizeMatch\(" server/internal client/dashboard returned no matches
  • Top of stack: mise run test:server ./internal/accesscontrol ./internal/access ./internal/risk ./internal/shadowmcp ./internal/hooks -count=1 passed, 458 tests
  • Top of stack: mise run lint:server passed
  • Top of stack: pnpm --dir client/dashboard type-check passed
  • Top of stack: pnpm --dir client/dashboard exec vitest run src/components/access/ShadowMCPAccessContent.test.tsx passed, 3 tests
  • Top of stack: git diff --check passed

Stack

https://linear.app/speakeasy/issue/AGE-2585/feat-add-redis-backed-shadow-mcp-access-api

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 28, 2026 9:26pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

🦋 Changeset detected

Latest commit: d1f9e60

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
server Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-schema branch from b086721 to abfd621 Compare May 12, 2026 19:51
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-api branch from b4a2811 to 8f1501b Compare May 12, 2026 19:58
@alx-xo alx-xo marked this pull request as ready for review May 12, 2026 19:59
@alx-xo alx-xo requested review from a team as code owners May 12, 2026 19:59
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@alx-xo alx-xo changed the title feat: add shadow mcp access api feat: add shadow mcp access controls api May 12, 2026
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-schema branch from abfd621 to 1b0805e Compare May 12, 2026 20:38
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-api branch from 8f1501b to b619982 Compare May 12, 2026 20:38
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-schema branch from 1b0805e to bc5a5f1 Compare May 14, 2026 15:57
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-api branch from b619982 to 3c1bdba Compare May 14, 2026 16:05
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-schema branch from bc5a5f1 to d456533 Compare May 14, 2026 16:53
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-api branch from 3c1bdba to 8f8b84d Compare May 14, 2026 16:57
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-api branch from 8f8b84d to 7f980c0 Compare May 14, 2026 17:11
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-schema branch from b3c104d to 2903f2e Compare May 14, 2026 22:27
@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-api branch from 5ea662b to 02a9375 Compare May 14, 2026 22:27
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 92 files

Partial review: This PR has more than 50 files, so cubic reviewed the highest-priority files first. During the trial, paid plans get a higher file limit.
You can try an ultrareview to bypass the file limit, comment @cubic-dev-ai ultrareview. Learn more.

Fix all with cubic | Re-trigger cubic

Comment thread server/internal/audit/events.go Outdated
Comment thread server/internal/access/shadow_mcp.go Outdated
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 28, 2026

AGE-2585

@alx-xo alx-xo force-pushed the alexm/shadow-mcp-access-controls-api branch from c27ea56 to d1f9e60 Compare May 28, 2026 21:26
@alx-xo alx-xo added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
@alx-xo alx-xo added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit 05805bb May 28, 2026
31 checks passed
@alx-xo alx-xo deleted the alexm/shadow-mcp-access-controls-api branch May 28, 2026 22:17
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants