Universal MCP OAuth Gateway

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.

Category
Visit Server

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-server and /.well-known/openid-configuration with 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_URL or X-MCP-Target-URL.
  • 🖼️ 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

  1. Push this repository to GitHub.
  2. Import the project into Vercel.
  3. (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
    
  4. Click Deploy. Vercel will assign a public domain, e.g.: https://your-mcp-gateway.vercel.app

Step 2: Connect to Google Spark / Gemini

  1. In Google Spark, select Add Remote MCP Server.
  2. Enter your deployed MCP Endpoint URL:
    https://your-mcp-gateway.vercel.app/api/mcp
    
  3. Google Spark automatically discovers the OAuth endpoints at:
    https://your-mcp-gateway.vercel.app/.well-known/oauth-authorization-server
    
  4. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

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.

Official
Featured
Python
graphlit-mcp-server

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.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured