Skip to main content
Glama
shricodev

updated mcp spec tut

by shricodev

updated mcp spec tut

node typescript cloudflare workers

Small MCP server that plays with the newer bits of the spec: elicitation (interactive confirm dialogs), signed request state, and cache hints on tools/list. Ships as a plain Node server and as a Cloudflare Worker, same handler underneath.

What it does

The deploy tool needs confirmation before it does anything. If the connecting client supports elicitation, the server pops a real confirm dialog and mints a signed, short lived state token to track that flow. If the client doesn't support elicitation, it falls back to a confirm: true argument instead. legacy-client-test.ts exercises that fallback path directly.

Every request builds a fresh McpServer instance, so server_stats shows you the process is stateless per request while list_deployments proves you can still keep real state around (in memory here, for the demo).

Related MCP server: MCP Gateway Demo

Run it

npm install
npm run server   # starts on http://127.0.0.1:3000/mcp
npm run client   # connects, deploys, reads it back

Cloudflare Worker

Same MCP handler, just wired through worker.ts and wrangler.jsonc.

npx wrangler dev
npx wrangler deploy

Set STATE_KEY in production so every instance verifies request state with the same secret.

Files

  • bot.ts: the actual MCP server and tools

  • server.ts: Node entrypoint (Hono + @hono/node-server)

  • worker.ts: Cloudflare Worker entrypoint

  • client.ts: demo client with elicitation support

  • legacy-client-test.ts: demo client without it, uses the fallback

enjoy!! :)

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A reference implementation of an MCP server built with Express that integrates full OAuth 2.1 authorization and RFC9728 protected resource metadata. It enables secure, authenticated communication between MCP clients and servers using streamable HTTP transport and built-in authorization flows.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides a sovereign, MIT-licensed MCP server for professional-service workflows, running entirely on your infrastructure with Ed25519 cryptographic signing for every action.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A complete MCP server implementation demonstrating all protocol features (tools, resources, prompts, sampling, and elicitation) with OAuth authentication, serving as a learning resource and starting template for building MCP servers.
    MIT