- An MCP server that enables Claude to interact with the Beyond Identity Secure Access API
- Supports both stdio (standard I/O) and HTTP/SSE (Server-Sent Events) transport modes
- Exposes one tool per API operation derived from the OpenAPI spec (97 tools total)
- Manages resources including tenants, realms, identities, credentials, groups, and related objects
- All API calls are authorized using a tenant-scoped API token that determines access permissions
- Docker support for easy deployment and scaling
API Documentation: https://docs.beyondidentity.com/api/v1
# Install dependencies
npm install
# Build the TypeScript source
npm run buildThe compiled server entry point will be at build/index.js.
From the Beyond Identity Secure Access Admin Console:
- Log in to your admin console
- Navigate to Access Control → API Access
- Generate an API token with required scopes (copy immediately - shown only once)
- Note your
tenant_idfrom the URL:.../tenants/<tenant_id>/realms/<realm_id> - Note a
realm_idfor testing purposes
This MCP server supports two transport modes:
- Communication via standard input/output
- Used for Claude CLI integration
- Best for local development and CLI tools
- Set
MCP_TRANSPORT=stdioor leave unset
- Communication via Server-Sent Events over HTTP
- Enables remote access and web-based clients
- Includes health check endpoint for monitoring
- Best for containerized deployments and production environments
- Set
MCP_TRANSPORT=http
- Clone the repository and navigate to the directory:
cd bi-secure-access-mcp- Create a
.envfile with your API token:
cp .env.example .env
# Edit .env and add your BEARER_TOKEN_BEARERAUTH- Start the server:
docker-compose up -d- Check the health status:
curl http://localhost:3000/healthdocker build -t bi-secure-access-mcp:latest .docker run -d \
--name bi-mcp-server \
-p 3000:3000 \
-e MCP_TRANSPORT=http \
-e BEARER_TOKEN_BEARERAUTH="your_api_token_here" \
-e PORT=3000 \
bi-secure-access-mcp:latestdocker logs -f bi-mcp-serverdocker stop bi-mcp-server
docker rm bi-mcp-server| Variable | Required | Default | Description |
|---|---|---|---|
BEARER_TOKEN_BEARERAUTH |
Yes | - | Beyond Identity API token |
MCP_TRANSPORT |
No | stdio |
Transport mode: stdio or http |
PORT |
No | 3000 |
HTTP server port (HTTP mode only) |
ALLOWED_ORIGINS |
No | * |
Comma-separated CORS origins (HTTP mode only) |
NODE_ENV |
No | production |
Node environment |
When running in HTTP mode, the following endpoints are available:
-
GET
/health- Health check endpointcurl http://localhost:3000/health
-
GET
/sse- Establish SSE connection- Returns a session ID for message routing
- Maintains an open connection for server-to-client messages
-
POST
/message?sessionId=<id>- Send messages to the server- Requires
sessionIdquery parameter from SSE connection - Request body contains the MCP protocol message
- Requires
For production deployments, consider:
- Use secrets management for
BEARER_TOKEN_BEARERAUTH - Configure ALLOWED_ORIGINS to restrict CORS access
- Set up reverse proxy (nginx, traefik) for TLS termination
- Configure resource limits in docker-compose.yml
- Enable log aggregation for centralized logging
- Set up monitoring using the
/healthendpoint
Example with docker-compose and secrets:
services:
bi-mcp-server:
image: bi-secure-access-mcp:latest
environment:
- MCP_TRANSPORT=http
- BEARER_TOKEN_BEARERAUTH_FILE=/run/secrets/bi_api_token
- ALLOWED_ORIGINS=https://app.example.com
secrets:
- bi_api_token
secrets:
bi_api_token:
external: trueNote: For stdio mode, this MCP server has been tested with Claude CLI.
claude mcp add beyond-identity --scope user \
--env BEARER_TOKEN_BEARERAUTH="<YOUR_API_TOKEN>" \
-- node /absolute/path/to/build/index.js# Run from project directory
claude mcp add beyond-identity \
--env BEARER_TOKEN_BEARERAUTH="<YOUR_API_TOKEN>" \
-- node /absolute/path/to/bi-secure-access-mcp/build/index.jsclaude mcp list
claude mcp get beyond-identityclaude mcp remove beyond-identity
claude mcp add beyond-identity --scope user \
--env BEARER_TOKEN_BEARERAUTH="<NEW_TOKEN>" \
-- node /absolute/path/to/build/index.jsStart a Claude session:
claudePrompt:
From the
beyond-identityMCP server, list the available tools. Show me the names and a one-line description for each.
Expected tools include ListRealms, GetRealm, CreateIdentity, ListCredentials, etc.
Prompt:
Using the
beyond-identityMCP server, call the tool that lists realms for a tenant. Usetenant_id: "<YOUR_TENANT_ID>". Return a table ofid,display_name, andupdate_timefor up to 20 realms.
Prompt:
Use the realms list tool with
tenant_id: "<YOUR_TENANT_ID>", take the first realm'sid, then call the tool that gets a realm by id with thatrealm_id. Summarize the realm details.
List and Filter Identities:
Step 1: List identities for
tenant_id: "<YOUR_TENANT_ID>"andrealm_id: "<YOUR_REALM_ID>"with page_size of 50. Step 2: Filter for identities with email containing "@example.com". Step 3: Get full details for the first matching identity.
Create an Identity:
Create a new identity in realm
<YOUR_REALM_ID>with display name "Test User" and email "[email protected]". Then retrieve it to confirm creation.
List and Revoke Credentials:
Step 1: List credentials for
tenant_id: "<YOUR_TENANT_ID>",realm_id: "<YOUR_REALM_ID>", andidentity_id: "<IDENTITY_ID>". Step 2: If there's an active credential, revoke it. Step 3: Re-list credentials to confirm the status change.
Handle Paginated Results:
List all realms for
tenant_id: "<YOUR_TENANT_ID>"withpage_size: 20. If there's apage_tokenin the response, fetch all pages and combine into a single table.
The MCP server provides tools for managing:
- Tenants: Organization-level configuration
- Realms: Identity domains within tenants
- Identities: User accounts and profiles
- Credentials: Passkeys and authentication methods
- Groups: Identity groupings for access control
- Applications: OAuth and OIDC applications
- Authenticator Configs: Authentication method settings
- Resource Servers: Protected API resources
- Events: Audit logs and activity tracking
- Never include the
BEARER_TOKEN_BEARERAUTHvalue in prompts or logs - Store tokens securely and rotate them regularly
- Use tokens with minimal required scopes
- Always provide
tenant_idas it's required for most operations - Include
realm_idandidentity_idwhen the operation requires them - Use pagination parameters (
page_size,page_token) for large result sets - Handle rate limits appropriately
- 401/403: Token is invalid or lacks required scopes
- 404: Verify the resource IDs are correct
- 429: Rate limit exceeded - implement backoff strategy
bi-secure-access-mcp/
├── src/
│ └── index.ts # TypeScript source
├── build/
│ └── index.js # Compiled entry point
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file
# Build the project
npm run build
# Type checking
npm run typecheck
# Start the server
npm startLocal (stdio mode):
- Verify Node.js version >= 20.0.0
- Check that
build/index.jsexists (runnpm run buildif not) - Ensure all dependencies are installed (
npm install)
Docker (HTTP mode):
- Check Docker logs:
docker logs bi-mcp-server - Verify the image built successfully:
docker images | grep bi-secure-access-mcp - Ensure port 3000 is not already in use:
lsof -i :3000(macOS/Linux) - Check container status:
docker ps -a | grep bi-mcp-server
- Verify your API token is valid and not expired
- Check that the token has necessary scopes for the operations
- Ensure the
BEARER_TOKEN_BEARERAUTHenvironment variable is set correctly - For Docker: Verify the environment variable is passed:
docker inspect bi-mcp-server | grep BEARER_TOKEN
API Connection:
- Verify network connectivity to
https://api-us.beyondidentity.com - Check firewall settings for outbound HTTPS traffic
- For EU tenants, the API endpoint will differ
HTTP/SSE Mode:
- Test health endpoint:
curl http://localhost:3000/health - Check if port is exposed:
docker port bi-mcp-server(Docker) - Verify CORS settings if connecting from browser
- Check network connectivity:
docker network ls(Docker)
Container keeps restarting:
- Check logs for errors:
docker logs bi-mcp-server - Verify environment variables are set correctly
- Ensure API token is valid
- Check health check status:
docker inspect --format='{{.State.Health.Status}}' bi-mcp-server
Health check failing:
- Verify the server started:
docker logs bi-mcp-server | grep "running on HTTP" - Check if curl is available in container:
docker exec bi-mcp-server curl --version - Test health endpoint manually:
docker exec bi-mcp-server curl -f http://localhost:3000/health
Build failures:
- Clear Docker cache:
docker builder prune - Check for TypeScript errors:
npm run typechecklocally - Verify all files are present (check .dockerignore)
- API Documentation: Beyond Identity API Docs
- MCP Protocol: Model Context Protocol Documentation
- Issues: Open an issue in this repository
MIT License - see LICENSE file for details.
- Generated using OpenAPI MCP Generator
- Powered by Beyond Identity