LDAP Assistant MCP

io.github.droideck由 GitHub 帳號 droideck 發布v0.5.0更新於 Oct 25, 2026

MCP server for 389 Directory Server health diagnostics, log analysis, and SOS-report investigation

已驗證STDIO僅桌面資料庫安全與監控

概覽

AI 產生的概覽

本機 MCP 伺服器,讓 AI 助理對 389 Directory Server 進行唯讀診斷,涵蓋線上、停機與封存執行個體,並回傳依優先順序排列的發現。

可以做什麼
執行健康檢查與多伺服器總覽,包含完整的 healthcheck 等效功能,以及線上或依據 dse.ldif 的外掛與後端設定檢視。檢查複寫狀態、拓撲、延遲、協定與衝突項目,並彙整效能、快取、連線、操作與執行緒統計及調校建議。分析索引設定,從存取日誌找出未建索引的搜尋,並分析存取、錯誤與稽核日誌(傳統與 JSON 格式)。調查 SOS 報告及設定或日誌封存:清單、離線設定檢查、dse.ldif 差異比對。列出與搜尋使用者及群組,執行監控查詢與通用 LDAP 搜尋,隱私模式下僅回傳計數。
適用情境
適合排查 389 Directory Server 問題:健康巡檢、複寫故障定位、效能調校、索引審查,或在開立支援案件前彙整客戶的 SOS 報告。適用於針對線上伺服器、停機執行個體或封存的內部維運與支援工作。
執行需求
透過 uvx(PyPI 套件)或原始碼在本機以 stdio 執行。需要 Linux 或 macOS(Windows 僅限 WSL2)、Python 3.11+、uv 套件管理員,以及建置 python-ldap 所需的系統開發函式庫。需要設定 LDAP_SERVERS_CONFIG 環境變數,指向 servers.json 的絕對路徑;該檔案包含 LDAP 位址、綁定 DN 與綁定密碼。線上模式需要能連線至目標 LDAP 伺服器的網路。
安裝前請注意
servers.json 以明文保存綁定密碼,應限制檔案權限。隱私模式預設開啟,會遮蔽 DN、主機名稱與 IP,但伺服器名稱永不遮蔽,因此不要在當中填入私密資訊。將 LDAP_MCP_EXPOSE_SENSITIVE_DATA 設為 true 會關閉遮蔽並重新啟用項目層級工具,生產目錄搭配公開 LLM 時應避免。將 tls_verify 設為 false 會關閉憑證驗證。此伺服器為 beta 階段、唯讀,工具結果會轉送給所設定的 LLM。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 LDAP Assistant MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

LDAP Assistant MCP

[Version] [License: GPL v3]

Beta — read-only 389 Directory Server diagnostics, suitable for evaluation and internal troubleshooting. Tool schemas, output formats, and configuration fields may still change before 1.0.0.

LDAP Assistant MCP turns your AI assistant into a 389 Directory Server support engineer. Point it at live servers, stopped instances, or an SOS report from a customer case, and ask:

  • "What's wrong with my directory servers?"
  • "Summarize this SOS report before I open the case."
  • "Replication looks broken between these servers — why?"

It answers with prioritized findings (severity, impact, remediation) from 42 read-only diagnostic tools built on lib389, the official 389 DS administration library. Privacy mode is on by default: DNs, hostnames, and IPs are redacted before anything reaches the LLM.

Supported provider: 389 Directory Server. (OpenLDAP provider code exists experimentally behind an opt-in flag, with no privacy guarantees, and is not part of the support contract — see Environment Variables.)

Install

Prerequisites

  • Linux (primary) or macOS. Windows is not supported natively (python-ldap has no official Windows wheels) — use WSL2 (see the install playbook)

  • Python 3.11+ (3.13 is what CI tests against)

  • uv package manager

  • MCP client (Claude Desktop, Claude Code, Cursor, Gemini CLI, etc.)

  • System development libraries (needed to build python-ldap):

    Fedora / RHEL / CentOS:

    bash
    sudo dnf install python3-devel openldap-devel cyrus-sasl-devel openssl-devel gcc

    Ubuntu / Debian:

    bash
    sudo apt install python3-dev libldap2-dev libsasl2-dev libssl-dev gcc

    macOS (Homebrew):

    bash
    brew install openldapexport LDFLAGS="-L$(brew --prefix openldap)/lib"export CPPFLAGS="-I$(brew --prefix openldap)/include"

Anything failing during install? → Installation troubleshooting playbook

From PyPI (recommended)

No clone needed — your MCP client runs the published package via uvx. Skip ahead to Configure your servers, then use this client configuration (Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

json
{  "mcpServers": {    "ldap-assistant-mcp": {      "command": "uvx",      "args": ["ldap-assistant-mcp"],      "env": {        "LDAP_SERVERS_CONFIG": "/absolute/path/to/servers.json"      }    }  }}

Use an absolute path for LDAP_SERVERS_CONFIG — relative paths resolve against the MCP client's working directory, which is usually not where you think.

From source (development)

bash
git clone https://github.com/droideck/ldap-assistant-mcp.gitcd ldap-assistant-mcpuv venv && source .venv/bin/activateuv pip install -e .[dev]
# Register with your MCP client via FastMCP:fastmcp install claude-desktop fastmcp.json   # or: fastmcp install claude-code fastmcp.json

Then set LDAP_SERVERS_CONFIG in the generated client entry as above. See the Development Guide for test containers and architecture.

Configure your servers

Create a servers.json with your LDAP server(s). Note: the name field is never redacted in privacy mode — it is passed as-is to AI agents so they can reference servers across tool calls. Do not put hostnames, IPs, or other private information in server names.

json
{  "servers": [    {      "name": "local-ds",      "ldap_url": "ldap://localhost:389",      "base_dn": "dc=example,dc=com",      "bind_dn": "cn=Directory Manager",      "bind_password": "your-password",      "provider_type": "389ds",      "is_local": true,      "serverid": "localhost"    },    {      "name": "remote-ds",      "ldap_url": "ldap://ldap.example.com:389",      "base_dn": "dc=example,dc=com",      "bind_dn": "cn=Directory Manager",      "bind_password": "your-password",      "provider_type": "389ds"    },    {      "name": "stopped-ds",      "ldap_url": "ldap://localhost:389",      "base_dn": "dc=example,dc=com",      "bind_dn": "cn=Directory Manager",      "bind_password": "unused-in-offline-mode",      "provider_type": "389ds",      "is_local": true,      "serverid": "localhost",      "is_offline": true    },    {      "name": "sos-report",      "provider_type": "389ds",      "is_archive": true,      "archive_path": "/path/to/sosreport-host-2025/",      "instance_name": "slapd-instance"    }  ]}

Note: serverid is the instance name without the slapd- prefix (e.g. localhost for the instance slapd-localhost).

The four server modes

ModeConfigWhat you get
Remoteldap_url onlyHealth, replication, performance, config, and entry tools over LDAP. No log/disk/cert access
Local+ is_local: true, serveridEverything above plus log analysis, disk monitoring, certificate checks, process metrics
Offline+ is_offline: trueA stopped local instance, analyzed via dse.ldif and log files — no LDAP connection. For post-mortems and instances that won't start
Archiveis_archive: true, archive_pathAn SOS report or config/log extract from any machine (tarball or directory, auto-detected layout). No LDAP, no local instance required

Tools that need a live connection tell you so — the error names the tools that do work in that server's mode, so the investigation continues instead of dead-ending.

Remote LDAPS certificate verification: remote ldaps:// servers verify the server certificate by default ("tls_verify": true, or the LDAP_TLS_VERIFY environment variable for env-based config). To connect to a server with a self-signed or otherwise untrusted certificate, set "tls_verify": false on that server entry — this disables certificate verification entirely, so use it only for trusted lab environments. Local instances (is_local: true) instead use the instance's own NSS certificate directory.

After editing the client config or servers.json, restart your MCP client, then verify: ask "Which LDAP servers are configured?"

Privacy mode

By default, privacy mode is enabled — sensitive data (DNs, hostnames, IPs, user details) is redacted from tool outputs. Tools that expose individual entries (get_user_details, ldap_search) are disabled; list tools return counts only. Diagnostic metrics (counts, ratios, percentages) remain visible.

To enable full data access in trusted environments only:

json
{  "env": {    "LDAP_MCP_EXPOSE_SENSITIVE_DATA": "true"  }}

Important: Only enable this with local models, private cloud LLM instances, or when working with test/sample data. Avoid enabling with public LLMs when connected to production directories — your directory information could be included in their training data or logs.

When privacy mode is enabled (default):

  • Hostnames, DNs, IP addresses, and suffixes are anonymized
  • Configuration values are redacted
  • Sensitive tools are disabled
  • Diagnostic metrics (counts, ratios, percentages) remain visible
  • Server names (the name field in servers.json) are never redacted — they are user-chosen labels that must remain stable across tool calls. Do not put hostnames, IPs, or other private information in server names.

Data handling

  • No telemetry. The server collects nothing and phones home to no one.
  • Everything runs locally. Directory data is read from your LDAP servers, local instances, or archive files and returned only to your MCP client — which forwards tool results to whatever LLM you have configured. Privacy mode (on by default) redacts sensitive values before they leave the server process.
  • Credentials stay in your local servers.json / environment variables; they are never included in tool output and tool errors are sanitized.

First questions to ask

You wantAsk / useBehind it
A health overview of everything"What's wrong with my directory servers?"first_look
An SOS report summarized"Analyze the sos-report archive" or the archive_investigation promptanalyze_archive → archive playbook
To know which tool fits a goalthe tool_navigator prompttool map for a stated goal
Guided replication triagethe diagnose_replication promptreplication tool sequence
Guided performance triagethe performance_investigation promptperformance tool sequence
A morning ops reviewthe daily_health_check prompthealth + monitoring sweep

Playbooks (symptom → tools → what they can't know → how to verify by hand):

Tools by group

42 read-only tools — full reference with parameters in TOOLS.md.

GroupToolsHighlights
Healthfirst_look, run_healthcheck, list_healthchecks, server_healthMulti-server overview; full dsctl healthcheck equivalent
Replicationget_replication_status, get_replication_topology, check_replication_lag, list_replication_conflicts, get_agreement_statusRUV/CSN analysis, topology mapping, conflict entries
Performanceget_performance_summary, cache/connection/operation/thread/resource statisticsBottleneck detection and tuning recommendations
Indexeslist_indexes, analyze_index_configuration, find_unindexed_searchesAccess-log-driven unindexed search hunting
Configurationget_server_configuration, compare_server_configurations, list_plugins, get_backend_configurationLive and offline (dse.ldif) paths
Logsanalyze_access_log / analyze_error_log / analyze_audit_log (stats, privacy-safe), parse_*_log (full entries, requires sensitive-data mode)Traditional and JSON log formats
Archive / SOSanalyze_archive, validate_configuration, compare_dse_configsInventory, offline config lint, full dse.ldif diff
Users & Groupslist/search/inspect users, active/locked filters, groupsCount-only in privacy mode
Advancedldap_search, run_monitor, list_servers, cn=config resourcesGeneric search (sensitive-data mode only)

Environment Variable Reference

VariableDefaultPurpose
LDAP_SERVERS_CONFIG–Absolute path to servers.json (multi-server config; preferred)
LDAP_PROVIDERdirsrvServer implementation. Only dirsrv (389 DS) is supported; openldap requires the opt-in flag below
LDAP_MCP_EXPERIMENTAL_OPENLDAPfalseOpt in to the experimental OpenLDAP provider (two tools, no privacy guarantees)
LDAP_MCP_EXPOSE_SENSITIVE_DATAfalseDisable privacy mode (see Privacy Mode)
LDAP_MCP_DEBUGfalseEnable debug logging and tracebacks in tool errors
LDAP_MCP_TOOL_TIMEOUT30Per-tool-call timeout in seconds
LDAP_MCP_MAX_TOOL_TIMEOUT120Timeout ceiling for heavy tools (first_look, archive comparison, …)
LDAP_CONNECT_TIMEOUT30LDAP network/operation timeout in seconds (prevents hangs on unreachable servers)

Single-server fallback (used only when LDAP_SERVERS_CONFIG is not set):

VariableDefaultPurpose
LDAP_URL–Full LDAP URL (alternative to hostname/port/SSL vars)
LDAP_HOSTNAME / LDAP_PORT / LDAP_USE_SSLlocalhost / 389 / falseConnection parameters
LDAP_BASE_DN–Default search base
LDAP_BIND_DN / LDAP_BIND_PASSWORDcn=Directory Manager / –Bind credentials (no default password)
LDAP_AUTH_METHODsimplesimple or anonymous (the only implemented binds; LDAPI/SASL EXTERNAL is selected via LDAP_USE_LDAPI, not here)
LDAP_IS_LOCAL / LDAP_SERVERIDfalse / –Enable local-instance features (logs, disk, certs)
LDAP_USE_LDAPIfalseConnect over the LDAPI unix socket
LDAP_IS_OFFLINEfalseTreat the local instance as stopped (offline mode)
LDAP_TLS_VERIFYtrueVerify the server certificate on remote ldaps:// connections (set false only for trusted labs)

Troubleshooting

SymptomCause / Fix
python-ldap fails to build during installMissing system headers — see the install playbook
Tools report a default localhost server instead of your configLDAP_SERVERS_CONFIG not set or not loadable in the MCP client config — see servers.json path resolution
list_* tools return only counts; ldap_search/get_user_details refuse to runThat's privacy mode (default, working as intended) — see Privacy Mode
"requires a running server with a live LDAP connection" errorsThe target is an offline/archive server — the error message lists the tools that do work there
LDAPI connection fails for a local serverCheck serverid has no slapd- prefix and the instance socket exists

No LDAP server to test against? The Development Guide spins up test containers with Docker.

Limitations

  • Beta — Tool schemas, output formats, and configuration fields may change before 1.0.0
  • LLM interpretation — Tools return accurate data, but the LLM interprets it. Hallucinations are possible. Always verify recommendations before acting.
  • Read-only — No write operations yet
  • Plain text passwords — Use restrictive file permissions on config files
  • STDIO transport only — No HTTP/SSE support yet

Documentation

DocumentDescription
ChangelogVersion history and release notes
Archive / SOS playbookSummarize an SOS report before opening the case
Install playbookpython-ldap builds, WSL2, uvx, config path resolution
Development GuideDev environment setup, configuration, architecture
Testing GuideRunning and writing tests
Contributing GuideHow to contribute
Release ChecklistHow releases are cut and verified
389 DS Tools389 Directory Server tools reference
OpenLDAP ToolsOpenLDAP tools reference (experimental, opt-in only)

License

GPL-3.0-or-later. Built on lib389 (the official 389 Directory Server administration library) and FastMCP.

References

來源:README.md,提交 7037137

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分