You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An MCP (Model Context Protocol) server that gives AI agents direct access to the Beyond Identity API — no admin panel required. Agents can manage identities, groups, applications, SSO configurations, credentials, and every other Beyond Identity resource through natural tool calls.
The server auto-detects which Beyond Identity platform you're using from your API key and registers the appropriate tools:
Secure Access (v1): 104 tools for the modern platform
Secure Workforce (v0): 35 tools for the legacy platform
That's it. The server extracts your tenant ID from the JWT and determines the correct platform and base URL automatically.
Environment Variables
Variable
Required
Default
Description
API_KEY
Yes
—
Beyond Identity API key (JWT). Obtained from the admin console under Settings > API Access.
REGION
No
US
US or EU. Determines the API base URL.
BASE_URL
No
(computed from platform + region)
Override the API host. Use for non-production environments (e.g. staging, local mock). When set, takes precedence over REGION.
How It Works
Platform Detection
The server inspects your JWT at startup to determine which platform to target:
If the token contains a bi_t claim, you're on Secure Access (v1). The bi_t value is your tenant ID, and the server hits api-us.beyondidentity.com or api-eu.beyondidentity.com.
If there is no bi_t claim, the server falls back to the sub claim and targets Secure Workforce (v0) at api.byndid.com or api-eu.byndid.com.
Only one set of tools is registered per session. Agents never see version numbers or need to think about which platform they're on.
Tool Discovery
With 100+ possible tools, agents need a way to find the right one. The search_tools tool accepts a natural language query and returns the most relevant tools:
search_tools("add a user to a group")
→ add_group_members, create_identity, list_groups, ...
It uses keyword matching, synonym expansion (user matches identity, app matches application, cred matches credential/passkey), and CRUD verb detection (create matches POST endpoints, delete matches DELETE endpoints).
Automatic Parameter Injection
On the v1 platform, every API path looks like /v1/tenants/{tenant_id}/realms/{realm_id}/.... The server injects tenant_id automatically from the JWT — agents never provide it. The realm_id is a required parameter on realm-scoped tools; agents call list_realms first to discover available realms.
On v0, paths are simpler (/v2/...) with no tenant or realm in the URL — the token handles tenant scoping.
Error Handling
The server validates your API key at startup with clear messages for common problems:
Not a JWT (wrong segment count)
Corrupted payload (bad base64 or invalid JSON)
Missing expected claims (bi_t or sub)
Invalid region value
At runtime, API errors are returned as structured tool results with HTTP status codes and error details, not thrown as exceptions that crash the conversation.
All tool definitions and HTTP handlers are auto-generated from the OpenAPI specifications. The generator (scripts/generate.ts) does the following:
Parses both YAML specs and dereferences all $ref pointers
Extracts every operation (path + HTTP method + operationId)
Converts each operationId to a snake_case tool name
Builds Zod input schemas from the OpenAPI request parameters and body definitions
Generates tool handler functions that call the ApiClient with the correct method, path, and parameters
Annotates read-only tools (GET) and destructive tools (DELETE) for MCP clients that surface this information
To regenerate after spec changes:
npm run generate
The generated files are committed to the repository so consumers don't need to run the generator themselves.
HTTP Client
The ApiClient class (src/client.ts) handles:
Bearer token authentication on every request
Path parameter substitution — replaces {tenant_id}, {realm_id}, {identity_id}, etc. in URL templates
Tenant ID injection — on v1, the tenant ID from the JWT is inserted into every path automatically
Query parameter serialization — optional params are omitted, not sent as empty strings
Error normalization — HTTP errors are caught and returned as structured ApiError objects with status code, error code, and message
Development
# Install dependencies
npm install --ignore-scripts
# Download fresh OpenAPI specs
curl -s https://developer.beyondidentity.com/api/v1/openapi.yaml -o openapi.yaml
curl -s https://docs.beyondidentity.com/api/v0/openapi.yaml -o openapi-v0.yaml
# Regenerate tool code from specs.# Internally runs scripts/patch-spec.ts first, which applies known local# workarounds for confirmed bugs in the upstream specs (e.g. SCIM body# wrapping, /scim/v2/Groups/ trailing slash). The patch list lives in# scripts/spec-patches.ts and is idempotent — re-running is safe.
npm run generate
# Type-check
npx tsc --noEmit
# Full build (generate + compile)
npm run build
# Run in development mode
API_KEY="your-key" npm run dev
# Run compiled build
API_KEY="your-key" npm start
This runs the server from source via tsx — no build step required. Changes to src/ take effect immediately on the next MCP session. To point at a non-production environment, add BASE_URL: