mcp-stytch-consumer-todo-list
An MCP server that manages a TODO list with user authentication via Stytch, enabling AI agents to interact with a full-stack application.
README
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.
[!WARNING] This is a demo template designed to help you get started quickly. While we have implemented several security controls, you must implement all preventive and defense-in-depth security measures before deploying to production. Please review our comprehensive security guide: Securing MCP Servers
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:
git clone https://github.com/cloudflare/ai.git
cd ai
npm i
cd demos/mcp-stytch-consumer-todo-list
Next, create an .env.local file by running the command below which copies the contents of .env.template.
cp .env.template .env.local
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.
# This is what a completed .env.local file will look like
VITE_STYTCH_PUBLIC_TOKEN=public-token-test-abc123-abcde-1234-0987-0000-abcd1234
VITE_STYTCH_DOMAIN=random-domain-name.customers.stytch.dev
Create a .dev.vars file by running the command below which copies the contents of .dev.vars.template
cp .dev.vars.template .dev.vars
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.
// This is what a completed .dev.vars file will look like
STYTCH_PROJECT_ID=project-test-6c20cd16-73d5-44f7-852c-9a7e7b2ccf62
Running locally
After completing all the setup steps above the application can be run with the command:
npm run dev
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
npx @modelcontextprotocol/inspector@latest
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
wrangler kv namespace create TODOS
- Update the KV namespace ID in
wrangler.jsoncwith the ID you received:
"kv_namespaces": [
{
"binding": "TODOS",
"id": "your-kv-namespace-id"
}
]
- Upload your Stytch Env Vars for use by the worker
npx wrangler secret bulk .dev.vars
- Deploy the worker
npm run deploy
- 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/authenticateas an allowed Redirect URL - Add
https://mcp-stytch-consumer-todo-list.$YOUR_ACCOUNT_NAME.workers.devas an allowed Authorized Application in the Frontend SDKs configuration
- Add
Get help and join the community
:speech_balloon: Stytch community Slack
Join the discussion, ask questions, and suggest new features in our Slack community!
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。