Skip to main content
Glama

MCP 서버 (createMcpHandler)

Cloudflare Workers에서 상태 비저장 MCP 서버를 실행하는 가장 간단한 방법입니다. Agents SDK의 createMcpHandler를 사용하여 모든 MCP 프로토콜 세부 사항을 한 줄로 처리합니다.

시연 내용

  • createMcpHandler — Agents SDK 헬퍼로, McpServer 팩토리를 Worker 호환 fetch 핸들러로 변환합니다.

  • 최소 설정 — 팩토리에서 도구를 정의하고, 팩토리를 createMcpHandler에 전달하면 완료됩니다.

  • 상태 비저장 — Durable Objects, 영구 상태 없음, 각 요청은 독립적입니다.

Related MCP server: createMcpHandler MCP Server

실행

pnpm install
pnpm start

브라우저를 열어 내장 도구 테스터를 확인하거나, MCP Inspectorhttp://localhost:5173/mcp에 연결하세요.

작동 방식

import { McpServer } from "@modelcontextprotocol/server";
import { createMcpHandler } from "agents/mcp/server";
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(request, env, ctx) {
    return createMcpHandler(createServer)(request, env, ctx);
  }
} satisfies ExportedHandler;

관련 예제

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • Cloudflare Workers MCP server: crypto-signal

View all MCP Connectors

Latest Blog Posts

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/Indxxr/mcp-worker'

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