Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 11 min read Announcement easyNovice

Every app needs an MCP server, and you can build it with Neon

An MCP server lets users drive an app from AI assistants like ChatGPT, Claude and Cursor through tools the app defines, which keeps authorization and validation in app code instead of exposing the UI or raw database access. A production server needs a public HTTPS endpoint, OAuth 2.1 with Client ID Metadata Documents to identify users, per-user database access, and tool annotations to be listed in plugin stores. Neon's pitch covers each piece: Neon Functions host the server next to Postgres, Managed Better Auth's OAuth provider plugin issues tokens whose `sub` matches user IDs in the same database, and branches isolate development. A demo app (a 5x5 shared grid with a single paint_square tool) shows the whole build done through prompts to a coding agent.

Related posts

  • Bringing MCP to the Cloud

    Neon mediumAdept

    Neon moved its MCP server from a locally spawned stdio process authenticated by a long-lived API key to a hosted server at mcp.neon.tech, using SSE for server-to-client messages and HTTP POST to a /messages endpoint routed by an in-memory session map. Authentication uses OAuth 2.1: the MCP server acts as an OAuth server to MCP clients, with dynamic client registration, PKCE and refresh tokens, and as an OAuth client to Neon upstream. Each session gets its own MCP server instance scoped to the user's Neon token. The server runs as a Docker image on Fly. Open issues include the Node.js dependency introduced by mcp-remote and clients restarting the OAuth flow instead of using refresh tokens.

  • Solving the MCP Authentication Headache with Vercel & Better Auth

    Neon mediumAdept

    Remote MCP servers can authenticate users with OAuth instead of plaintext bearer tokens or UUIDs stored in a client's mcp.json, using Better Auth's MCP plugin together with Vercel's @vercel/mcp-adapter in a Next.js app. Setup touches three files: add the mcp plugin with a login page to the Better Auth config, expose the .well-known/oauth-authorization-server discovery route, and wrap the MCP handler so it resolves the user's session via getMCPSession and returns 401 when none exists. The session's user ID can then scope tool access to that user's own data. Clients such as Cursor, connecting through mcp-remote, open a login popup on first use.

  • Managed Better Auth is now an OAuth provider, with MCP support

    Neon mediumAdept

    Neon's Managed Better Auth now supports the OAuth Provider plugin, turning an auth instance into an OAuth 2.1 authorization server that both companion apps and MCP clients can use to sign users in. Neon runs the discovery endpoints, JWKS, token issuance and refresh, and client onboarding via Client ID Metadata Documents or optional dynamic registration. You host the login and consent pages and the resource server, where the new @neon/oauth SDK checks token signature, issuer and audience, with adapters for Express, Hono, Next.js and node:http. OAuth configuration is per branch, and each branch gets its own issuer while sharing signing keys, so preview-branch tokens are rejected by production verifiers that pin the issuer.

  • Give your Supabase app its own MCP server

    Supabase mediumAdept

    Supabase apps can expose their own MCP server so customers use the app from ChatGPT, Claude or other MCP clients, signed in with their existing account. An installable MCP Server block generates an Edge Function with an MCP handler, OAuth middleware and per-file tools. Supabase Auth acts as the OAuth 2.1 server, and `withSupabase({ auth: 'user' })` gives each tool a user-scoped client, so Postgres RLS policies govern what an agent can reach without a service role key. Setup requires asymmetric signing keys, dynamic client registration, a consent page and `verify_jwt = false` on the function; MCP Apps can render reused React components inside the chat.

  • Building Uscreen’s remote, multi-tenant MCP server inside a Rails app

    Evil Martians mediumAdept

    Evil Martians moved Uscreen's local, NPM-installed MCP server into Uscreen's Rails monolith, so creators connect an AI client by pasting a URL, signing in via OAuth, and approving access. The official `mcp` gem was chosen over fast-mcp for stateless Streamable HTTP transport, per-request `server_context`, and active maintenance. Doorkeeper provides OAuth 2.1 with dynamic client registration. 57 tools inherit from a shared `Mcp::ApplicationTool` base that handles scope checks, serialization and error mapping, and every lookup is scoped through the tenant Account. Structured ERB tool descriptions (purpose/returns/use_when/do_not_use_when) steer the model away from neighbouring tools, and destructive tools default to a dry-run preview, which is a safer default rather than an approval mechanism.

The quest for software engineering knowledge.

Look:
Layout: