Casdoor

v1.0.0Securitystable

An open-source Agent-first Identity and Access Management (IAM) /LLM MCP & agent gateway and auth server with web UI supporting OpenClaw, MCP, OAuth, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA, Face ID, Google Workspace, Azure AD

agentagentic-aiagiai-gatewayauth
Share:
13,648
Stars
0
Downloads
0
Weekly
0/5

What is Casdoor?

Casdoor is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to open-source agent-first identity and access management (iam) /llm mcp & agent gateway and auth server with web ui supporting openclaw, mcp, oauth, oidc, saml, cas, ldap, scim, webauthn, totp, mfa, fac...

An open-source Agent-first Identity and Access Management (IAM) /LLM MCP & agent gateway and auth server with web UI supporting OpenClaw, MCP, OAuth, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA, Face ID, Google Workspace, Azure AD

This server falls under the Security category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • An open-source Agent-first Identity and Access Management (I

Use Cases

Identity and access management
Agent gateway
Multi-protocol authentication
casdoor

Maintainer

LicenseApache-2.0
Languagego
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx casdoor

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Casdoor

Casdoor is an open-source, agent-first Identity and Access Management (IAM) platform that doubles as an MCP and agent gateway. It supports OAuth 2.0, OIDC, SAML, LDAP, SCIM, WebAuthn, TOTP, MFA, and Face ID authentication, and provides a single unified auth layer for both human users and AI agents. Organizations building multi-tenant AI applications that need robust authentication, access control, and an MCP gateway for routing agent requests will find Casdoor an excellent self-hosted backbone.

Prerequisites

  • Docker (for the quickest setup) OR Go 1.20+ and Node.js LTS 20 with Yarn 1.x for building from source
  • A supported database: MySQL, PostgreSQL, SQLite, SQL Server, CockroachDB, or TiDB
  • An MCP-compatible client such as Claude Desktop
  • Redis (optional, for session caching at scale)
1

Start Casdoor with Docker (quickest path)

Pull and run the all-in-one Docker image which bundles Casdoor with a SQLite database. The UI will be available at http://localhost:8000.

docker run -p 8000:8000 casbin/casdoor-all-in-one
2

Log in and configure your organization

Open http://localhost:8000 in a browser. Log in with the default credentials (username: built-in/admin, password: 123). Create your organization and configure identity providers, applications, and roles.

3

Enable the MCP gateway

In the Casdoor admin UI, navigate to the MCP gateway settings. Register your AI agents and MCP servers, configure access policies, and generate gateway tokens for each agent.

4

Obtain the MCP gateway endpoint URL

The MCP gateway is accessible at the /mcp path of your Casdoor instance. Note this URL for your MCP client configuration.

# Example: http://localhost:8000/mcp
5

Configure your MCP client to use the Casdoor gateway

Add Casdoor as the MCP server in your client configuration, supplying the gateway URL and your agent token.

{
  "mcpServers": {
    "casdoor": {
      "command": "npx",
      "args": ["casdoor"],
      "env": {
        "CASDOOR_ENDPOINT": "http://localhost:8000",
        "CASDOOR_CLIENT_ID": "your_client_id",
        "CASDOOR_CLIENT_SECRET": "your_client_secret"
      }
    }
  }
}
6

Test authentication flows

Use the Casdoor Swagger UI at http://localhost:8000/swagger to test the REST APIs. Verify that OAuth tokens issued by Casdoor are accepted by your protected services.

Casdoor Examples

Client configuration

Claude Desktop configuration for the Casdoor MCP gateway server.

{
  "mcpServers": {
    "casdoor": {
      "command": "npx",
      "args": ["casdoor"],
      "env": {
        "CASDOOR_ENDPOINT": "http://localhost:8000",
        "CASDOOR_CLIENT_ID": "your_client_id",
        "CASDOOR_CLIENT_SECRET": "your_client_secret"
      }
    }
  }
}

Prompts to try

Example prompts for managing identity and access control through the Casdoor MCP gateway.

- "Create a new user account in the built-in organization with the role developer"
- "List all OAuth applications registered in Casdoor"
- "Check what permissions the user alice has in the production application"
- "Generate a new TOTP secret for user bob and return the QR code URI"
- "Show all active sessions for organization my-company"

Troubleshooting Casdoor

Cannot connect to Casdoor at localhost:8000

Verify the Docker container is running with `docker ps`. If the port is already in use, change the host port mapping: `docker run -p 8080:8000 casbin/casdoor-all-in-one` and update your configuration accordingly.

OAuth token validation fails in connected services

Ensure the application's client ID and client secret in Casdoor match the values configured in your service. Also verify the redirect URIs are correctly registered under the application settings in the Casdoor admin UI.

MCP gateway returns 401 Unauthorized for agent requests

Re-generate the gateway token in the Casdoor admin UI and update the CASDOOR_CLIENT_SECRET in your MCP client config. Check that the agent's IP or origin is not blocked by Casdoor's access control rules.

Frequently Asked Questions about Casdoor

What is Casdoor?

Casdoor is a Model Context Protocol (MCP) server that open-source agent-first identity and access management (iam) /llm mcp & agent gateway and auth server with web ui supporting openclaw, mcp, oauth, oidc, saml, cas, ldap, scim, webauthn, totp, mfa, face id, google workspace, azure ad It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Casdoor?

Follow the installation instructions on the Casdoor GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Casdoor?

Casdoor works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Casdoor free to use?

Yes, Casdoor is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Casdoor Alternatives — Similar Security Servers

Looking for alternatives to Casdoor? Here are other popular security servers you can use with Claude, Cursor, and VS Code.

Browse More Security MCP Servers

Explore all security servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "casdoor": { "command": "npx", "args": ["-y", "casdoor"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Casdoor?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides