Skip to content

feat(search-mcp): connect clients with Sim OAuth - #7613

Merged
waleedlatif1 merged 2 commits into
stagingfrom
codex/search-mcp-oauth
Sep 8, 2026
Merged

feat(search-mcp): connect clients with Sim OAuth#7613
waleedlatif1 merged 2 commits into
stagingfrom
codex/search-mcp-oauth

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Connect Search MCP through Sim OAuth with read-only, resource-bound grants, PKCE, token refresh, and public client registration.
  • Replace API-key setup with shared EMCN connection instructions for Claude, Codex, Claude Code, Cursor, and other compatible clients.
  • Preserve existing API-key/API OAuth access and current organization membership and document permissions.

Type of Change

  • Feature

Testing

  • Tested native Codex, Claude Code, and Cursor OAuth connections and all three Search tools, including refresh and revocation.
  • Focused UI/auth/MCP tests, native PostgreSQL OAuth tests, ACL integration tests, and OpenAPI tests passed.
  • Full cleanup, lint, workspace type checks, repository audits, and migration safety checks passed.
  • Claude web/Desktop cloud connection still requires verification against the deployed HTTPS endpoint.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner September 8, 2026 22:33
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Sep 8, 2026 10:48pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous OAuth compatibility defect is fixed and no new actionable failures were identified.

Summary

  • Adds resource-bound, read-only Search grants with PKCE, refresh-token rotation, revocation, and public client registration.
  • Publishes OAuth resource metadata for organization and workspace Search endpoints.
  • Replaces API-key-oriented Search MCP setup with shared OAuth connection instructions.
  • Persists and verifies Search resource audiences while retaining compatibility for existing unbound api:read and api:write grants.
  • Adds database constraints, provider integration changes, and focused authorization, registration, token, UI, ACL, and OpenAPI tests.

Diagram

sequenceDiagram
    participant C as MCP Client
    participant M as Search MCP
    participant A as Sim OAuth Provider
    participant DB as OAuth Token Store
    participant S as Search Operations

    C->>M: Discover protected-resource metadata
    M-->>C: Authorization server and search:read scope
    C->>A: Register public client
    A-->>C: Client ID with PKCE required
    C->>A: Authorize with Search resource and PKCE
    A-->>C: Resource-bound authorization code
    C->>A: Exchange code and verifier
    A->>DB: Store resource-bound access and refresh tokens
    A-->>C: Access and refresh tokens
    C->>M: Search request with bearer token
    M->>DB: Verify token, resource, expiry, client, and user
    M->>S: Enforce scope, membership, and document ACLs
    S-->>C: Authorized search results
Loading

Comment thread apps/sim/lib/knowledge/mcp/route-handler.ts Outdated
Comment thread packages/db/migrations/0329_oauth_search_resources.sql
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1
waleedlatif1 merged commit 69e58ad into staging Sep 8, 2026
41 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/search-mcp-oauth branch September 8, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant