Next.js MCP Server
About
A Next.js-based MCP server with OAuth 2.1 authentication support using Google as the default provider. Requires a PostgreSQL database and optionally Redis for SSE transport.
Details
- Author
- run-llama
- Categories
- Developer Tools, Security
Jump to
Setup
Install Next.js MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/run-llama/mcp-nextjs
Follow the installation instructions in the repository README, then restart your MCP client.
[!CAUTION] This project is archived and no longer supported. Seethe docsfor the latest on connecting your agent to LlamaParse Platform APIs. Our production hosted MCP endpoint liveshere.
OAuth 2.1 MCP Server as a Next.js app on Vercel
This is a Next.js-based application that provides an MCP (Model Context Protocol) server with OAuth 2.1 authentication support. It is intended as a model for building your own MCP server in a Next.js context. It uses the@vercel/mcp-adapterto handle the MCP protocol, in order to support both SSE and Streamable HTTP transports.
In addition to being an OAuth server, it also requires the user authenticate. This is currently configured to use Google as a provider, but you could authenticate users however you want (X, GitHub, your own user/password database etc.) without breaking the OAuth flow.
Claude currently supports only the older SSE transport, so you need to give it a different URL to all the other clients listed here.
Use the "Connect Apps" button and select "Add Integration". Provide the URL likehttps://example.com/mcp/sse(the/sseat the end is important!). Note that Claude Desktop and Web will not accept alocalhostURL.
{ "mcpServers": { "MyServer": { "name": "LlamaIndex MCP Demo", "url": "https://example.com/mcp/mcp", "transport": "http-stream" }, } }
"mcp": { "servers": { "My Server": { "url": "https://example.com/mcp/mcp" } } }
Tell Inspector to connect tohttps://example.com/mcp/mcp, with Streamable HTTP transport. You can also use the SSE transport by connecting tohttps://example.com/mcp/sseinstead.
The very first time you will also need to runprisma db pushto create the database tables.
Required environment variables should be in.env: (not.env.localbecause Prisma doesn't support it)
DATABASE_URL="postgresql://user:pass@server/database" AUTH_SECRET="any random string" GOOGLE_CLIENT_ID="a Google OAuth client ID" GOOGLE_CLIENT_SECRET="a Google OAuth client secret" REDIS_URL="rediss://user:pass@host:6379"
DATABASE_URLis required for OAuth authentication to work, this is where sessions etc. live.
REDIS_URLis required if you need SSE transport to work (i.e. you want to support Claude Desktop and Web).
If you're using this as a template for your own Next.js app, the important parts are:
- /src/app/api/oauth/*- these implement oauth client registration and token exchange
- /src/app/oauth/authorize/page.tsx- this implements the oauth consent screen (it's extremely basic right now)
- /src/mcp/[transport]/route.ts- this implements the MCP server itself. Your tools, resources, etc. should be defined here.
To handle OAuth your app needs to be able to persist clients, access tokens, etc.. To do this it's using a PostgreSQL database accessed via Prisma. You can swap this for some other database if you want (it will be easiest if it's another Prisma-supported database).
- src/app/auth.ts- this implements Auth.js authentication to your app itself. It's configured to use Google as a provider, but you can change it to use any other provider supports by Auth.js. This is not required for the MCP server to work, but it's a good idea to have it in place for your own app.
- src/app/api/auth/[...nextauth]/route.ts- this plumbs in the Auth.js authentication, and is again not part of the OAuth implementation.
This app only works if deployed to Vercel currently, due to its dependence on the@vercel/mcp-adapterpackage, which in turn is required to support the old SSE transport. We didn't feel like implementing a whole extra protocol just for Claude Desktop.
Deploy as usual. You'll need to addprisma generateto your build command, and of course you'll need all the same environment variables as in the development environment.
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Model Context Protocol server for Skycloak managed Keycloak. Manage clusters, realms, applications, SSO and users from any MCP client.
The first MCP server governed by ICA. A remote streamable HTTP server at https://mcp.aleeth.com/mcp with 37 governed tools: every call is risk-checked by Rail Guard before it runs and sealed with a signed Ed25519 receipt on a hash-chained public ledger anchored to Bitcoin. Fails closed: no receipt, no response. OAuth 2.0 with RFC 9728 discovery; anonymous requests get 401. This repository is the public interface and provenance record: a generated tool manifest with per-tool annotations, an SBOM and vulnerability scan with digested provenance, and a TRUST.md of verify-it-yourself commands. The implementation is private by design. Independent probe grade A from mcp-spec-check, re-verified 2026-07-24.
Turn any OpenAPI spec into a hosted MCP server in 30 seconds. One typed tool per endpoint, server-side auth injection, stable URL across spec updates. EU-hosted, GDPR-native.
Discover powerful AI agents, invoke them instantly, and verify every result with Ed25519 cryptographic proofs. Nine tools — five free, four billed — all protected by OAuth 2.1.
AI-safe approval plan gated Kubernetes operations through MCP with OAuth, RBAC, audit, guardrails.
A remote MCP server with GitHub OAuth authentication and built-in analytics tracking.
A local MCP server that breaks on demand. Test your client against auth failures, disappearing tools, flaky responses, and token expiry, all from a web UI.
An MCP server with built-in GitHub OAuth support, deployable on Cloudflare Workers.
An MCP server with built-in GitHub OAuth support, designed for deployment on Cloudflare Workers.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





