Handler
БесплатноНе проверенVercel MCP Adapter for Next.js and other frameworks
Описание
Vercel MCP Adapter for Next.js and other frameworks
README
A Vercel adapter for the Model Context Protocol (MCP), enabling real-time communication between your applications and AI models. Supports Next.js and Nuxt.
Installation
npm install mcp-handler @modelcontextprotocol/[email protected] zod@^3
Note: Versions of
@modelcontextprotocol/sdkprior to 1.26.0 have a security vulnerability. Use version 1.26.0 or later.
Quick Start (Next.js)
// app/api/[transport]/route.ts
import { createMcpHandler } from "mcp-handler";
import { z } from "zod";
const handler = createMcpHandler(
(server) => {
server.registerTool(
"roll_dice",
{
title: "Roll Dice",
description: "Roll a dice with a specified number of sides.",
inputSchema: {
sides: z.number().int().min(2),
},
},
async ({ sides }) => {
const value = 1 + Math.floor(Math.random() * sides);
return {
content: [{ type: "text", text: `🎲 You rolled a ${value}!` }],
};
}
);
},
{},
{
basePath: "/api", // must match where [transport] is located
maxDuration: 60,
verboseLogs: true,
}
);
export { handler as GET, handler as POST };
Connecting Clients
If your client supports Streamable HTTP, connect directly:
{
"remote-example": {
"url": "http://localhost:3000/api/mcp"
}
}
For stdio-only clients, use mcp-remote:
{
"remote-example": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/api/mcp"]
}
}
Documentation
- Client Integration - Claude Desktop, Cursor, Windsurf setup
- Authorization - OAuth and token verification
- Advanced Usage - Dynamic routing, Nuxt, configuration options
Features
- Framework Support: Next.js and Nuxt
- Multiple Transports: Streamable HTTP and Server-Sent Events (SSE)
- Redis Integration: Optional, for SSE transport resumability
- TypeScript Support: Full type definitions included
Requirements
- Next.js 13+ or Nuxt 3+
- Node.js 18+
- Redis (optional, for SSE)
License
Apache-2.0
Установить Handler в Claude Desktop, Claude Code, Cursor
unyly install handlerСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add handler -- npx -y mcp-handlerFAQ
Handler MCP бесплатный?
Да, Handler MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Handler?
Нет, Handler работает без API-ключей и переменных окружения.
Handler — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Handler в Claude Desktop, Claude Code или Cursor?
Открой Handler на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Handler with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
