MCP server for FreeIPA identity management
Project description
FreeIPA MCP Server
MCP server for FreeIPA identity management instances. Tools are dynamically registered from FreeIPA's schema API, exposing ~290 commands covering users, groups, hosts, DNS, HBAC, sudo rules, certificates, services, trusts, vaults, and more.
The server uses CodeMode for efficient LLM interaction, collapsing ~290 individual tools into 3 meta-tools (get_tags, search, get_schemas) that let AI assistants discover and call commands on demand rather than loading all tools into context at once.
Both MCP (stdio) and REST API (Swagger UI) interfaces are available, sharing the same underlying FreeIPA client.
Configuration
Authentication: FreeIPA uses password-based authentication with session cookies. It's recommended to create a dedicated API user account in FreeIPA rather than using a personal account.
Option 1: config.json
cp config.json.example config.json
# Edit config.json with your credentials
{
"host": "ipa.example.com",
"username": "admin",
"password": "changeme",
"verify_ssl": true,
"ca_cert_path": "/etc/ipa/ca.crt"
}
Option 2: Environment Variables
export FREEIPA_HOST="ipa.example.com"
export FREEIPA_USERNAME="api-user"
export FREEIPA_PASSWORD="api-password"
export FREEIPA_VERIFY_SSL="true"
export FREEIPA_CA_CERT_PATH="/etc/ipa/ca.crt"
CA Certificate Setup
FreeIPA servers typically use a self-signed CA. To connect with SSL verification enabled:
-
Copy the IPA CA certificate from the FreeIPA server:
scp root@ipa.example.com:/etc/ipa/ca.crt /usr/local/share/ca-certificates/ipa-ca.crt
-
Set
ca_cert_pathin config.json orFREEIPA_CA_CERT_PATHto the local path.
Alternatively, set verify_ssl to false for development environments (not recommended for production).
Installation
Option 1: Using uv (Recommended)
uv is a fast Python package manager. Install it first:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
No additional installation needed - uvx will handle dependencies automatically.
Option 2: Using pip
pip install bibliocommons-mcp-freeipa
# or for development
pip install -e ".[dev]"
AI Client Setup
Quick Links: Amazon Q | Claude Desktop | VS Code | GitHub Copilot | Cline | Zed | Cursor | Kiro IDE | Kiro CLI
Amazon Q Developer (VS Code)
- Install the Amazon Q extension in VS Code
- Open VS Code Settings (JSON) and add:
{
"amazonQ.mcp.servers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"amazonQ.mcp.servers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
Claude Desktop
-
Open Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the server configuration:
{
"mcpServers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
VS Code (with MCP Extension)
- Install an MCP-compatible extension in VS Code
- Open VS Code Settings (JSON):
Cmd+Shift+P→ "Preferences: Open User Settings (JSON)" - Add the server configuration:
{
"mcp.servers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"mcp.servers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
GitHub Copilot (VS Code)
- Install GitHub Copilot extension in VS Code
- Open VS Code Settings (JSON) and add:
{
"github.copilot.chat.mcp.servers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"github.copilot.chat.mcp.servers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
Cline (VS Code Extension)
- Install the Cline extension in VS Code
- Open VS Code Settings (JSON) and add:
{
"cline.mcpServers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"cline.mcpServers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
Zed Editor
- Open Zed settings:
Cmd+,(macOS) orCtrl+,(Linux/Windows) - Navigate to "Language Models" → "Configure MCP Servers"
- Add the server configuration:
{
"mcpServers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
Cursor IDE
- Open Cursor Settings (JSON):
Cmd+Shift+P→ "Preferences: Open User Settings (JSON)" - Add the MCP server configuration:
{
"mcp.servers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"mcp.servers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
Kiro IDE
- Open Kiro IDE settings
- Navigate to MCP Servers configuration
- Add the server:
{
"mcpServers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
Kiro CLI
-
Create or edit the MCP configuration file:
- User level:
~/.kiro/settings/mcp.json - Project level:
<project-root>/.kiro/settings/mcp.json
- User level:
-
Add the server configuration:
{
"mcpServers": {
"freeipa": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/freeipa", "bibliocommons-mcp-freeipa"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"freeipa": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_freeipa"]
}
}
}
Configuration Notes
- Replace
/absolute/path/to/freeipa/with the actual path to your server directory - Using
uvx(default): Automatically manages dependencies in isolated environments (likenpxfor Node.js) - Using
python(alternative): Requirespip install bibliocommons-mcp-freeipafirst - After adding the configuration, restart your AI client for changes to take effect
Web UI with Swagger
A REST API with interactive Swagger documentation is available:
python -m bibliocommons_mcp_freeipa.webui
Access the Swagger UI at: http://localhost:8000/docs
The Web UI provides:
- Interactive API documentation
- Try-it-out functionality for all endpoints
- OpenAPI/Swagger specification
- REST API access to all FreeIPA commands
Standalone MCP Server
python -m bibliocommons_mcp_freeipa
Tool Domains
Tools are dynamically registered from the FreeIPA schema. The exact count depends on your FreeIPA version and installed plugins. Typical domains include:
| Domain | Prefix | Approx. Commands | Examples |
|---|---|---|---|
| Users | user_ |
~19 | user_add, user_find, user_mod, user_show |
| Groups | group_ |
~9 | group_add, group_find, group_add_member |
| Hosts | host_ |
~22 | host_add, host_find, host_show |
| DNS | dns |
~28 | dnszone_add, dnsrecord_add, dnsrecord_find |
| HBAC | hbac |
~20 | hbacrule_add, hbacrule_add_user, hbactest |
| Sudo | sudo |
~25 | sudorule_add, sudorule_add_user, sudocmd_add |
| Certificates | cert_ |
~17 | cert_request, cert_show, cert_revoke |
| Services | service_ |
~22 | service_add, service_find, service_show |
| Trusts | trust_ |
~16 | trust_add, trust_find, trust_show |
| Vaults | vault_ |
~16 | vault_add, vault_archive, vault_retrieve |
| Password Policy | pwpolicy_ |
~5 | pwpolicy_add, pwpolicy_mod, pwpolicy_show |
| Kerberos | krbtpolicy_ |
~3 | krbtpolicy_mod, krbtpolicy_show |
| SELinux | selinux |
~5 | selinuxusermap_add, selinuxusermap_find |
| Automount | automount |
~15 | automountlocation_add, automountmap_add |
| Other | various | ~70+ | config_mod, ping, whoami, batch |
Schema Caching
On startup, the server fetches the full command schema from FreeIPA's schema API endpoint. This schema defines all available commands, their parameters, types, and documentation.
The schema is cached locally in schema_cache.json. If the live fetch fails (e.g., FreeIPA is temporarily unreachable), the server falls back to the cached version.
To refresh the cache after a FreeIPA upgrade or plugin change:
rm schema_cache.json
# Restart the server - it will fetch and cache the new schema
Security Notes
- Dedicated API user: Create a FreeIPA user specifically for API access with only the permissions needed. Avoid using
adminin production. - CA certificate: Configure
ca_cert_pathto point to your IPA CA certificate rather than disabling SSL verification. - Session handling: The client authenticates via password and maintains a session cookie. If the session expires (401), it re-authenticates automatically.
- Never commit config.json: The
.gitignoreexcludesconfig.json. Useconfig.json.exampleas a template and keep credentials out of version control.
Project details
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 bibliocommons_mcp_freeipa-1.0.0.tar.gz.
File metadata
- Download URL: bibliocommons_mcp_freeipa-1.0.0.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80b775205ec93dfba6743907adcc5289186e294d28c051e82e67067e70dce64a
|
|
| MD5 |
18947b4154e784736aa1fa91dc575092
|
|
| BLAKE2b-256 |
f7cae5d8a7f46cd93d375f296c79a44979e1413563a76fef97932792a232419e
|
File details
Details for the file bibliocommons_mcp_freeipa-1.0.0-py3-none-any.whl.
File metadata
- Download URL: bibliocommons_mcp_freeipa-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b54bbb13a4ca23db8883974154bb9246d29e1cc1b34c4f9b20889ef7d0e87bd
|
|
| MD5 |
0cf30dca91d1ed5178ac58eac41bd79e
|
|
| BLAKE2b-256 |
4e9745f14ad7a3330f9d3a6f26197670a5b707ee3ac350f7aad4560b4632cffa
|