Skip to content

feat: mcp pipedream integration - #5578

Draft
ehayes2000 wants to merge 3 commits into
mainfrom
claude/nango-mcp-integration-cxin0n
Draft

feat: mcp pipedream integration#5578
ehayes2000 wants to merge 3 commits into
mainfrom
claude/nango-mcp-integration-cxin0n

Conversation

@ehayes2000

Copy link
Copy Markdown
Contributor

No description provided.

claude added 3 commits August 10, 2026 15:37
Replace the fragile parts of the in-house MCP OAuth machinery with Nango
(nango.dev) as the managed auth provider, so users can connect arbitrary
spec-compliant MCP servers to the agent:

- Nango's generic MCP integration handles OAuth endpoint discovery,
  dynamic client registration (DCR/CIMD), the consent flow (hosted
  Connect UI), token storage, and refresh. We store only the Nango
  connection ID (new nullable column on mcp_servers) and fetch fresh
  access tokens at connect time, cached in-process.
- New endpoints: POST /mcp/servers/nango/session mints a Connect session
  for the current user (optionally pre-filling the server URL so the UI
  goes straight to consent); POST /mcp/servers/nango/complete verifies
  the finished connection against Nango (existence + end-user ownership)
  before upserting the server row and firing the auth-completed hook.
  DELETE /mcp/servers now also revokes the Nango connection.
- NangoResolvingStore decorates the Pg server store, resolving tokens
  into records at load time, so the chat toolset and the import pipeline
  work with Nango-authorized servers unchanged.
- Connections settings page and onboarding connector steps connect
  through the Nango Connect UI (vendored minimal iframe client), with
  the legacy in-house OAuth flow kept as fallback for deployments
  without NANGO_SECRET_KEY and for servers that need pre-registered
  clients (GitHub, Slack).

Config (all optional, doppler): NANGO_SECRET_KEY, NANGO_API_URL
(default https://api.nango.dev), NANGO_MCP_INTEGRATION_ID (default
mcp-generic). Unset means Nango endpoints answer 501 and the legacy
flow keeps working.
Advertise every connectable MCP server instead of a hard-coded preset
list. New GET /mcp/servers/catalog merges two sources:

- A curated priority list (domain/service/catalog.rs) — the connectors we
  actively promote, pinned to the top with product-voice taglines and
  flagged `priority` so clients can render them as a featured section.
  Adding a connector there is all it takes to advertise it.
- The public MCP registry (registry.modelcontextprotocol.io), searched
  live (substring on server names, cursor pagination, version=latest),
  filtered to active servers with a plain streamable HTTP remote, and
  deduplicated against the priority tier. Pages are cached in-process
  for 5 minutes. MCP_REGISTRY_URL overrides the base URL if ever needed.

The catalog route gets its own small router state (registry + auth) since
it needs none of the per-user store/OAuth/Nango machinery.

The Connections settings page now shows connected servers and the featured
tier (served from bundled presets until the catalog answers, so nothing
jumps), plus a searchable "all connectors" card with debounced search
and load-more pagination. Connect buttons reuse the existing Nango flow
with the legacy fallback; icons come from our bundled SVGs when we have
them, the registry's icon otherwise. mcpUrlSupportsNango now keys off a
static URL set so GitHub/Slack route to the legacy flow even when reached
via the catalog rather than the (environment-gated) presets.
One way to connect MCP connectors, always Pipedream — no fallback paths.
Deletes the Nango integration and the entire legacy in-house OAuth
machinery (PKCE flow, AES-encrypted credential storage, Redis OAuth state,
pre-registered Slack/GitHub clients, OAuth callback endpoints).

How it works now:

- Pipedream Connect owns the account lifecycle: hosted consent UI,
  provider OAuth apps (no per-provider client registration on our side),
  credential storage, and refresh. We store only {app_slug, account_id}
  per user — the mcp_servers table is rebuilt around that (existing rows
  dropped; old grants have no forward path into Pipedream, users
  reconnect through the new flow).
- Tool calls go through Pipedream's remote MCP server
  (remote.mcp.pipedream.net), scoped per user + app via headers, in
  tools-only mode; account credentials are injected by Pipedream
  server-side and never transit our systems. Toolsets take an
  McpConnection port; unconfigured deployments come up empty.
- Connect flow: POST /mcp/servers/pipedream/token mints a Connect token,
  the frontend opens the hosted Connect UI (vendored minimal iframe
  client), and POST /mcp/servers/pipedream/complete verifies the reported
  account against Pipedream (existence + ownership by the calling user)
  before persisting and firing the auth-completed hook. DELETE revokes
  the Pipedream account.
- The connector catalog is backed by Pipedream's app directory (~2,500
  apps, searched with cursor pagination, auth-less apps filtered out),
  still merged with the curated priority tier pinned on top.
- Frontend: connections page and onboarding connector steps run the
  Pipedream flow; connected rows are enable/disable + remove (the
  unauthenticated half-state no longer exists). The custom add-by-URL
  dialog is gone — connectors come from the catalog.
- Import/onboarding gathers match connectors by app slug instead of
  server URL.

Config (doppler, document-cognition): PIPEDREAM_CLIENT_ID,
PIPEDREAM_CLIENT_SECRET, PIPEDREAM_PROJECT_ID; optional
PIPEDREAM_ENVIRONMENT (defaults production in prd, development
elsewhere), PIPEDREAM_API_URL, PIPEDREAM_MCP_URL. Unset means the MCP
connect/catalog endpoints answer 501 and toolsets are empty. Obsolete:
NANGO_*, MCP_REGISTRY_URL, SLACK_MCP_CLIENT_ID/SECRET,
GITHUB_CLIENT_ID/SECRET, MCP_CREDENTIALS_KEY_SECRET_NAME.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 54c89129-246c-4973-b663-9b2ca0f88534

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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