Next.js MCP Server

Integrations
  • Allows integration of MCP servers into Next.js applications with specific route handling capabilities.

  • Enables Server-Sent Events (SSE) transport for MCP functionality when deployed on Vercel.

  • Provides TypeScript SDK support for defining tools, prompts, and resources in the MCP server implementation.

Uso de MCP sin cabeza (desde el Registro) con Next.js

Utiliza @vercel/mcp-adapter con un registro MCP configurable

URL implementada

Esta aplicación se implementa en: https://nextjs-mcp-use.vercel.app

Características

  • Registro MCP : configure varios servidores MCP en un solo archivo JSON
  • Acciones de GitHub : Pruebe y monitoree sus puntos finales de API con flujos de trabajo programados y manuales
  • Manejo de errores : manejo elegante de tiempos de espera y fallas de conexión
  • Variables de entorno : configure las variables de entorno para cada servidor MCP

Registro MCP

El registro de MCP es un archivo de configuración JSON que almacena información sobre todos los servidores MCP disponibles. Cada servidor puede habilitarse o deshabilitarse y tener sus propias variables de entorno.

El registro se encuentra en config/mcp-registry.json y tiene la siguiente estructura:

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

Uso

Esta aplicación de muestra utiliza el adaptador MCP de Vercel que le permite instalar un servidor MCP en un grupo de rutas en cualquier proyecto Next.js.

Actualice app/[transport]/route.ts con sus herramientas, indicaciones y recursos siguiendo la documentación del SDK de TypeScript de MCP .

Puntos finales de API

  • API de chat : /api/chat - Punto final de chat en streaming
  • API de finalizaciones : /api/completions - Punto final de finalizaciones de chat sin transmisión

Probando la API

Puede probar los puntos finales de la API utilizando el script de prueba proporcionado:

# 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"

Acciones de GitHub

Este proyecto incluye flujos de trabajo de GitHub Actions para probar y supervisar los puntos finales de la API. Consulta el archivo .github/workflows/README.md para obtener más información.

Notas para ejecutar en Vercel

  • Para utilizar el transporte SSE, se requiere un Redis adjunto al proyecto en process.env.REDIS_URL
  • Asegúrese de tener habilitado el cálculo Fluid para una ejecución eficiente
  • Después de habilitar el cómputo Fluid, abra app/route.ts y ajuste maxDuration a 800 si usa una cuenta Vercel Pro o Enterprise
  • Implementar la plantilla MCP de Next.js

Cliente de muestra

  • scripts/test-client.mjs contiene un cliente de muestra para probar invocaciones.
node scripts/test-client.mjs https://nextjs-mcp-use.vercel.app
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Una implementación de servidor MCP de muestra para proyectos Next.js que utiliza el adaptador MCP de Vercel para manejar solicitudes de protocolo en diferentes métodos de transporte.

  1. URL implementada
    1. Características
      1. Registro MCP
        1. Uso
          1. Puntos finales de API
          2. Probando la API
        2. Acciones de GitHub
          1. Notas para ejecutar en Vercel
            1. Cliente de muestra

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                MCP Server for the Perplexity API.
                Last updated -
                50
                Python
                MIT License
                • Linux
                • Apple
              • A
                security
                A
                license
                A
                quality
                An MCP server that provides tools for interacting with Vercel API, enabling management of deployments, DNS records, domains, projects, and environment variables through natural language.
                Last updated -
                7
                65
                3
                TypeScript
                MIT License
              • -
                security
                A
                license
                -
                quality
                An MCP server that enables fetching web content using the Node.js undici library, supporting various HTTP methods, content formats, and request configurations.
                Last updated -
                66
                8
                TypeScript
                MIT License
                • Apple
                • Linux
              • A
                security
                F
                license
                A
                quality
                An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
                Last updated -
                39
                26
                • Apple

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/cameronking4/nextjs-mcp-use'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server