OKR Manager 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., "@OKR Manager MCP Serverlist objectives for my team this quarter"
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.
Workers + Stytch OKR Manager 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 with
createMcpHandlerfrom the Agents SDK
Member, Tenant, and client identity is managed using Stytch. Put together, these three features show how to extend a traditional full-stack CRUD application for use by an AI agent.
This demo uses the Stytch B2B product, which is purpose-built for B2B SaaS authentication requirements like multi-tenancy, MFA, and RBAC. If you are more interested in Stytch's Consumer product, see this demo instead.
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.
We will be creating a complex RBAC policy with 3 personas that interacts with both Stytch-defined resources and custom resources managed by the application. At the end we will have:
A
stytch_adminrole with universal access to all resources within an organization. They will have control overobjectives,key_results, and all predefined Stytch resources like members, authentication settings, and SSO configuration.A
managerrole with partial access to most resources - they may invite new members and managekey_results, but cannot set top-level companyobjectivesA
stytch_memberrole with limited access to most resources - they may viewobjectivesand update their progress on achievingkey_results
We will also create a set of scopes that our users can grant to third-party applications. In order for a user to grant a scope to an application, they must have all of the permissions that scope encompasses. For example
The
read:okrsscope requests onlyreadaccess on resources, and is grantable by all membersThe
manage:krsscope requests write access to thekey_resultsresource, and is grantable by members with themanagerorstytch_adminrole, but not members with thestytch_userroleThe
manage:objectivesscope requests write access to theobjectives, and is only grantable by members with thestytch_adminrole
In the Stytch Dashboard
Create a Stytch account. Within the sign up flow select B2B 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
Navigate to Project Settings to view your Project ID and API keys. You will need these values later.
Navigate to Management API and create a new workspace management key. Copy the Key ID and Secret, you will need these values later.
On your machine
In your terminal, clone the project and install dependencies:
git clone https://github.com/cloudflare/agents.git
cd agents/demos/mcp-stytch-b2b-okr-manager
npm iCreate an
.env.localfile by running the command below which copies the contents of.env.template.
cp .env.template .env.local
cp .dev.vars.template .dev.varsOpen
.env.localin the text editor of your choice, and set the environment variables using thepublic_tokenandproject domainfound 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=https://project-domain.customers.stytch.devOpen
.dev.varsin the text editor of your choice, and set the environment variables using theProject ID,Project DomainandSecretfound on Project Settings.
// This is what a completed .dev.vars file will look like
STYTCH_PROJECT_ID=project-test-6c20cd16-73d5-44f7-852c-9a7e7b2ccf62
STYTCH_PROJECT_SECRET=secret-test-.....
STYTCH_DOMAIN=https://project-domain.customers.stytch.devUpdate your Stytch RBAC Policy by running the following command, using the workspace management
Key IDandSecretyou created earlier, and theProject IDfound on Project Settings. You can view and edit the created RBAC Roles, Resources and Scopes in Roles & Permissions.
// Using example credentials, replace with your own
npm run update-policy -- --key-id "workspace-key-prod-4881b817-6336-410a-a953-6eceabaf5xc9" --secret "6ZcNGH7v9Oxxxxxxxxxx" --project-id "project-test-6c20cd16-73d5-44f7-852c-9a7e7b2ccf62"Related MCP server: Supabase User MCP
Running locally
After completing all the setup steps above the application can be run with the command:
npm run devThe application will be available at http://localhost:3000 and the MCP server will be available at http://localhost:3000/mcp.
Test your MCP server using the MCP Inspector
npx @modelcontextprotocol/inspector@latestNavigate to the URL where the Inspector is running, and input the following values:
Transport Type:
Streamable HTTPURL:
http://localhost:3000/mcp
Click Connect to test the authorization flow and interacting with the Objectives and Key Results via your MCP Server!
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 OKR Manager app to use
npx wrangler kv namespace create OKRManagerKVUpdate the KV namespace ID in
wrangler.jsoncwith the ID you received:
"kv_namespaces": [
{
"binding": "OKRManagerKV",
"id": "your-kv-namespace-id"
}
]Upload your Stytch Project ID and Secret Env Vars for use by the worker
npx wrangler secret bulk .dev.varsDeploy the worker
npm run deployGrant your deployment access to your Stytch project. Assuming your Stytch project was deployed at
https://mcp-stytch-b2b-okr-manager.$YOUR_ACCOUNT_NAME.workers.dev:Add
https://mcp-stytch-b2b-okr-manager.$YOUR_ACCOUNT_NAME.workers.dev/authenticateas an allowed Redirect URLAdd
https://mcp-stytch-b2b-okr-manager.$YOUR_ACCOUNT_NAME.workers.devas an allowed Authorized Application in the Frontend SDKs configuration
Get help and join the community
:speech_balloon: Stytch community Slack
Join the discussion, ask questions, and suggest new features in our Slack community!
Related MCP Connectors
Connect AI agents to 1000+ apps with managed authentication and tool-calling.
Hosted login, teams, billing and feature flags for your SaaS app, set up by your AI assistant.
Context and control for any AI. Agent identity, scoped access, and proof across tools.
- ElaichiOAuthai.elaichi
Governed AI agents for the software your company already runs. 400+ connectors, one endpoint.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to provision and manage external SaaS services (Clerk, Stripe, Resend, etc.) by authenticating and creating resources via YAML configuration.22 npm-
- AlicenseNot gradedqualityBmaintenanceExperimental read-only MCP for Supabase application data: memory_search, memory_get and memory_list_recent under user-bound PostgreSQL RLS. Setup and demo: https://github.com/jryski/Supabase_user_MCP/blob/main/docs/GETTING_STARTED.md . Public preview is POSIX-only and synthetic-only; native Windows, hosted OAuth, one-click installation and writes are not available.Apache 2.0
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to securely call enterprise MCP tools with tenant-scoped RBAC, human approvals, audit logging, and multi-tool workflows across customer, order, document, and ticket data.-
- AlicenseNot gradedqualityBmaintenanceEnables autonomous AI agents to securely access and execute external tools, such as GitHub REST API operations, with per-user authentication, authorization, audit logging, and observability.MIT