Skip to main content
Glama

Workers + Stytch TODO App MCP Server

by dandalgatov
index.ts976 B
import { Hono } from "hono"; import { cors } from "hono/cors"; import { stytchBearerTokenAuthMiddleware } from "./lib/auth"; import { TodoAPI } from "./TodoAPI.ts"; import { TodoMCP } from "./TodoMCP.ts"; // Export the TodoMCP class so the Worker runtime can find it export { TodoMCP }; export default new Hono<{ Bindings: Env }>() .use(cors()) // Mount the TODO API underneath us .route("/api", TodoAPI) // Serve the OAuth Authorization Server response for Dynamic Client Registration .get("/.well-known/oauth-protected-resource", async (c) => { const url = new URL(c.req.url); return c.json({ resource: url.origin, authorization_servers: [`https://${c.env.STYTCH_DOMAIN}`], }); }) // Let the MCP Server have a go at handling the request .use("/sse/*", stytchBearerTokenAuthMiddleware) .route("/sse", new Hono().mount("/", TodoMCP.mount("/sse").fetch)) // Finally - serve static assets from Vite .mount("/", (req, env) => env.ASSETS.fetch(req));

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/dandalgatov/mcp-stytch-consumer-todo-list-server'

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