mcpAD
You can inspect and audit Active Directory/LDAP data through read-only MCP tools covering identity, directory objects, security posture, and policy configuration.
Test AD connectivity, identify the bound identity, and check server health.
Search and retrieve users, groups, computers, contacts, OUs, and arbitrary entries by DN.
Inspect group membership, user groups, nested membership, and admin/privileged group membership.
Audit account risk and hygiene: disabled/locked accounts, inactive/stale objects, password flags, expired accounts, SPNs, Kerberos pre-auth, adminCount, and missing email.
Inspect domain settings, password policies, fine-grained password policies, privileged groups, FSMO roles, trusts, sites, domain controllers, and GPOs.
Find empty OUs/groups, recently created/modified objects, and summarize computer OS inventory.
Run custom read-only LDAP searches for queries not covered by typed tools.
Scope many searches by domain and optional base DN, with result limits capped by the server.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcpAD find disabled user accounts in the Sales department"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcpAD
A FastMCP server that exposes the
msad Active Directory / LDAP library as MCP tools.
Built with Python 3.14 and uv. It reuses the typed, public msad API
(search users/groups, memberships, account status, read-only security audits).
All tools are read-only by default; optional group-membership write tools are
disabled unless MCPAD_ALLOW_WRITE is enabled (see Write tools).
Tools
Tool | Description |
| Find users by name/surname/mail/sam/department/city/state/country (ANDed, |
| Get a single user (exact match) |
| Find groups ( |
| Get a single group (exact match) |
| Find computers by name/dns/os ( |
| Get a single computer (sAMAccountName/cn/dNSHostName) |
| Find AD contact objects by cn/mail/displayName ( |
| Find organizational units by name ( |
| Get a single OU by its |
| List objects under an OU (optionally filtered by |
| Organizational units with no nested sub-OU (hygiene/audit) |
| Find users whose last logon is older than |
| Find computers whose last logon is older than |
| List disabled user accounts (audit; counterpart of |
| List locked-out user accounts (audit; counterpart of |
| List users whose password never expires (audit) |
| List users whose ACCOUNT (not password) never expires |
| List users whose |
| Risk: users with the |
| Risk: users not requiring Kerberos pre-auth (AS-REP roasting exposure) |
| Risk: accounts flagged "sensitive and cannot be delegated" |
| Risk: users with a Service Principal Name set (Kerberoasting exposure) |
| Users with |
| Enabled users who must change their password at next logon ( |
| Data-quality check: users with no |
| Members of well-known privileged groups (admin-account audit) |
| Owners of the five FSMO roles (schema, domain-naming, PDC, RID, infrastructure) |
| Domain trust relationships ( |
| Active Directory sites (from the Configuration naming context) |
| Domain controllers (computer accounts flagged |
| Count of computer accounts grouped by operating system |
| Groups with no direct members (hygiene/audit) |
| List security-enabled groups, optionally by |
| List distribution groups (complement of |
| Group Policy Objects ( |
| A single GPO by its |
| Fine-grained password policies (PSOs) |
| Objects whose |
| Objects whose |
| Domain object: security-relevant settings and metadata (audit) |
| Default domain password policy (audit) |
| Users whose password violates the policy (audit) |
| Well-known privileged groups with member counts (audit) |
| Fetch any entry directly by its DN (resolve |
| Resolve a sAMAccountName (or DN) to a distinguished name |
| Run a raw, read-only LDAP search with a custom filter (power-user escape hatch) |
| List group members (direct or |
| List a user's groups (nested by default) |
| Is a user a (nested) member of a group? |
| Is an account disabled? |
| Is an account locked? |
| Test AD connectivity and bind (returns ok/target/auth/error) |
| Identity bound as (RFC 4532 "Who Am I?"); works with Kerberos too |
| Server health check (server name, msad version, connectivity) |
The find_users, find_groups, find_computers and find_ous tools accept an
optional base (a DN, e.g. an OU) to restrict the search to that subtree
instead of the whole domain.
Tool annotations
Every tool advertises standard MCP behavior hints so a client can reason about
its risk without parsing the name or docstring. All the tools above are
read-only (readOnlyHint: true); the optional write tools (see below) are
marked destructiveHint: true (and readOnlyHint: false).
Returned attributes
By default get_user / find_users return a useful attribute set: identity
fields plus manager — the distinguished name (DN) of the user's manager,
e.g. CN=Anna Bianchi,OU=Staff,DC=group,DC=example,DC=com — as well as
memberOf (direct group DNs), userAccountControl, accountExpires,
lastLogonTimestamp and whenCreated. Group lookups include managedBy (the
DN of the group's owner), member, groupType and whenCreated.
To expand a manager (or any DN-valued field) into a full record, call
get_by_dn with that DN. This is a direct, efficient lookup (the DN is used as
the search base), so an agent can do: get_user("mrossi") → read manager →
get_by_dn("<that DN>").
Decoded attributes
By default the server also adds decoded companion keys next to the raw attributes, so a client doesn't have to interpret AD's opaque numbers and binary blobs:
userAccountControl_decoded— a flag list plus booleans (disabled,locked,password_never_expires, ...);groupType_decoded—scope(global / domain_local / universal) and security vs. distribution;objectSid_decoded/objectGUID_decoded— canonicalS-1-5-.../ GUID strings;<attr>_iso— an ISO-8601 timestamp for FILETIME attributes (accountExpires,lastLogonTimestamp,pwdLastSet,lockoutTime, ...), omitted for the "never"/unset sentinels.
The raw attributes are always preserved. Decoding is on by default; set
MCPAD_DECODE_ATTRS to a falsy value (0, false, no, off) to return raw
attributes only.
Write tools
The tools above are all read-only. Two optional write tools modify AD
group membership and are therefore disabled by default. They are registered
only when the MCPAD_ALLOW_WRITE environment variable is set to a truthy value
(1, true, yes, on):
Tool | Description |
| Add a user to a group (both as sAMAccountName or DN) |
| Remove a user from a group (both as sAMAccountName or DN) |
| Unlock a locked-out user account (resets |
MCPAD_ALLOW_WRITE=1 uv run mcpad # write tools registered
uv run mcpad # read-only (default)The service account used by msad must have the directory permissions to
modify the target groups; otherwise the call fails with an MsadError. When
writes are disabled the tools are not advertised at all, so an agent cannot
invoke them.
Two-phase confirmation
All write tools are two-phase. The first call (confirm=false, the
default) makes no change and returns a preview:
{ "status": "confirmation_required", "ok": false, "group": "Sales", "user": "jdoe",
"message": "Would add user 'jdoe' to group 'Sales'. Re-call with confirm=true ..." }Call again with confirm=true — only after explicit human approval — to apply
the change. An agent must never set confirm=true on its own.
Safety guard-rails
Even with writes enabled, membership changes that touch sensitive objects are
refused (returned as status: "error"), regardless of confirm:
Protected accounts —
administrator,admin,krbtgt,guest,system, plus any name matching a service/machine pattern (*$machine accounts,svc_*,service_*,sa_*,adm_*,sys_*).Protected groups —
Domain Admins,Enterprise Admins,Schema Admins,Administrators, the operator groups,Group Policy Creator Owners,DnsAdmins, andDomain Users(critical system group).
Matching is case-insensitive and works whether you pass a sAMAccountName or a
full DN. Extend or tune via environment variables:
Variable | Effect |
| Comma-separated extra account names to protect |
| Comma-separated extra group names to protect |
| Set truthy to turn the checks off (not recommended) |
Related MCP server: adds-mcp
Audit logging
Set MCPAD_AUDIT_LOG to a file path to record every tool call (read-only
and write alike) as one JSON object per line (JSON-lines). Logging is off by
default.
MCPAD_AUDIT_LOG=/var/log/mcpad/audit.log uv run mcpadEach entry carries the UTC timestamp, the tool name, the (redacted) arguments, the status, the business outcome, the duration, and — on failure — the error:
{"ts": "2026-10-18T20:09:34.029995+00:00", "tool": "add_group_member",
"params": {"group": "Sales", "user": "jdoe", "confirm": true},
"status": "ok", "outcome": "applied", "duration_ms": 12.4}Notes:
Sensitive argument values (
password,new_password,old_password,token, ...) are replaced with***REDACTED***.statusrecords only whether the Python call returned (ok) or raised (error). Theoutcomefield records what actually happened:completed— a read-only tool returned normally (the common case);preview— a two-phase write returned its confirmation preview and changed nothing (confirm=false);blocked— a safety guard-rail refused the write;applied— a write was confirmed and executed;failed— the call raised (paired withstatus: "error").
The parent directory is created if needed; if the path cannot be opened the server logs a warning and continues without audit logging (tool calls are never blocked by an unwritable log).
Result limits
Every tool's limit argument is clamped to a hard ceiling so a single call
can't pull an unbounded number of rows from a domain controller. The default
ceiling is 1000; a limit above it — or limit=0, which the underlying
msad library treats as "no limit" — is rewritten to the ceiling. A limit
below the ceiling is used as-is.
MCPAD_MAX_LIMIT=500 uv run mcpad # lower the ceiling to 500MCPAD_MAX_LIMIT must be a positive integer; a missing, empty, non-numeric or
non-positive value falls back to the default of 1000. The effective (capped)
value is what appears in the audit log.
Prompts
The server ships a few MCP prompts — reusable, read-only workflows that guide an agent through multi-step tasks using the tools above. They produce instructions only and never modify anything.
Prompt | Description |
| Walk a read-only domain security audit (policy, admins, stale/violating accounts) and summarize by risk |
| Find and triage inactive users and stale computers (parameter: |
| Report direct vs. nested membership and the owner of a given |
Authentication & connection
The server has no connection settings of its own: it reuses the msad
configuration file, ~/.msad.toml by default (create it with msad init).
Each tool call opens a short-lived connection through msad.connect().
Domain parameters (~/.msad.toml)
[defaults]
domain = "group" # used when a tool call omits `domain`
[domains.group]
host = "dc.example.com" # hostname only (no scheme, no :port)
base = "dc=group,dc=example,dc=com"
port = 636 # default: 389
use_ssl = true # default: false (true = LDAPS)
# user = "svc_account" # optional (see auth below)
# password = "..." # optional
# A second domain (here using user/password auth):
[domains.lab]
host = "dc.lab.example.com"
base = "dc=lab,dc=example,dc=com"
port = 636
use_ssl = true
user = "svc_reader"
password = "s3cr3t"You can declare several [domains.<name>] blocks and pick one per call with the
tool's domain argument, or globally via MSAD_DOMAIN. For example, an agent
can call find_users(surname="Rossi", domain="lab") to target the lab domain
while [defaults].domain stays group.
Overrides via environment
MSAD_DOMAIN— default domain when a tool call omitsdomainMSAD_CONFIG_FILE— path to an alternative TOML configMSAD_HOST,MSAD_BASE,MSAD_PORT,MSAD_USE_SSL,MSAD_USER,MSAD_PASSWORD,MSAD_QUERY_TIMEOUT— override individual connection fields on top of the TOML file (env always wins); same mechanism used by restAD and graphqlAD, so credentials can be injected at runtime without ever being written to~/.msad.toml.
These MSAD_* variables can be set directly in the env block of your MCP
client config — see
Registering the server with an MCP client / agent
for a full mcp.json example.
Authentication modes
The mode is chosen automatically from the domain block:
Kerberos (SASL) — when
user/passwordare not both set (the default). Requires installing mcpAD with the optionalkerberosextra (see Running with uvx or Installation below), which pulls inmsad'sgssapidependency. Obtain a ticket first:kinit # or: kinit <user>@REALMThe server relies on the system Kerberos ticket cache (or a keytab via
KRB5_CLIENT_KTNAME). If the ticket is missing or expired, tools fail with a cleanMsadConnectionErrormessage. When running as a background/remote service, make sure that process can see a valid ticket or keytab.Platform note — do you need
kinit? The Kerberos ticket is obtained by whichever backend msad'skerberosextra installs for your platform (see msad's README):gssapion macOS/Linux,winkerberoson Windows.On macOS/Linux the
gssapicredential cache is empty until you runkinit(or supply a keytab), so a ticket is required.On Windows,
winkerberoswraps native SSPI directly: a domain-joined machine running as a domain user reuses the ticket from the interactive logon, giving real SSO with nokinitneeded. This has not been verified end-to-end by this project against a real AD on Windows — validate it yourself (e.g. with msad'swhoami/test-connectionCLI commands) before relying on it. Windows still needs an explicit ticket/keytab when the host is not domain-joined, when running as a local/service account, or in other contexts without a logon ticket — which is the common case for an unattended/remote (streamable-http) deployment.User / password — when both
userandpasswordare set. Simple LDAP bind. The password is stored in clear text in the TOML, so restrict the file permissions (chmod 600 ~/.msad.toml).Note: setting only one of
user/passwordsilently falls back to Kerberos. Set both, or neither.
Use LDAPS (port = 636, use_ssl = true) whenever possible.
Installation
uvx mcpad
# or, from a checkout:
uv syncKerberos (SASL/GSSAPI) authentication is optional: msad's gssapi
dependency is a native extension that needs the system Kerberos dev headers
to build:
Debian/Ubuntu:
libkrb5-dev(+krb5-config)RHEL/Fedora:
krb5-develmacOS (Homebrew):
krb5
If you only authenticate with user/password, skip it entirely. To enable
Kerberos, install/sync the kerberos extra instead — see
Running with uvx below for the exact command.
Running
Running with uvx
No installation step needed; uvx downloads and runs mcpAD on the fly.
# User/password auth only (no Kerberos, no system headers needed):
uvx mcpad
# With Kerberos support (needs the system Kerberos dev headers above):
kinit # get a ticket first
uvx --from 'mcpad[kerberos]' mcpad
# Latest from Git instead of the PyPI release:
uvx --from 'mcpad[kerberos] @ git+https://github.com/matteoredaelli/mcpAD' mcpadFor an MCP client config (stdio), the equivalent command/args is:
{
"mcpServers": {
"mcpAD": {
"command": "uvx",
"args": ["--from", "mcpad[kerberos]", "mcpad"]
}
}
}The spawned process inherits the environment of whoever launches it, so a Kerberos ticket obtained with
kinitmust be valid in that session (see Local (stdio) below).
Keeping up to date.
uvxresolves the latest version only on its first invocation of a given spec; after that it reuses the cached environment indefinitely, even once a newer release is published (uv docs). Restarting your MCP client (which just re-spawns the sameuvxcommand) will not pick up a new mcpAD/msad release on its own. To force an update:# one-off: refreshes the cache, future launches reuse the new version uvx --refresh --from 'mcpad[kerberos]' mcpad --help # or: always re-check on every launch (small startup overhead) uvx --refresh --from 'mcpad[kerberos]' mcpadFor an MCP client config, add
--refreshtoargsif you want every restart to auto-update:"args": ["--refresh", "--from", "mcpad[kerberos]", "mcpad"]After updating, call the
healthtool to confirm the newmcpad_version/msad_version.
From a checkout (Makefile)
The Makefile wraps the common cases. Transport, host and port are
configurable:
make start-stdio # stdio (for local MCP clients)
make start-http # streamable-http on 127.0.0.1:8000
make start-http HOST=0.0.0.0 PORT=9000 # bind elsewhere
make start-sse # sse transport
make start TRANSPORT=streamable-http PORT=9000 # generic formEquivalent raw commands (the server reads MCP_TRANSPORT / MCP_HOST /
MCP_PORT from the environment):
uv run mcpad # stdio (default)
MCP_TRANSPORT=streamable-http MCP_PORT=9000 uv run mcpadRegistering the server with an MCP client / agent
MCP clients (Claude Desktop, IDE agents, custom agents, ...) usually accept a
JSON config with a mcpServers map. Two deployment styles:
Local (stdio) — the client launches the server
The client spawns the process and talks to it over stdio. This is the simplest setup and keeps everything on your machine (including your Kerberos ticket).
{
"mcpServers": {
"mcpAD": {
"command": "uv",
"args": [
"run",
"--directory", "/path/to/mcpAD",
"mcpad"
],
"env": {
"MSAD_DOMAIN": "group"
}
}
}
}To connect without a ~/.msad.toml, set the MSAD_* connection variables
directly in the env block — the server reads them live on every tool call
(env always wins over the TOML file). This example uses Kerberos (no
MSAD_USER / MSAD_PASSWORD):
{
"mcpServers": {
"mcpAD": {
"command": "uvx",
"args": ["--from", "mcpad[kerberos]", "mcpad"],
"env": {
"MSAD_HOST": "dc.example.com",
"MSAD_BASE": "dc=example,dc=com",
"MSAD_PORT": "636",
"MSAD_USE_SSL": "true",
"MSAD_QUERY_TIMEOUT": "30"
}
}
}
}For a user/password bind instead, add both MSAD_USER and
MSAD_PASSWORD to the same env block:
"env": {
"MSAD_HOST": "dc.example.com",
"MSAD_BASE": "dc=example,dc=com",
"MSAD_PORT": "636",
"MSAD_USE_SSL": "true",
"MSAD_USER": "svc_reader",
"MSAD_PASSWORD": "s3cr3t"
}Notes on the env block:
MSAD_HOSTandMSAD_BASEare the only required connection fields;MSAD_PORTdefaults to389andMSAD_USE_SSLtofalse.All values are strings (JSON has no bare integers/booleans here):
"636","true"/"false"(also1/0,yes/no,on/off) are coerced bymsad.Authentication mode is implicit: with
MSAD_USER/MSAD_PASSWORDunset (or only one set) the server uses Kerberos (see Authentication modes andkinit); set both for a user/password bind. Avoid committing a plaintextMSAD_PASSWORDto a shared config — prefer Kerberos or inject it from a secret store.MSAD_DOMAIN/MSAD_CONFIG_FILEstill work here to pick a domain or an alternative TOML when you do keep a config file.
Notes:
--directorymakesuvuse this project's environment regardless of the client's working directory.Kerberos: the spawned process inherits your environment, so a ticket obtained with
kinitin the same user session is used automatically. For an unattended client, point it at a keytab (e.g. add"KRB5_CLIENT_KTNAME": "/path/to.keytab"toenv).Prefer not to keep a checkout around? Use
uvxinstead — see the Running with uvx JSON example above (sameenvnotes apply).
Remote (streamable-http) — the server runs as a service
Start the server as a long-running HTTP service, then point the client at its URL. Useful when the server runs on a host that has AD/Kerberos access while the client runs elsewhere.
Start the service:
make start-http HOST=0.0.0.0 PORT=9000
# serves the MCP endpoint at http://<host>:9000/mcpClient config referencing the URL:
{
"mcpServers": {
"mcpAD": {
"transport": "http",
"url": "http://mcp-host.example.com:9000/mcp"
}
}
}Notes:
The default streamable-http path is
/mcp.The server itself performs no client authentication; if you expose it beyond localhost, put it behind a reverse proxy / network controls and treat the AD credentials on that host accordingly.
Kerberos runs where the server runs: that host needs a valid ticket or a keytab, not the client.
Development
uv sync
uv run python -c "import asyncio; from mcpad import mcp; print(asyncio.run(mcp.list_tools()))"The msad dependency can be installed
from its Git repository, or as an editable local path during development so that
library changes are picked up immediately.
Available Tools
54 toolsaudit_admin_accountsAudit Admin AccountsARead-only
Audit administrative accounts: members of well-known privileged groups.
Builds on get_privileged_groups (Domain Admins, Enterprise Admins,
Administrators, ...) and returns, per group that exists, its attributes,
member_count and the expanded members list. Set nested=False to list
only direct members instead of recursing into nested groups.
Inputs: domain, nested. Returns: result
disabled_usersDisabled UsersARead-only
List disabled user accounts (userAccountControl flag 2).
Audit counterpart of is_disabled: returns every disabled account instead
of checking a single user. Pass base (a DN) to scope to an OU, or
extra_filter to AND an extra raw LDAP clause (must be pre-escaped).
Inputs: base, limit, domain, extra_filter. Returns: result
expired_accountsExpired AccountsBRead-only
List users whose accountExpires date is in the past (excluding "never").
Pass base (a DN) to scope to an OU.
Inputs: base, limit, domain. Returns: result
find_admin_count_accountsFind Admin Count AccountsBRead-only
Find users with adminCount=1 (current or stale protected-admin marker).
AD sets adminCount=1 via AdminSDHolder on members of protected groups
(Domain Admins, Enterprise Admins, ...) and does not automatically clear
it once the account is later removed from every such group. Accounts
that still carry adminCount=1 but are no longer privileged keep a
non-inherited, hardened ACL and are a common audit finding. Pass base
(a DN) to scope to an OU.
Inputs: base, limit, domain. Returns: result
find_computersFind ComputersARead-only
Find AD computers by cn (name), dNSHostName (dns) or operatingSystem (os).
Criteria are ANDed; values may contain * wildcards. Set
exclude_domain_controllers=True to drop domain controllers from the
results. Pass base (a DN, e.g. an OU) to restrict the search to a
subtree.
Inputs: os, dns, base, name, +3 more. Returns: result
find_contactsFind ContactsARead-only
Find AD contact objects by cn/mail/displayName (supports * wildcards).
Passing no string matches every contact. Pass base (a DN, e.g. an OU)
to restrict the search to a subtree.
Inputs: base, limit, domain, string. Returns: result
find_distribution_groupsFind Distribution GroupsBRead-only
List distribution groups (complement of find_security_groups).
Pass base (a DN) to scope to an OU.
Inputs: base, limit, domain. Returns: result
find_empty_ousFind Empty OusARead-only
Find organizational units with no nested sub-OU (hygiene/audit).
Matches OUs whose ou attribute has no children. Pass base (a DN) to
scope to a parent OU.
Inputs: base, limit, domain. Returns: result
find_groupsFind GroupsBRead-only
Find AD groups by cn/name/sAMAccountName/displayName (supports * wildcards).
Pass base (a DN, e.g. an OU) to restrict the search to a subtree.
Inputs: string (required), base, limit, domain. Returns: result
find_inactive_usersFind Inactive UsersARead-only
Find users whose last logon is older than days (default 90).
Matches lastLogonTimestamp at or before the cutoff. Set
include_never=True to also return users that never logged on. Pass
base (a DN) to scope to an OU.
Inputs: base, days, limit, domain, +1 more. Returns: result
find_must_change_passwordFind Must Change PasswordARead-only
Find enabled users who must change their password at next logon.
Matches pwdLastSet=0, excluding disabled accounts. Pass base (a DN) to
scope to an OU.
Inputs: base, limit, domain. Returns: result
find_ousFind OusBRead-only
Find AD organizational units (OUs) by name (matches ou; may contain *).
Pass base (a DN) to search under a specific parent OU instead of the
whole domain.
Inputs: base, name, limit, domain. Returns: result
find_recently_createdFind Recently CreatedARead-only
Find objects whose whenCreated is within the last days days (default 7).
Pass object_class (e.g. "user", "group", "computer") to restrict to one
object type, and base (a DN) to scope to an OU.
Inputs: base, days, limit, domain, +1 more. Returns: result
find_recently_modifiedFind Recently ModifiedARead-only
Find objects whose whenChanged is within the last days days (default 7).
Useful for a "what changed recently in AD" audit. Pass object_class
(e.g. "user", "group", "computer") to restrict to one object type, and
base (a DN) to scope to an OU.
Inputs: base, days, limit, domain, +1 more. Returns: result
find_security_groupsFind Security GroupsARead-only
List security-enabled groups (as opposed to distribution groups).
Pass scope to restrict to one group scope: "global", "domain_local" or
"universal" (None returns security groups of any scope). Pass base (a
DN) to scope to an OU.
Inputs: base, limit, scope, domain. Returns: result
find_service_accountsFind Service AccountsBRead-only
Risk: list users with a Service Principal Name (SPN) set.
Any account with an SPN can have a Kerberos service ticket requested for
it by any authenticated user, then cracked offline ("Kerberoasting") if
its password is weak. Pass base (a DN) to scope to an OU.
Inputs: base, limit, domain. Returns: result
find_stale_computersFind Stale ComputersBRead-only
Find computers whose last logon is older than days (default 90).
Matches lastLogonTimestamp at or before the cutoff. Set
include_never=True to also return computers that never logged on. Pass
base (a DN) to scope to an OU.
Inputs: base, days, limit, domain, +1 more. Returns: result
find_usersFind UsersBRead-only
Find AD users by field. Criteria are ANDed; values may contain * wildcards.
city/state/country match the l/st/co attributes. Pass base
(a DN, e.g. an OU) to restrict the search to a subtree.
Inputs: sam, base, city, mail, +7 more. Returns: result
find_users_without_emailFind Users Without EmailARead-only
Data-quality check: list users with no mail attribute set.
Accounts without an email address often can't receive password-expiry
notices, MFA prompts or other automated notifications. Pass base (a DN)
to scope to an OU.
Inputs: base, limit, domain. Returns: result
get_by_dnGet By DnARead-only
Fetch any AD entry directly by its distinguished name (DN).
Use this to resolve DN-valued attributes into full records, e.g. the
manager of a user or the managedBy owner of a group. Returns None if
the DN does not exist.
Inputs: dn (required), domain. Returns: result
get_computerGet ComputerARead-only
Get a single AD computer by sAMAccountName, cn or dNSHostName (exact match).
Inputs: identifier (required), domain. Returns: result
get_dnGet DnARead-only
Resolve a sAMAccountName (or DN) to a distinguished name (DN).
Returns the value unchanged if it already looks like a DN, otherwise looks
it up. Returns None if not found. Handy before get_by_dn or
get_ou_contents.
Inputs: entry (required), base, domain. Returns: result
get_domain_infoGet Domain InfoBRead-only
Read the domain object: security-relevant settings and metadata (audit).
Inputs: domain. Returns: result
get_gpoGet GpoARead-only
Get a single Group Policy Object by its cn (GUID) or displayName.
The GUID may be given with or without braces. Returns None if not found.
Inputs: identifier (required), domain. Returns: result
get_groupGet GroupARead-only
Get a single AD group by sAMAccountName or cn (exact match).
Inputs: identifier (required), domain. Returns: result
get_ouGet OuARead-only
Get a single AD organizational unit by its ou name or full DN (exact).
Inputs: identifier (required), domain. Returns: result
get_ou_contentsGet Ou ContentsBRead-only
List the objects contained under an OU (given its DN).
Optionally restrict to a single object_class (e.g. user, group, computer,
organizationalUnit). Returns an empty list if the OU DN does not exist.
Inputs: ou_dn (required), limit, domain, object_class. Returns: result
get_password_policyGet Password PolicyBRead-only
Read the default domain password policy (maxPwdAge, minPwdLength, ...).
Inputs: domain. Returns: result
get_password_policy_violationsGet Password Policy ViolationsARead-only
Find users whose password violates the domain policy (audit).
Flags enabled users whose password has expired (older than the domain
maxPwdAge) and, when include_never_set is True, users who must set a
password at next logon (pwdLastSet=0). Accounts whose password never
expires are excluded. Returns an empty list if the domain has no maximum
password age.
Inputs: limit, domain, include_never_set. Returns: result
get_privileged_groupsGet Privileged GroupsARead-only
Report on well-known privileged groups (Domain Admins, ...) with counts.
Each entry includes the group's attributes plus member_count. Set
with_members=True to include a members list (use nested=True to
expand nested membership).
Inputs: domain, nested, with_members. Returns: result
get_userGet UserARead-only
Get a single AD user by sAMAccountName, UPN, mail or cn (exact match).
Inputs: identifier (required), domain. Returns: result
group_membersGroup MembersBRead-only
List members of a group. Set nested=True for recursive membership.
Inputs: group (required), limit, domain, nested. Returns: result
healthHealthBRead-only
Server health check: reports server name, mcpAD/msad version and AD connectivity.
Inputs: domain. Returns: object
is_disabledIs DisabledBRead-only
Return True if the account is disabled, None if the user is not found.
Inputs: user (required), domain. Returns: result
is_lockedIs LockedBRead-only
Return True if the account is locked, None if the user is not found.
Inputs: user (required), domain. Returns: result
is_memberIs MemberBRead-only
Return True if the user is a (nested) member of the group.
Inputs: user (required), group (required), domain. Returns: result
kerberos_preauth_not_requiredKerberos Preauth Not RequiredARead-only
Risk: list users not requiring Kerberos pre-authentication.
These accounts are vulnerable to offline (AS-REP roasting) password
guessing. Pass base (a DN) to scope to an OU.
Inputs: base, limit, domain. Returns: result
list_domain_controllersList Domain ControllersBRead-only
List the domain controllers (computer accounts flagged as DCs).
Matches the SERVER_TRUST_ACCOUNT userAccountControl flag. Returns the
usual computer attributes for each DC.
Inputs: limit, domain. Returns: result
list_empty_groupsList Empty GroupsARead-only
List groups with no direct members (hygiene/audit).
Matches groups whose member attribute is unset. Pass base (a DN) to
scope to an OU.
Inputs: base, limit, domain. Returns: result
list_fine_grained_password_policiesList Fine Grained Password PoliciesARead-only
List fine-grained password policies (PSOs) (audit).
Reads msDS-PasswordSettings objects under
CN=Password Settings Container,CN=System,<base>. Reading them may require
extra directory rights; returns an empty list if the container is not
readable.
Inputs: limit, domain. Returns: result
list_fsmo_rolesList Fsmo RolesARead-only
Report the owner of each of the five FSMO roles (audit).
Returns one entry per role (schema_master, domain_naming_master,
pdc_emulator, rid_master, infrastructure_master) with the container
queried and the owning DSA DN (owner). The schema and domain-naming
masters live in the Configuration naming context, derived from the domain
base for a single-domain forest; pass config_base explicitly for a
multi-domain forest. Containers the service account cannot read are skipped.
Inputs: domain, config_base. Returns: result
list_gposList GposBRead-only
List Group Policy Objects (audit).
Reads groupPolicyContainer objects under CN=Policies,CN=System,<base>.
Each GPO's cn is its GUID and displayName the friendly name. Returns an
empty list if the Policies container cannot be read.
Inputs: limit, domain. Returns: result
list_sitesList SitesARead-only
List the Active Directory sites (audit).
Reads site objects from CN=Sites,CN=Configuration,<forest root>. The
Configuration naming context is derived from the domain base for a
single-domain forest; pass config_base explicitly for a multi-domain
forest. Returns an empty list if the container cannot be read.
Inputs: limit, domain, config_base. Returns: result
list_trustsList TrustsARead-only
List the domain's trust relationships (audit).
Reads trustedDomain objects under CN=System,<base>: trust partner,
direction, type and attributes. Returns an empty list if the container
cannot be read.
Inputs: limit, domain. Returns: result
locked_usersLocked UsersARead-only
List locked-out user accounts (lockoutTime >= 1).
Audit counterpart of is_locked: returns every locked account instead of
checking a single user. Pass base (a DN) to scope to an OU, or
extra_filter to AND an extra raw LDAP clause (must be pre-escaped).
Inputs: base, limit, domain, extra_filter. Returns: result
never_expires_passwordNever Expires PasswordARead-only
List users whose password never expires (userAccountControl flag 65536).
A common security-audit check. Pass base (a DN) to scope to an OU, or
extra_filter to AND an extra raw LDAP clause (must be pre-escaped).
Inputs: base, limit, domain, extra_filter. Returns: result
never_expiring_accountsNever Expiring AccountsARead-only
List users whose ACCOUNT (not password) never expires.
Matches accountExpires set to the "never" sentinel values (0 or
9223372036854775807). Distinct from never_expires_password, which checks
the password-never-expires UAC flag instead. Pass base (a DN) to scope
to an OU.
Inputs: base, limit, domain. Returns: result
not_delegatedNot DelegatedARead-only
Risk: list accounts flagged "sensitive and cannot be delegated".
Worth auditing when a sensitive privilege was granted without also
excluding the account from delegation (or vice versa). Pass base (a DN)
to scope to an OU.
Inputs: base, limit, domain. Returns: result
password_not_requiredPassword Not RequiredARead-only
Risk: list users with the PASSWD_NOTREQD UAC flag (account may have no password).
These accounts may have no password at all, letting anyone authenticate as
them and set their own. Pass base (a DN) to scope to an OU.
Inputs: base, limit, domain. Returns: result
search_ldapSearch LdapARead-only
Run a raw LDAP search with a custom filter (read-only, power-user escape hatch).
Use this when the typed tools (find_users, find_groups, ...) don't cover
a query. The search_filter is passed to LDAP verbatim, so it must be a
valid, already-escaped RFC 4515 filter, e.g.
(&(objectClass=user)(title=Manager)) or
(&(objectClass=group)(!(member=*))) for empty groups.
Inputs: search_filter (required), base, limit, domain, +1 more. Returns: result
summarize_computer_osSummarize Computer OsARead-only
Summarize computer accounts grouped by operating system (audit/report).
Returns {operatingSystem, count} rows sorted by descending count;
computers without an operatingSystem are grouped under (unknown). Pass
base (a DN) to scope to an OU.
Inputs: base, limit, domain. Returns: result
test_connectionTest ConnectionARead-only
Test connectivity and bind to the AD server without raising.
Returns a status dict with ok, target, auth and error. Use this to
verify the configuration and reachability before running other tools.
Inputs: domain. Returns: object
user_groupsUser GroupsBRead-only
List the groups a user belongs to (nested/recursive by default).
Inputs: user (required), limit, domain, nested. Returns: result
whoamiWhoamiARead-only
Report the identity the connection is bound as.
Uses the RFC 4532 "Who Am I?" extended operation: the directory server
reports the identity it actually authenticated, working with Kerberos/
SASL-GSSAPI as well as simple user/password bind. Returns
{"authzid": ...}.
Inputs: domain. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 54 tools
Most tools target a distinct object class plus action, and adjacent tools (find_users vs get_user vs get_by_dn, find_inactive_users vs find_stale_computers, is_disabled vs disabled_users) are explicitly cross-referenced in descriptions. The main soft spot is audit_admin_accounts, which is essentially get_privileged_groups(with_members=True, nested=True) wrapped in another tool, and search_ldap overlaps with the entire typed surface as an escape hatch.
The dominant pattern is verb_noun (find_users, get_group, list_gpos, get_ou_contents), but a large audit subset abandons verbs entirely for bare-noun or predicate phrasing: disabled_users, locked_users, password_not_required, not_delegated, never_expiring_accounts, group_members, user_groups. Predicate-named tools like password_not_required function as list queries, which reads oddly next to list_gpos. Still parseable, but three conventions coexist.
54 tools is far beyond a comfortable set; dozens are narrow single-purpose audit queries (kerberos_preauth_not_required, never_expires_password, find_users_without_email) that could collapse into a parameterized audit or search_ldap filter. The breadth reflects a genuinely large domain (users, groups, computers, OUs, GPOs, trusts, sites, FSMO, password policies), but the surface is too heavy for reliable tool selection.
Read-side coverage is excellent: nearly every AD object class and audit scenario has a dedicated query, plus search_ldap as a fallback. However, the surface is entirely read-only, so an agent that finds a stale or risky account has no path to disable, unlock, reset a password, or modify group membership, which is a notable dead end for an AD server.
Maintenance
Related MCP Connectors
Read-only AgentiScript concept search, catalog, authenticity, license, and approved asset discovery.
Read-only search of the Agent Connectors MCP directory.
Provides read access to your GKE and Kubernetes resources.
Read-only checks for DIDs, credentials, MCP servers, A2A cards and agent delegation.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables managing Active Directory users, groups, and computers using natural language, with support for queries and updates.59MIT
- FlicenseNot gradedqualityCmaintenanceProvides read-only tools for monitoring and investigating Active Directory Domain Services, including users, groups, OUs, computers, GPOs, and domain metadata via LDAPS.-
- FlicenseNot gradedqualityCmaintenanceRead-only MCP server for Microsoft Entra ID (Azure AD) that enables querying user sign-in logs, group memberships, and assigned Microsoft 365 licenses via Microsoft Graph API. Provides security and audit visibility without any write operations.-
- AlicenseNot gradedqualityCmaintenanceEnables Active Directory administration over LDAPS, including reading and writing users, computers, and groups with a dry-run-first safety guard.MIT