Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

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.

GitHubEmbed

Описание

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 an McpServer into a Worker-compatible fetch handler
  • Minimal setup — define tools on an McpServer, pass it to createMcpHandler, 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

from github.com/tarsemx15-lgtm/mcp-workers

Установка CreateMcpHandler Server

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/tarsemx15-lgtm/mcp-workers

FAQ

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

Compare CreateMcpHandler Server with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории development