Hosts the MCP server using Workers Durable Objects, leverages Workers KV for data storage, and serves static assets through Worker Assets
Provides repository hosting and deployment integration through the 'Deploy to Cloudflare' button functionality
Provides the framework for building the REST API component of the application
Powers the static website component of the application, built using React and Vite
Offers community support through the Stytch Slack community for discussion and troubleshooting
Used alongside React to build the static website component of the application
Workers + Stytch TODO App MCP Server
This is a Workers server that composes three functions:
- A static website built using React and Vite on top of Worker Assets
- A REST API built using Hono on top of Workers KV
- A Model Context Protocol Server built using on top of Workers Durable Objects
User and client identity is managed using Stytch. Put together, these three features show how to extend a traditional full-stack application for use by an AI agent.
This demo uses the Stytch Consumer product, which is purpose-built for Consumer SaaS authentication requirements. If you are more interested in Stytch's B2B product, see this demo instead.
Set up
Follow the steps below to get this application fully functional and running using your own Stytch credentials.
In the Stytch Dashboard
- Create a Stytch account. Within the sign up flow select Consumer Authentication as the authentication type you are interested in. Once your account is set up a Project called "My first project" will be automatically created for you.
- Navigate to Frontend SDKs to enable the Frontend SDK in Test
- Navigate to Connected Apps to enable Dynamic Client Registration and configure your authorization URL as
http://localhost:3000/oauth/authorize
. - Navigate to Project Settings to view your Project Domain, Project ID, and API keys. You will need these values later.
On your machine
In your terminal clone the project and install dependencies:
Next, create an .env.local
file by running the command below which copies the contents of .env.template
.
Open .env.local
in the text editor of your choice, and set the environment variables using the public_token
and project domain
found on Project Settings.
Create a .dev.vars
file by running the command below which copies the contents of .dev.vars.template
Open .dev.vars
in the text editor of your choice, and set the environment variables using the Project ID
and Secret
found on Project Settings.
Running locally
After completing all the setup steps above the application can be run with the command:
The application will be available at http://localhost:3000
and the MCP server will be available at http://localhost:3000/sse
.
Test your MCP server using the MCP Inspector
Deploy to Cloudflare Workers
Click the button - you'll need to configure environment variables after the initial deployment.
Or, if you want to follow the steps by hand:
- Create a KV namespace for the TODO app to use
- Update the KV namespace ID in
wrangler.jsonc
with the ID you received:
- Upload your Stytch Env Vars for use by the worker
- Deploy the worker
- Grant your deployment access to your Stytch project. Assuming your Stytch project was deployed at
https://mcp-stytch-consumer-todo-list.$YOUR_ACCOUNT_NAME.workers.dev
:- Add
https://mcp-stytch-consumer-todo-list.$YOUR_ACCOUNT_NAME.workers.dev/authenticate
as an allowed Redirect URL - Add
https://mcp-stytch-consumer-todo-list.$YOUR_ACCOUNT_NAME.workers.dev
as an allowed Authorized Application in the Frontend SDKs configuration
- Add
Get help and join the community
: Stytch community Slack
Join the discussion, ask questions, and suggest new features in our Slack community!
This server cannot be installed
A Cloudflare Workers server that extends a traditional full-stack TODO application with Model Context Protocol support, enabling AI agents to interact with the app through Stytch authentication.
Related MCP Servers
- -securityFlicense-qualityA deployable Model Context Protocol server on Cloudflare Workers that operates without authentication, allowing connection to AI assistants like Claude Desktop and Cloudflare AI Playground.Last updated -TypeScript
- -securityFlicense-qualityA Cloudflare Workers-based Model Context Protocol server that can be deployed without authentication requirements, allowing users to create custom AI tools accessible from Cloudflare AI Playground or Claude Desktop.Last updated -TypeScript
- -securityFlicense-qualityA deployable Cloudflare Workers service that implements Model Context Protocol without authentication, allowing AI models to access custom tools via clients like Claude Desktop or Cloudflare AI Playground.Last updated -TypeScript
- -securityFlicense-qualityA deployable server on Cloudflare Workers that provides Model Context Protocol tools without requiring authentication, allowing easy integration with AI models like Claude Desktop and the Cloudflare AI Playground.Last updated -TypeScript