Skip to content

feat: add OAuth for hosted MCP connectors - #229

Merged
MiniMax-AI-Dev merged 13 commits into
feature/mcp-directoryfrom
feature/mcp-directory-oauth-foundation
Jul 30, 2026
Merged

feat: add OAuth for hosted MCP connectors#229
MiniMax-AI-Dev merged 13 commits into
feature/mcp-directoryfrom
feature/mcp-directory-oauth-foundation

Conversation

@kapelame

@kapelame kapelame commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add OAuth support for hosted MCP connectors on top of the MCP Connector Directory core in #223. Notion is introduced directly with the final shared mcp_oauth credential model, so imported capabilities never depend on the legacy notion_integration token kind.

Scope

  • Discover OAuth protected-resource and authorization-server metadata.
  • Support dynamic client registration and PKCE authorization in a popup flow.
  • Add the built-in mcp_oauth credential kind and migration for existing deployments.
  • Store and refresh OAuth tokens through the existing encrypted secrets infrastructure.
  • Store the connector identity in the existing Secret provider field and the shared kind in existing Secret metadata.
  • Add Notion 1.0.0 through its official hosted MCP endpoint with the explicit default scope.
  • Render authenticated Streamable HTTP MCP configuration for Claude Code, Codex, and OpenCode.
  • Require a successful OAuth connection before importing an authenticated directory item.

Reuse and boundaries

  • Reuses the existing secrets table, encryption service, credential kind registry, Capability import, versioning, rendering, and runtime paths.
  • Adds no Connector, OAuth-token, or credential-binding table.
  • Does not add capability-level credential selection; that is handled by feat: bind shared credentials to agent capabilities #230.
  • Workspace Members may import an already connected connector, but only owners and admins may create or overwrite the shared Workspace OAuth credential.

Security

  • OAuth endpoints come from the server-owned catalog and discovery documents, not request parameters.
  • Catalog entries declare the exact requested OAuth scopes; Parsar no longer requests every scope advertised by discovery.
  • PKCE S256, state validation, callback cookies, HTTP timeouts, response size limits, and issuer validation are enforced.
  • The production OAuth HTTP client limits redirects, rejects redirects to HTTP, and blocks localhost, private, link-local, metadata, and DNS-resolved private destinations.
  • Tokens are never returned by directory APIs or written to logs.

Verification

  • make check
  • Migration and Store integration smoke test
  • MCP OAuth discovery, scope, redirect, private-address, exchange, and refresh tests
  • Directory role, import, renderer, runtime, Store, and frontend checks
  • OpenAPI regeneration
  • git diff --check

Dependencies

@MiniMax-AI-Dev
MiniMax-AI-Dev merged commit a05752e into feature/mcp-directory Jul 30, 2026
16 checks passed
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.

2 participants