JUHE API Marketplace
cameronking4 avatar
MCP Server

Next.js MCP Server

A sample MCP server implementation for Next.js projects that uses the Vercel MCP Adapter to handle protocol requests across different transport methods.

2
GitHub Stars
11/22/2025
Last Updated
No Configuration
Please check the documentation below.
  1. Home
  2. MCP Servers
  3. nextjs-mcp-use

README Documentation

Headless MCP-use (from Registry) with Next.js

Uses @vercel/mcp-adapter with a configurable MCP registry

Deployed URL

This application is deployed at: https://nextjs-mcp-use.vercel.app

Features

  • MCP Registry: Configure multiple MCP servers in a single JSON file
  • GitHub Actions: Test and monitor your API endpoints with scheduled and manual workflows
  • Error Handling: Graceful handling of timeouts and connection failures
  • Environment Variables: Configure environment variables for each MCP server

MCP Registry

The MCP registry is a JSON configuration file that stores information about all available MCP servers. Each server can be enabled or disabled, and can have its own environment variables.

The registry is located at config/mcp-registry.json and has the following structure:

{
  "server-name": {
    "url": "http://localhost:3002/sse",
    "enabled": true,
    "env": {
      "API_KEY": "your-api-key"
    }
  },
  "another-server": {
    "url": "https://example.com/sse",
    "enabled": false
  }
}

Usage

This sample app uses the Vercel MCP Adapter that allows you to drop in an MCP server on a group of routes in any Next.js project.

Update app/[transport]/route.ts with your tools, prompts, and resources following the MCP TypeScript SDK documentation.

API Endpoints

  • Chat API: /api/chat - Streaming chat endpoint
  • Completions API: /api/completions - Non-streaming chat completions endpoint

Testing the API

You can test the API endpoints using the provided test script:

# Test the chat endpoint
npm run test:chat -- --message "Your message here"

# Test the completions endpoint
npm run test:completions -- --message "Your message here"

# Test with a custom URL
npm run test:chat -- --url http://localhost:3000/api/chat --message "Your message here"

GitHub Actions

This project includes GitHub Actions workflows for testing and monitoring the API endpoints. See the .github/workflows/README.md file for more information.

Notes for running on Vercel

  • To use the SSE transport, requires a Redis attached to the project under process.env.REDIS_URL
  • Make sure you have Fluid compute enabled for efficient execution
  • After enabling Fluid compute, open app/route.ts and adjust maxDuration to 800 if you using a Vercel Pro or Enterprise account
  • Deploy the Next.js MCP template

Sample Client

  • scripts/test-client.mjs contains a sample client to try invocations.
node scripts/test-client.mjs https://nextjs-mcp-use.vercel.app

Quick Actions

View on GitHubView All Servers

Key Features

Model Context Protocol
Secure Communication
Real-time Updates
Open Source

Boost your projects with Wisdom Gate LLM API

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.

Learn More
JUHE API Marketplace

Accelerate development, innovate faster, and transform your business with our comprehensive API ecosystem.

JUHE API VS

  • vs. RapidAPI
  • vs. API Layer
  • API Platforms 2025
  • API Marketplaces 2025
  • Best Alternatives to RapidAPI

For Developers

  • Console
  • Collections
  • Documentation
  • MCP Servers
  • Free APIs
  • Temp Mail Demo

Product

  • Browse APIs
  • Suggest an API
  • Wisdom Gate LLM
  • Global SMS Messaging
  • Temp Mail API

Company

  • What's New
  • Welcome
  • About Us
  • Contact Support
  • Terms of Service
  • Privacy Policy
Featured on Startup FameFeatured on Twelve ToolsFazier badgeJuheAPI Marketplace - Connect smarter, beyond APIs | Product Huntai tools code.marketDang.ai
Copyright © 2025 - All rights reserved