WorkOS MCP server

Integrates with WorkOS API to enable enterprise-grade authentication and user management features like Single Sign-On and Multi-Factor Authentication for secure, scalable identity management in AI workflows.
Back to servers
Provider
zueai
Release date
Feb 26, 2025
Language
TypeScript
Stats
4 stars

This MCP server provides a lightweight implementation of the Model Control Protocol, enabling Cursor Agents to interact with the WorkOS API through Cloudflare Workers. It serves as a bridge between your agents and WorkOS functionality.

Installation and Setup

Prerequisites

  • Bun runtime
  • A Cloudflare account
  • Cursor editor with agent capabilities

Quick Installation

  1. Clone and deploy the MCP server to your Cloudflare account:
bun create mcp --clone https://github.com/zueai/workos-mcp
  1. Configure Cursor to use your new MCP server:

    • Open Cursor Settings
    • Navigate to MCP section
    • Click "Add new MCP server"
    • Paste the command that was copied to your clipboard
  2. Add your WorkOS credentials as environment secrets:

bunx wrangler secret put WORKOS_API_KEY
bunx wrangler secret put WORKOS_CLIENT_ID

Updating the Server

After making changes to your MCP server, deploy the updates with:

bun run deploy

Then reload your Cursor window to access the updated tools.

Creating Custom Tools

The MCP server provides tools defined as methods in the MyWorker class. Each method automatically becomes available as a tool for your agent.

Tool Creation Example

To add a new tool, add a method to the MyWorker class:

/**
 * A warm, friendly greeting from your MCP server.
 * @param name {string} the name of the person we are greeting.
 * @return {string} the contents of our greeting.
 */
sayHello(name: string) {
    return `Hello from an MCP Worker, ${name}!`;
}

Documentation Structure

Each tool requires proper JSDoc comments:

  • First line: Tool description
  • @param tags: Define parameters with types and descriptions
  • @return tag: Specify the return value and type

Available Tools

The MCP server comes with pre-configured tools for interacting with the WorkOS API. These tools are defined in the src/index.ts file and include functionality for authentication, user management, and other WorkOS features.

To see the complete list of available tools, check the source file or review your agent's capabilities within Cursor after connecting to the MCP server.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later