CreateMcpHandler Server
БесплатноНе проверенSimplest way to run a stateless MCP server on Cloudflare Workers, using createMcpHandler from the Agents SDK to handle MCP protocol details in one line.
Описание
Simplest way to run a stateless MCP server on Cloudflare Workers, using createMcpHandler from the Agents SDK to handle MCP protocol details in one line.
README
The simplest way to run a stateless MCP server on Cloudflare Workers. Uses createMcpHandler from the Agents SDK to handle all MCP protocol details in one line.
What it demonstrates
createMcpHandler— the Agents SDK helper that wraps anMcpServerinto a Worker-compatible fetch handler- Minimal setup — define tools on an
McpServer, pass it tocreateMcpHandler, done - Stateless — no Durable Objects, no persistent state, each request is independent
Running
npm install
npm run dev
Open the browser to see the built-in tool tester, or connect with the MCP Inspector at http://localhost:5173/mcp.
How it works
import { createMcpHandler } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
function createServer() {
const server = new McpServer({ name: "Hello MCP Server", version: "1.0.0" });
server.registerTool(
"hello",
{
description: "Returns a greeting",
inputSchema: { name: z.string().optional() }
},
async ({ name }) => ({
content: [{ type: "text", text: `Hello, ${name ?? "World"}!` }]
})
);
return server;
}
export default {
fetch: async (request, env, ctx) => {
const server = createServer();
return createMcpHandler(server)(request, env, ctx);
}
};
Related examples
- mcp — stateful MCP server with
McpAgentand Durable Objects - mcp-worker-authenticated — adding OAuth authentication
- mcp-client — connecting to MCP servers as a client
Установка CreateMcpHandler Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/tarsemx15-lgtm/mcp-workersFAQ
CreateMcpHandler Server MCP бесплатный?
Да, CreateMcpHandler Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для CreateMcpHandler Server?
Нет, CreateMcpHandler Server работает без API-ключей и переменных окружения.
CreateMcpHandler Server — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить CreateMcpHandler Server в Claude Desktop, Claude Code или Cursor?
Открой CreateMcpHandler Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare CreateMcpHandler Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
