Universal MCP OAuth Gateway
A deployable serverless MCP OAuth gateway and proxy that adds OAuth 2.0 authentication to Excalidraw tools or any external MCP server, enabling secure connections from clients like Google Spark and Gemini.
README
Universal MCP OAuth Gateway (with Excalidraw & Proxy Support)
A deployable, serverless Universal Model Context Protocol (MCP) OAuth Gateway & Proxy built on Next.js 14.
This project allows you to attach OAuth 2.0 authentication to Excalidraw OR ANY external MCP server so enterprise clients like Google Spark & Gemini Agents can connect seamlessly without OAuth rejection errors.
How It Works
[Google Spark Client] ──(OAuth 2.0 Auth + Discovery)──> [Universal MCP OAuth Gateway on Vercel]
│
┌──────────────────────────┴──────────────────────────┐
▼ ▼
[Built-in Tools: Excalidraw, SVG, Mindmaps] [Proxy Mode: Any External Remote MCP Server]
Features
- 🔐 Universal OAuth 2.0 Auth Server: Implements
/.well-known/oauth-authorization-serverand/.well-known/openid-configurationwith RFC 7591 dynamic client registration. - 🌐 MCP Server & Proxy Gateway:
- Mode 1 (Built-in): Excalidraw tools (
create_diagram,generate_flowchart,generate_mindmap,export_svg,view_diagram) & web utilities. - Mode 2 (Universal Proxy): Proxies JSON-RPC 2.0 requests to any unauthenticated remote MCP server specified via
UPSTREAM_MCP_URLorX-MCP-Target-URL.
- Mode 1 (Built-in): Excalidraw tools (
- 🖼️ Interactive Web Viewer: Embedded viewer at
/view/[id]allowing users & AI agents to inspect, copy, and download rendered Excalidraw diagrams as SVG. - ⚡ 100% Vercel Native: Uses stateless JWT tokens—no database setup required.
Google Spark Connection & Deployment Instructions
Step 1: Deploy to Vercel
- Push this repository to GitHub.
- Import the project into Vercel.
- (Optional for Proxy Mode): If you want to proxy another unauthenticated MCP server, add an Environment Variable in Vercel:
UPSTREAM_MCP_URL = https://your-other-mcp-server.com/api/mcp - Click Deploy. Vercel will assign a public domain, e.g.:
https://your-mcp-gateway.vercel.app
Step 2: Connect to Google Spark / Gemini
- In Google Spark, select Add Remote MCP Server.
- Enter your deployed MCP Endpoint URL:
https://your-mcp-gateway.vercel.app/api/mcp - Google Spark automatically discovers the OAuth endpoints at:
https://your-mcp-gateway.vercel.app/.well-known/oauth-authorization-server - Complete the one-click authorization prompt. Google Spark can now invoke tools from Excalidraw or your proxied MCP server!
API Endpoints
| Endpoint | Description |
|---|---|
GET /.well-known/oauth-authorization-server |
OAuth 2.0 Server Discovery Metadata (RFC 8414) |
GET /.well-known/openid-configuration |
OpenID Connect Discovery Metadata |
POST /api/auth/register |
RFC 7591 Dynamic Client Registration |
GET /api/auth/authorize |
OAuth Authorization endpoint |
POST /api/auth/token |
OAuth Token Exchange endpoint |
POST /api/mcp |
MCP HTTP JSON-RPC 2.0 Tool Execution / Proxy Endpoint |
GET /api/mcp/sse |
MCP Server-Sent Events Transport |
GET /view/[id] |
Interactive Excalidraw Canvas Viewer |
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.