Kanidm MCP Server (mcp-kanidm)
A professional Model Context Protocol (MCP) server for managing an advanced Kanidm deployment. Built completely asynchronously leveraging httpx and FastMCP.
This server is designed to work via the Kanidm REST v1 API using Service Accounts to keep your intelligent agents sandboxed and robust (eliminating standard CLI shell constraints).
Features
Provides the following MCP tools for Identity and Access Management in Kanidm:
list_users: Queries validated user identities with simple search filters.get_user_details: Extends deep query capabilities into PII attributes and precise access windows (requires an appropriate service account assigned).reset_password_intent: Generates a credential update intent token for help-desking scenarios securely (the AI agent will never directly reset nor touch user passwords directly).delete_user: Manages robust termination via a Human-in-the-Loop (HITL) prompt (ctx.elicit()) guaranteeing a person grants affirmative consent ahead of any destructive REST operation.
Installation and Usage
To install or run this server dynamically within any compatible framework (Claude Desktop, etc.), you can run it via uvx dynamically or install via Python global packages using uv.
Autenticación: Cómo obtener el KANIDM_TOKEN
Importante: Nunca debes configurar el agente MCP utilizando tu cuenta principal de admin. Para mantener la seguridad, aislar los privilegios y garantizar un rastro de auditoría claro, debes usar una Cuenta de Servicio (Service Account).
Sigue estos 3 pasos usando la CLI de Kanidm:
-
Crear una cuenta de servicio para esta integración (por ejemplo, llamada
mcp-agent):kanidm service-account create mcp-agent "MCP Server Agent"
-
Asignarle los privilegios correctos. Añade esta cuenta al grupo adecuado, como
idm_people_admins(para gestión completa de usuarios) oidm_service_desk(para tareas de soporte):kanidm group add-members idm_people_admins mcp-agent
-
Generar un API Token:
kanidm service-account api-token generate mcp-agent --name mcp-token
El comando te devolverá una larga cadena. Ese es tu KANIDM_TOKEN.
Execution Environment
To authenticate safely against Kanidm instances, configure your agent to inject these environmental variables securely:
KANIDM_URL: Base URI of the target Kanidm system (e.g.https://kanidm.mydomain.local)KANIDM_TOKEN: The API Token generated for your Service Account in the previous step.
Configuring the Agent (e.g. Claude Desktop)
In your claude_desktop_config.json:
{
"mcpServers": {
"kanidm-server": {
"command": "uvx",
"args": [
"mcp-kanidm"
],
"env": {
"KANIDM_URL": "https://idm.company.private",
"KANIDM_TOKEN": "YOUR-SERVICE-ACCOUNT-TOKEN"
}
}
}
}
Note: For testing inside enterprise proxies with strict self-signed cert blocks, run the uv instances with the necessary proxy fallback arguments (--allow-insecure-host=...).
Local Development
- Run
uv sync --all-groupsto install code, documentation tools, and dev dependencies fully. - Initialize pre-commits to automatically check your code syntax before commits:
uv run pre-commit install - Run
uv run mcp-kanidmto launch the STDIO pipeline manually.
Note: For testing inside enterprise proxies with strict self-signed cert blocks, run the uv instances with the necessary proxy fallback arguments (--allow-insecure-host=files.pythonhosted.org --allow-insecure-host=pypi.org).
Metadata
Release files for mcp-kanidm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_kanidm-0.1.0.tar.gz | 101.9 kB | With provenance | Details for mcp_kanidm-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_kanidm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mcp_kanidm-0.1.0-py3-none-any.whl |
Total release size: 107.0 kB
Release files / mcp_kanidm-0.1.0.tar.gz
| Download URL | mcp_kanidm-0.1.0.tar.gz |
|---|---|
| Size | 101.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba26ccb07f7d405977f8c40af239aa2a078b859cf84fbef40b7bc21f0c2a035c
|
|
BLAKE2b-256 checksum How to use checksums |
f08eaa4ddf51de417c9477fec66c4cf372908ccccf826c4a68908cf87ce3ceab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logRelease files / mcp_kanidm-0.1.0-py3-none-any.whl
| Download URL | mcp_kanidm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c387de3a71c3d61b766cb3552f5e6638fa55748306d5ffe8e6682ff748c74ce4
|
|
BLAKE2b-256 checksum How to use checksums |
8c1af8bb1b770d30fbf6c69683920c0f0ae6992013204e1d7be0f15d6bc23bb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logSecurity for mcp-kanidm 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mcp_kanidm-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.