MCP server for Kanidm Identity Management using FastMCP
Project description
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).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_kanidm-0.1.0.tar.gz.
File metadata
- Download URL: mcp_kanidm-0.1.0.tar.gz
- Upload date:
- Size: 101.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba26ccb07f7d405977f8c40af239aa2a078b859cf84fbef40b7bc21f0c2a035c
|
|
| MD5 |
b3d57770635c8bdc0b23705bc9ce7dec
|
|
| BLAKE2b-256 |
f08eaa4ddf51de417c9477fec66c4cf372908ccccf826c4a68908cf87ce3ceab
|
Provenance
The following attestation bundles were made for mcp_kanidm-0.1.0.tar.gz:
Publisher:
publish.yml on anglisano/mcp-kanidm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_kanidm-0.1.0.tar.gz -
Subject digest:
ba26ccb07f7d405977f8c40af239aa2a078b859cf84fbef40b7bc21f0c2a035c - Sigstore transparency entry: 1524828353
- Sigstore integration time:
-
Permalink:
anglisano/mcp-kanidm@712ed0628ad70960901874b60cf89b407f44b732 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/anglisano
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@712ed0628ad70960901874b60cf89b407f44b732 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_kanidm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_kanidm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c387de3a71c3d61b766cb3552f5e6638fa55748306d5ffe8e6682ff748c74ce4
|
|
| MD5 |
792dc5eacc0d70a9693148824c74d23c
|
|
| BLAKE2b-256 |
8c1af8bb1b770d30fbf6c69683920c0f0ae6992013204e1d7be0f15d6bc23bb7
|
Provenance
The following attestation bundles were made for mcp_kanidm-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on anglisano/mcp-kanidm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_kanidm-0.1.0-py3-none-any.whl -
Subject digest:
c387de3a71c3d61b766cb3552f5e6638fa55748306d5ffe8e6682ff748c74ce4 - Sigstore transparency entry: 1524828414
- Sigstore integration time:
-
Permalink:
anglisano/mcp-kanidm@712ed0628ad70960901874b60cf89b407f44b732 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/anglisano
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@712ed0628ad70960901874b60cf89b407f44b732 -
Trigger Event:
push
-
Statement type: