Hello MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Hello MCP Serversay hello to Alice"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server (createMcpHandler)
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 turns anMcpServerfactory into a Worker-compatible fetch handlerMinimal setup — define tools in a factory, pass the factory to
createMcpHandler, doneStateless — no Durable Objects, no persistent state, each request is independent
Related MCP server: sentiment-analyzer
Running
pnpm install
pnpm startOpen the browser to see the built-in tool tester, or connect with the MCP Inspector at http://localhost:5173/mcp.
How it works
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;Related examples
mcp— stateful MCP server withMcpAgentand Durable Objectsmcp-worker-authenticated— adding OAuth authenticationmcp-client— connecting to MCP servers as a client
Related MCP Connectors
Generate quick, friendly greetings by name. Personalize salutations for any context. Explore the o…
Send friendly, personalized greetings on demand. Generate quick salutations with a simple prompt.…
Craft quick, personalized greetings by name. Generate ready-to-use greeting prompts for a consiste…
Send friendly, personalized greetings by name. Switch to a playful pirate voice for themed salutat…
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to greet users in 7 different languages including English, Spanish, French, German, Japanese, Chinese, and Korean. A lightweight multilingual greeting tool for the Model Context Protocol.MIT
- AlicenseNot gradedqualityDmaintenanceProvides a hello and echo tool for basic interaction.21 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA simple MCP server built with Next.js that provides a greet_user tool to return friendly greetings, either general or personalized.10 npmMIT
- AlicenseNot gradedqualityCmaintenanceExposes a greet tool that takes a name and returns a greeting message.5 npmISC