Multi-tenant MCP server with OAuth: full tutorial and repo using Clerk and Arcade Cloud

manveerc · reddit · 2026-10-17

A developer shares a complete walkthrough for exposing a multi-tenant SaaS API to agents like Claude and ChatGPT via a custom MCP server deployed on Arcade Cloud, with OAuth handled by Clerk so customers sign in with existing credentials.

The key design: the model never handles an access token and can't choose which user it acts as — the API verifies the OAuth token and enforces workspace membership and plan-tier permissions on every call.

The trickiest insight is that "signing in" involves three separate concerns — gateway authentication, API authorization, and browser session verification — each with its own token flow; conflating them causes confusion. Full working code is on GitHub and the tutorial is on Substack. The author discloses their company provides services to Arcade, but says the choice to use it was independent.

Original post →

More from coding & agent

coding & agent channel →