Skip to main content
Glama
Floryvibla

Example Next.js MCP Server

by Floryvibla

Example Next.js MCP Server

This template uses mcp-handler 2 and the MCP TypeScript SDK v2 to add a stateless MCP server to a Next.js App Router application.

Usage

Update app/mcp/route.ts with your tools, prompts, and resources following the MCP TypeScript SDK v2 documentation.

Start the application and connect an MCP client to:

http://localhost:3000/mcp

Related MCP server: Next.js MCP Server Template

Protocol support

  • The current 2026-07-28 MCP protocol is served natively.

  • Stateless clients using 2025-era Streamable HTTP are supported by the compatibility layer.

  • The deprecated HTTP+SSE transport is not supported. Redis is not required.

Notes for running on Vercel

Sample Client

scripts/test-client.mjs connects over Streamable HTTP, lists the available tools, and calls echo.

pnpm test:client -- https://mcp-for-next-js.vercel.app

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A minimal MCP server demonstrating how to build ChatGPT-compatible applications using Next.js with widget rendering capabilities. Provides a starter template for integrating Next.js applications with the ChatGPT Apps SDK through the Model Context Protocol.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A template for deploying Model Context Protocol servers as Next.js routes using the mcp-handler adapter, enabling easy integration of MCP tools, prompts, and resources into any Next.js application.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Next.js-based MCP server using mcp-handler for Vercel deployment, supporting SSE transport and Redis integration.
    1
    MIT