Wocha Docs

MCP Server

Model Context Protocol server that exposes the Wocha Management API to AI assistants.

@wocha/mcp is a Model Context Protocol (MCP) server that wraps the Wocha Management API. Connect it to Claude Desktop, Cursor, or any MCP-compatible client so AI agents can inspect and manage users, organisations, OAuth applications, webhooks, connections, feature flags, and more.

Installation

Install globally:

pnpm add -g @wocha/mcp
Or scaffold with the CLI
npx @wocha/cli init --framework nextjs

Or run with npx:

npx @wocha/mcp

The server communicates over stdio — your MCP client spawns the process and passes credentials via environment variables.

Configuration

VariableRequiredDescription
WOCHA_API_KEYYesManagement API key (wocha_mgmt_...) or OAuth access token
WOCHA_TENANTOne of tenant/urlTenant slug (resolves to https://{tenant}.api.wocha.ai/v1)
WOCHA_API_URLOne of tenant/urlPlatform API base URL (self-hosted or local)

Example:

export WOCHA_API_KEY="wocha_mgmt_..."
export WOCHA_TENANT="acme"
# or: export WOCHA_API_URL="https://acme.api.wocha.ai"

Tools

The server exposes Management API operations as MCP tools. Read-only tools are safe for inspection; mutating tools change tenant configuration — confirm with the user before calling them.

Users and organisations

ToolDescription
users_listList users with pagination
users_getGet user by ID
users_createCreate a new user
organisations_listList organisations
organisations_getGet organisation by ID
organisations_createCreate organisation
organisations_updateUpdate display name or metadata
organisations_list_membersList org members
organisations_add_memberAdd user to org with role
organisations_remove_memberRemove member from org

Permissions

ToolDescription
permissions_checkCheck if a subject has a permission on a resource
permissions_lookupLookup resources a subject can access
permissions_expandExpand a permission tree for a resource

Applications and webhooks

ToolDescription
applications_listList OAuth applications
applications_createRegister a new OAuth application
webhooks_listList webhook subscriptions
webhooks_createCreate webhook subscription
webhooks_updateUpdate webhook URL, events, or status
webhooks_deleteDelete webhook subscription
webhooks_deliveriesList delivery history for a webhook
webhook_verifyVerify an X-Wocha-Signature header against a payload

Connections, events, and flags

ToolDescription
connections_listList social, enterprise SSO, and SCIM connections
events_listList recent platform events
feature_flags_listList feature flags
feature_flags_evaluateEvaluate flags for a user or org
feature_flags_createCreate a feature flag
feature_flags_updateUpdate a feature flag

Environments and tenant

ToolDescription
environments_listList deployment environments
environments_createCreate a deployment environment
api_keys_listList management API keys
tenant_statusTenant health, subscription, and usage summary

Resources

Read-only resources provide quick context without tool calls:

URIDescription
wocha://tenant/configTenant configuration summary
wocha://tenant/events/recentLast 20 platform events
wocha://tenant/connectionsActive auth connections
wocha://tenant/environmentsDeployment environments
wocha://tenant/feature-flagsFeature flags defined for the tenant

Usage with AI assistants

Cursor

Add to .cursor/mcp.json in your project or global Cursor MCP settings:

{
  "mcpServers": {
    "wocha": {
      "command": "npx",
      "args": ["-y", "@wocha/mcp"],
      "env": {
        "WOCHA_API_KEY": "wocha_mgmt_...",
        "WOCHA_TENANT": "your-tenant"
      }
    }
  }
}

For self-hosted deployments, use WOCHA_API_URL instead of WOCHA_TENANT:

{
  "mcpServers": {
    "wocha": {
      "command": "npx",
      "args": ["-y", "@wocha/mcp"],
      "env": {
        "WOCHA_API_KEY": "wocha_mgmt_...",
        "WOCHA_API_URL": "http://localhost:3400"
      }
    }
  }
}

Restart Cursor after saving. The Wocha tools appear in the MCP panel and are available to Agent mode.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "wocha": {
      "command": "npx",
      "args": ["-y", "@wocha/mcp"],
      "env": {
        "WOCHA_API_KEY": "wocha_mgmt_...",
        "WOCHA_TENANT": "your-tenant"
      }
    }
  }
}

On Windows, the config file is at %APPDATA%\Claude\claude_desktop_config.json.

Other MCP clients

Any client that supports stdio MCP servers can run:

WOCHA_API_KEY=wocha_mgmt_... WOCHA_TENANT=acme npx @wocha/mcp

Example prompts

Once connected, you can ask your assistant:

  • "List the last 10 users in my Wocha tenant"
  • "Create a webhook subscription for user.created events pointing to my staging URL"
  • "Check if user usr_abc has edit permission on document doc_123"
  • "Show me the tenant health and subscription status"
  • "Evaluate feature flags for organisation org_xyz"

The server returns JSON responses from the Management API. Mutating operations include hints in the server instructions to confirm with the user first.

Security

  • Use a Management API key with the minimum scopes needed for your workflow
  • Never commit API keys to source control — use environment variables in MCP config
  • Prefer read-only inspection in shared or production tenants; use a dedicated dev tenant for mutating operations
  • Rotate keys if they are exposed

Learn more

On this page