adslayer
adslayer is an MCP server that lets an AI agent read and change on-premises Active Directory by running short JavaScript scripts in a sandbox, as the signed-in Windows user, over Kerberos against one domain.
execute — run a JS script against a domain via the
adobject:get,search(LDAP filters, up to 20,000 results),whoami,add,modify,delete(incl. tree),move,getAcl,addAce,removeAce; plus thegpoobject for Group Policy:list,get,create,delete,link,unlink,set/removeregistry policy values,backup,grant/revokeuser rights, andsetSecurityfor password/lockout policy, Security Options and Registry Values.search — query a domain's catalogue: schema classes and attributes (syntax, confidential, indexed, ranges), LDAP controls, extended rights, and ADMX policy settings; cached for the session,
refresh: trueafter schema changes.docs — search Microsoft Learn for AD DS, LDAP, schema, Group Policy, LAPS, delegation and Recycle Bin topics.
connections_list / connection_add / connection_remove — manage stored domain connections by DNS name or alias, in read or write mode (no passwords stored).
Read vs write modes — a read connection refuses all add/modify/delete/move/ACL and GPO changes before anything is sent; a write connection is limited only by the Active Directory permissions of the Windows account.
Indirect tasks — reset passwords, rename GPOs, create/set WMI filters, configure Windows Firewall policy, find and restore deleted objects from the Recycle Bin, read and delegate permissions, protect objects from accidental deletion.
Output & limits — script return values and logs (capped at ~10,000 tokens) go to the model's context; up to 200 calls per run, with the calls list, logs, errors and truncation flag returned.
No safety net — no backups, previews or server-side log (backup/preview are left to external skills); all actions run as the current Windows user.
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., "@adslayer list all users in the Sales OU"
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.
adslayer
adslayer is an MCP server that lets an AI agent read and change on-premises Active Directory. The agent writes a short JavaScript script, and adslayer runs it in a sandbox against one domain.
adslayer has three main tools, the same as graphslayer:
executeruns a script against a domain.searchruns a script over the domain's catalogue. The catalogue holds every class and attribute in the schema, the LDAP controls, the extended rights, and the policy settings a GPO can set. adslayer reads the catalogue from the domain the first time you search it and keeps it for the session (ADR-0010).docssearches Microsoft Learn.
It also has connections_list, connection_add and connection_remove.
How it works
adslayer runs on a Windows machine that is joined to the domain. Every call runs as the Windows user who is signed in, over Kerberos with signing and sealing. adslayer stores no password and no certificate. What you can do through adslayer is exactly what your Active Directory account can do (ADR-0002).
The Node code has no LDAP client of its own. adslayer starts a PowerShell process, helper/adslayer-helper.ps1, and keeps it running. The helper sends each call to the domain's PDC emulator (ADR-0003, ADR-0006).
Each script runs in a workerd isolate with no network access. A script can reach only two objects. The ad object reads and writes directory objects. The gpo object reads and changes Group Policy objects through Microsoft's GroupPolicy module (ADR-0007).
const r = await ad.search({ base: "OU=Sales,DC=contoso,DC=local", filter: "(objectClass=user)", attributes: ["sAMAccountName"] });
return r.entries.map(e => e.attributes.sAMAccountName[0]);// Turn on "Do not display the lock screen" in a GPO
await gpo.set("Workstation Baseline", { key: "HKLM\\Software\\Policies\\Microsoft\\Windows\\Personalization", valueName: "NoLockScreen", type: "DWord", value: 1 });gpo.get also returns a GPO's security settings: password and lockout policy, user rights, Security Options, Restricted Groups and audit policy. gpo.grant and gpo.revoke change who holds a user right, one account at a time, and gpo.setSecurity changes one password, lockout or Security Options value (ADR-0011). A GPO that defines a user right replaces the whole list on the computers it applies to, and a computer keeps a right after a GPO stops setting it.
Related MCP server: DeskTether MCP Server
Installation
Follow these steps in order on the Windows machine where your AI agent runs. Each step says how to check it and how to fix it. Run the commands in PowerShell as yourself, not as an administrator, except where a step says otherwise.
Before you start
The machine has to be a member of the domain you want to reach. A domain controller works too.
adslayer acts as the Windows user who is signed in. Sign in as the user whose Active Directory rights you want your AI agent to have. adslayer never asks for a password.
Steps 2 to 4 may need an administrator, because they install software.
1. Check that the machine is on the domain
(Get-CimInstance Win32_ComputerSystem).DomainThis should print your domain's DNS name, for example contoso.local. If it prints WORKGROUP, the machine is not joined to a domain, and adslayer cannot work on it.
2. Install Node.js 22 or newer
Check:
node --versionIf this prints v22 or higher, go to step 3. If it prints an error or a lower version, install Node.js LTS. Then close PowerShell, open it again, and check again.
winget install OpenJS.NodeJS.LTS3. Install the Microsoft Visual C++ Redistributable
adslayer runs each script in a sandbox, and the sandbox cannot start without this runtime. Windows Server does not include it.
Check:
Test-Path "$env:SystemRoot\System32\vcruntime140_1.dll"If this prints True, go to step 4. If it prints False, install it with the command below, or download it from https://aka.ms/vs/17/release/vc_redist.x64.exe.
winget install Microsoft.VCRedist.2015+.x644. Install Group Policy Management
adslayer needs this to read and change GPOs. Domain controllers already have it.
Check:
Test-Path "$env:SystemRoot\System32\WindowsPowerShell\v1.0\Modules\GroupPolicy"If this prints True, go to step 5. If it prints False, open PowerShell as administrator and run the command for your version of Windows.
On Windows 10 or 11:
Add-WindowsCapability -Online -Name Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0On Windows Server:
Install-WindowsFeature GPMCYou do not need to install PowerShell. adslayer uses Windows PowerShell 5.1, which comes with Windows, or PowerShell 7 if you have it.
5. Add your domain
npx -y adslayer connect contoso.localUse your own domain name from step 1. This adds the domain in read mode, so the agent can read but not change anything. The first run downloads adslayer from npm before it adds the domain. It should print Added "contoso.local" (contoso.local), mode read.
To let the agent make changes too, add the domain in write mode. See Connections before you do.
npx -y adslayer connect contoso.local --alias contoso-write --mode write6. Add adslayer to your AI agent
For Claude Code, run:
claude mcp add adslayer -- npx -y adslayerFor Claude Desktop and other AI agents, add this to the agent's config file. For Claude Desktop on Windows, the file is %APPDATA%\Claude\claude_desktop_config.json.
{
"mcpServers": {
"adslayer": {
"command": "npx",
"args": ["-y", "adslayer"]
}
}
}Then restart your AI agent.
7. Check that it works
Ask your AI agent:
Use adslayer to run
return await ad.whoami();against contoso.local.
The answer should show your own account, for example u:CONTOSO\jane, and the name of the domain controller that adslayer sends its calls to. If it shows an error, see Problems.
Problems
What you see | What to do |
| Run adslayer on Windows, on a machine joined to the domain. See step 1. |
| Do step 3, then restart your AI agent. |
| Do step 5. Run |
| Do step 4, then restart your AI agent. |
| Active Directory refused the change for your account. adslayer can do only what your account can do. |
Your AI agent does not list the adslayer tools | Restart your AI agent. In Claude Code, run |
Update
npx keeps a copy of adslayer and may keep using it after a new version comes out. To get the newest version, close your AI agent, delete the folder %LOCALAPPDATA%\npm-cache\_npx, and start the agent again.
Uninstall
Follow these steps on the machine where you installed adslayer. Uninstalling changes nothing in Active Directory. adslayer adds nothing to the domain itself, and any changes your AI agent made through adslayer stay in place.
1. Remove adslayer from your AI agent
For Claude Code, run:
claude mcp remove adslayerThen run claude mcp list. adslayer should no longer be in the list.
For Claude Desktop and other AI agents, open the agent's config file and delete the "adslayer" entry under mcpServers. For Claude Desktop on Windows, the file is %APPDATA%\Claude\claude_desktop_config.json. Then restart your AI agent.
2. Delete your list of domains
Remove-Item -Recurse -Force "$env:USERPROFILE\.adslayer"This folder holds only the domains you added with connect. It holds no passwords.
3. Delete the copy that npx downloaded
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\npm-cache\_npx"This deletes every package that npx has downloaded, not only adslayer. For any other tool that runs through npx, npx downloads it again the next time it runs.
4. Delete GPO backups, if you made any
gpo.backup writes each backup to the folder on this machine that the script named. adslayer does not keep a list of these folders. A backup folder holds a manifest.xml file and one folder per GPO, named by the GPO's id in braces. Delete a backup only if you no longer need it, because it is the only way to restore that GPO to the state it was in.
5. Decide whether to keep the software from installation steps 2 to 4
Other programs on this machine may use Node.js, the Visual C++ Redistributable or Group Policy Management. Keep them unless you installed them only for adslayer. To remove them, run PowerShell as administrator.
winget uninstall OpenJS.NodeJS.LTS
winget uninstall Microsoft.VCRedist.2015+.x64To remove Group Policy Management on Windows 10 or 11, run:
Remove-WindowsCapability -Online -Name Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0On Windows Server, run Uninstall-WindowsFeature GPMC. Do not remove it from a domain controller, because the people who manage the domain use it there.
Connections
A connection is one domain, stored with its alias and its mode in %USERPROFILE%\.adslayer\connections.json. It holds no password.
npx -y adslayer connect contoso.local # read mode
npx -y adslayer connect contoso.local --alias corp --mode write
npx -y adslayer connections
npx -y adslayer disconnect corpThe agent can also add a connection with the connection_add tool, in either mode (ADR-0005). If you want a person to decide when writes are allowed, add only read connections and deny connection_add calls in your MCP client.
Writes
A read connection refuses every add, modify, delete, move, addAce and removeAce, and every GPO change, before anything is sent. It can still read permissions with getAcl. gpo.backup is allowed, because it changes nothing in the domain. That mode check is the only limit adslayer puts on a write. A write connection sends whatever the script asks for, and Active Directory permissions decide the rest (ADR-0004).
To bring back a deleted object, a script finds it in the Recycle Bin with ad.search and the showDeleted control, then restores it with ad.modify and the same control. A read connection can find deleted objects but cannot restore them.
Some changes have no call of their own, because the calls adslayer has can already make them. Each of these was tested on the lab domain controller with spike/lab-checks.mjs. The execute tool description has an example script for each one.
Reset a password. Use
ad.modifyto replaceunicodePwdwith the new password in double quotes, encoded as UTF-16LE and passed as{ base64 }. Add a replace ofpwdLastSetwith"0"to make the user change it at the next sign-in. A password that breaks the domain's password policy fails withUnwillingToPerformand0000052Din the message, and the old password keeps working.Rename a GPO. Use
ad.modifyto replacedisplayNameon the GPO's object underCN=Policies,CN=System.Rename-GPOchanges only that attribute, so the result is the same.Rename-GPOrefuses a name another GPO already has, andad.modifydoes not, so check the name first. Two GPOs with the same name cannot be found by name.Make a WMI filter and set it on a GPO. Use
ad.addto make anmsWMI-Somobject underCN=SOM,CN=WMIPolicy,CN=System, then usead.modifyto set the GPO'sgPCWQLFilterto[domain;{filter id};0]. GPMC,gpo.getandgpresultall show the filter, and computers apply it. To take it off, deletegPCWQLFilter. By default only Domain Admins and Group Policy Creator Owners can make a WMI filter.Set Windows Firewall policy. Use
gpo.seton keys underHKLM\Software\Policies\Microsoft\WindowsFirewall. The profile settings, e.g.DomainProfile\EnableFirewall, are DWord values. A rule is a String value underFirewallRules, named by a new GUID, e.g.v2.10|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Domain|LPort=443|Name=HTTPS in|. GPMC and the firewall cmdlets read these settings, and computers apply them. adslayer does not check the rule text.
adslayer does not back anything up, show a preview, or keep its own log. The dont-nuke-prod skills hold those steps. Without them, an agent gets no backup and no preview. Active Directory's own security log, with Directory Service Changes auditing turned on, records each change.
Where results go
Whatever a script returns goes into the model's context, so it goes to your model provider. With adslayer that is usually directory data, e.g., names and group memberships. Make sure your agreement with the domain's owner covers this (ADR-0009).
Develop
npm test # runs on any OS; LDAP calls go to a fake helper
npm run typecheckspike/ holds the scripts that test adslayer against the lab domain controller from azure-ad-lab. spike/run-on-lab.ps1 tests the helper alone. spike/run-e2e-on-lab.ps1 installs the packed server on the DC and drives it with a real MCP client.
License
MIT
Available Tools
6 toolsconnection_addAdd a domain connectionAIdempotent
Add an Active Directory domain by its DNS name. No sign-in: every call runs as the Windows user this server runs as, so that user's own permissions apply. A read connection refuses every add, modify, delete and move; choose write only when the person wants changes made. Adding an alias that exists replaces it.
Inputs: domain (required), mode, alias. Returns: connection
connection_removeRemove a domain connectionBDestructiveIdempotent
Remove a stored domain connection. Nothing in the domain changes.
Inputs: alias (required). Returns: removed
connections_listList domain connectionsARead-onlyIdempotent
List the Active Directory domains this server can reach, with each one's mode. Use the alias or the domain name as the domain argument of execute.
Inputs: no named parameters. Returns: connections
docsSearch Microsoft LearnARead-onlyIdempotent
Search the Microsoft Learn documentation. Use it to answer how something in Active Directory works before or instead of reading a domain: Active Directory Domain Services, LDAP and its controls, the schema, Group Policy and its settings, Windows LAPS, delegation and permissions, and the Recycle Bin.
Returns the most relevant passages, each with its page title and link. To find an attribute or a policy setting, use search.
Inputs: query (required). Returns: results, truncated
executeRun an Active Directory scriptADestructive
Run a JavaScript script against one Active Directory domain. Use this for any read, filter, join, count, or change. Write the body of an async function and "return" the value you want back. Only what you return (and console.log) comes back to you, so filter and pick attributes inside the script. Output is capped at about 10,000 tokens.
Every call runs as the Windows user the server runs as, over Kerberos with signing and sealing, against the domain's PDC emulator, so Active Directory's own permissions decide what succeeds. Use connections_list to find domain aliases. Name objects by DN. Pass your own attributes; without them you get name, objectClass and sAMAccountName. A connection added in read mode refuses add, modify, delete, move, addAce and removeAce.
Available in the script: declare const ad: { // One object by DN, or null if there is none. Default attributes: name, objectClass, sAMAccountName. ["*"] for all. get(dn: string, attributes?: string[], opts?: { controls?: Controls }): Promise<Entry | null>; // Objects matching an LDAP filter. base defaults to the domain head, scope to "sub", max to 1000 (cap 20000). // more is true when there were more than max. Multi-valued attributes like member come back whole. search(opts: { filter?: string; base?: string; scope?: "base" | "one" | "sub"; attributes?: string[]; max?: number; controls?: Controls }): Promise<{ entries: Entry[]; more: boolean }>; // The account the server runs as, and the PDC emulator it talks to. whoami(): Promise<{ user: string; pdc: string; defaultNamingContext: string }>; // Writes. A read-mode connection refuses these four before anything is sent. add(dn: string, attributes: Record<string, Value | Value[]>): Promise<{ dn: string }>; // include objectClass modify(dn: string, changes: Array<{ op: "add" | "replace" | "delete"; attribute: string; values?: Value | Value[] }>, opts?: { controls?: Controls }): Promise<{ dn: string }>; delete(dn: string, opts?: { tree?: boolean }): Promise<{ dn: string }>; move(dn: string, to: { newParent?: string; newName?: string }): Promise<{ dn: string }>; // newName is an RDN, e.g. "CN=New Name" // Permissions. getAcl reads the owner and DACL, which needs no admin rights. A read-mode connection refuses addAce and removeAce. getAcl(dn: string): Promise<{ dn: string; owner: Principal; protected: boolean; aces: Ace[] }>; // objectType: an attribute, class or extended right name (find it with search) or a GUID. inheritedObjectType: a class. addAce(dn: string, ace: NewAce): Promise<{ dn: string }>; // Removes the entry that matches exactly; an Ace from getAcl can be passed back as it is. removed is false if none matched. removeAce(dn: string, ace: NewAce | Ace): Promise<{ dn: string; removed: boolean }>; }; // Group Policy, through Microsoft's GroupPolicy module on the PDC emulator. g is a GPO's name or id. // A read-mode connection refuses create, delete, link, unlink, set, remove, grant, revoke and setSecurity. declare const gpo: { list(): Promise<Gpo[]>; // With where it is linked and every registry policy value it sets. get(g: string): Promise<Gpo & { links: Link[]; computerSettings: Setting[]; userSettings: Setting[]; securitySettings: SecuritySettings }>; create(name: string, opts?: { comment?: string }): Promise; delete(g: string): Promise<{ id: string; name: string; deleted: true }>; // Creates the link, or changes it if the GPO is already linked there. target is an OU or the domain DN. link(g: string, target: string, opts?: { enabled?: boolean; enforced?: boolean; order?: number }): Promise<{ id: string; links: Link[] }>; unlink(g: string, target: string): Promise<{ id: string; links: Link[] }>; // key starts with HKLM\ (computer) or HKCU\ (user). Find keys with search over catalogue.policies. set(g: string, s: { key: string; valueName: string; type: "String" | "ExpandString" | "DWord" | "QWord" | "MultiString"; value: string | number | string[] }): Promise; remove(g: string, key: string, valueName?: string): Promise; // Backup-GPO to a folder on the machine adslayer runs on. Allowed on a read connection. backup(g: string, path: string): Promise<{ id: string; backupId: string; path: string; timestamp: string }>; // Security settings (GptTmpl.inf, ADR-0011). Each changes one thing and answers with what was there before. // A GPO that defines a user right REPLACES the whole list on the computers it applies to. So granting on a right // the GPO doesn't define yet (defined: "new") leaves only that principal: grant everyone who should keep it. // Revoking the last principal undefines the right (defined: false); computers keep their last list until another GPO sets it. grant(g: string, right: string, principal: string): Promise; // right e.g. "SeServiceLogonRight"; principal "CONTOSO\svc-web" or a SID revoke(g: string, right: string, principal: string): Promise; setSecurity(g: string, section: "System Access", key: string, value: number | string): Promise; // e.g. "MinimumPasswordLength", 14 setSecurity(g: string, section: "Registry Values", key: string, value: { type: 1 | 2 | 4 | 7; value: number | string | string[] }): Promise; // key MACHINE... }; interface Gpo { id: string; name: string; status: string; created: string; modified: string; computerVersion: number; userVersion: number; wmiFilter: string | null } interface Link { target: string; enabled: boolean; enforced: boolean; order: number } interface Setting { key: string; valueName: string; type: string; value: unknown } // From the GPO's security template (GptTmpl.inf). Empty when the GPO sets none. interface SecuritySettings { systemAccess: Record<string, number | string>; // password and lockout policy, e.g. MinimumPasswordLength, LockoutBadCount eventAudit: Record<string, number | string>; privilegeRights: Record<string, GpoPrincipal[]>; // user rights, e.g. SeInteractiveLogonRight groupMembership: Array<{ group: GpoPrincipal; members?: GpoPrincipal[]; memberOf?: GpoPrincipal[] }>; // Restricted Groups registryValues: Record<string, { type: number; value: number | string }>; // Security Options, keyed MACHINE... other: Record<string, Record<string, string>>; } interface GpoPrincipal { sid: string | null; name: string | null } interface RightChange { id: string; right: string; principal: GpoPrincipal; changed: boolean; defined: boolean | "new"; before: GpoPrincipal[]; after: GpoPrincipal[] } interface SecurityChange { id: string; section: string; key: string; changed: boolean; before: unknown; after: unknown } // Every attribute is an array. GUIDs and SIDs are strings; other binary values are { base64 }. interface Entry { dn: string; attributes: Record<string, Array<string | { base64: string }>> } type Value = string | number | boolean | { base64: string }; interface Principal { sid: string; name: string | null } // name e.g. "CONTOSO\Helpdesk" // rights: e.g. "GenericAll", "ReadProperty", "WriteProperty", "ExtendedRight", "CreateChild", "DeleteChild", "Delete", "DeleteTree", "WriteDacl" // inheritance: "All" = this object and everything below it; "Descendents" = only below it. type Inheritance = "None" | "All" | "Descendents" | "SelfAndChildren" | "Children"; interface Ace { principal: Principal; type: "allow" | "deny"; rights: string[]; objectType?: string; inheritedObjectType?: string; inheritance: Inheritance; inherited: boolean } interface NewAce { principal: string; type: "allow" | "deny"; rights: string[]; objectType?: string; inheritedObjectType?: string; inheritance?: Inheritance } // principal: "CONTOSO\Helpdesk" or a SID // showDeleted: see and restore objects in the Recycle Bin (CN=Deleted Objects). Restore = modify with it. interface Controls { showDeleted?: true } // Calls may run in parallel with Promise.all. Each run may make at most 200 calls.
Examples: // Enabled users in an OU, by name const r = await ad.search({ base: "OU=Sales,DC=contoso,DC=local", filter: "(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))", attributes: ["sAMAccountName"] }); return r.entries.map(e => e.attributes.sAMAccountName[0]);
// How many members a group has, nested groups not expanded const g = await ad.get("CN=Helpdesk,OU=Groups,DC=contoso,DC=local", ["member"]); return g?.attributes.member?.length ?? 0;
// Disable a user (514 = normal account + disabled) return await ad.modify("CN=Jane Doe,OU=Sales,DC=contoso,DC=local", [{ op: "replace", attribute: "userAccountControl", values: "514" }]);
// Reset a password. unicodePwd takes the password in double quotes as UTF-16LE bytes. Add pwdLastSet "0" to force a change at next sign-in. const pw = '"' + newPassword + '"'; let b = ""; for (let i = 0; i < pw.length; i++) { const c = pw.charCodeAt(i); b += String.fromCharCode(c & 255, c >> 8); } return await ad.modify("CN=Jane Doe,OU=Sales,DC=contoso,DC=local", [{ op: "replace", attribute: "unicodePwd", values: { base64: btoa(b) } }, { op: "replace", attribute: "pwdLastSet", values: "0" }]);
// Restore a deleted user from the Recycle Bin to where it was. Delete isDeleted first, then set the new DN. const controls = { showDeleted: true }; const gone = (await ad.search({ base: "CN=Deleted Objects,DC=contoso,DC=local", filter: "(&(isDeleted=TRUE)(sAMAccountName=jdoe))", attributes: ["lastKnownParent", "msDS-LastKnownRDN"], controls })).entries[0]; const to = "CN=" + gone.attributes["msDS-LastKnownRDN"][0] + "," + gone.attributes.lastKnownParent[0]; return await ad.modify(gone.dn, [{ op: "delete", attribute: "isDeleted" }, { op: "replace", attribute: "distinguishedName", values: to }], { controls });
// Who can reset passwords in an OU: full control, all extended rights, or the Reset Password right const acl = await ad.getAcl("OU=Sales,DC=contoso,DC=local"); return acl.aces.filter(a => a.type === "allow" && (a.rights.includes("GenericAll") || (a.rights.includes("ExtendedRight") && (!a.objectType || a.objectType === "User-Force-Change-Password")))).map(a => a.principal.name ?? a.principal.sid);
// Password and lockout policy for the domain, from the Default Domain Policy's security settings const sa = (await gpo.get("Default Domain Policy")).securitySettings.systemAccess; return { minLength: sa.MinimumPasswordLength, lockoutAfter: sa.LockoutBadCount };
// Let a service account log on as a service through a GPO. If the GPO doesn't define the right yet, granting // defines it with only this account on every computer it applies to, so read who holds it first. const before = (await gpo.get("Web Servers")).securitySettings.privilegeRights.SeServiceLogonRight; return await gpo.grant("Web Servers", "SeServiceLogonRight", "CONTOSO\svc-web"); // { changed, defined, before, after }
// Protect an OU from accidental deletion, as the admin tools do. AD allows a delete with Delete on the object or // DeleteChild on its parent, so deny both. To undo, removeAce the first; the parent's deny also protects its other children. await ad.addAce("OU=Sales,DC=contoso,DC=local", { principal: "S-1-1-0", type: "deny", rights: ["Delete", "DeleteTree"] }); return await ad.addAce("DC=contoso,DC=local", { principal: "S-1-1-0", type: "deny", rights: ["DeleteChild"] });
Inputs: code (required), domain (required). Returns: ok, logs, calls, error, +3 more
searchSearch the AD catalogueARead-onlyIdempotent
Search one domain's Active Directory catalogue: every class and attribute in its schema, which attributes are confidential, each attribute's syntax and whether it holds one value, which attributes a class may hold, the LDAP controls the domain controller supports, and the extended rights. Use it before execute to find the right attribute or class rather than guessing.
The catalogue is read from the domain the first time you search it, which takes a few seconds, and kept for the session. Pass refresh: true after a schema change. Your script runs with no network and cannot reach the domain.
Write the body of an async function and "return" the value you want back. Output is capped at about 10,000 tokens, so filter inside the script.
Available in the script: declare const catalogue: { domain: string; readAt: string; dc: string; schemaNamingContext: string; forestFunctionality: number; domainFunctionality: number; // 10 = Windows Server 2025 attributes: Record<string, { // keyed by lDAPDisplayName, e.g. "member" oid: string; guid?: string; syntax: string; // e.g. "DN", "UnicodeString", "LargeInteger", "SID" single: boolean; confidential?: true; indexed?: true; systemOnly?: true; linkID?: number; range?: [number | null, number | null]; propertySet?: string; description?: string; }>; classes: Record<string, { // keyed by lDAPDisplayName, e.g. "user" oid: string; guid?: string; kind: "structural" | "abstract" | "auxiliary" | "88"; parent: string; must: string[]; may: string[]; // including inherited and auxiliary-class attributes auxiliary: string[]; possibleSuperiors: string[]; description?: string; }>; controls: Array<{ oid: string; name?: string }>; // what the DC supports extendedRights: Record<string, { // keyed by name, e.g. "User-Force-Change-Password" displayName: string; guid: string; kind: "control" | "propertySet" | "validatedWrite" | "other"; appliesTo: string[]; }>; // Policy settings from the ADMX files (the domain's central store, or the local PolicyDefinitions). // To set one with gpo.set, prefix key with HKLM\ for class Machine or HKCU\ for class User. // A policy's own valueName is set to 1 to enable it; elements are its extra values. policies: Array<{ name: string; displayName: string; class: "Machine" | "User" | "Both"; key: string; valueName?: string; category: string; file: string; elements: Array<{ type: string; id?: string; valueName?: string; key?: string }> }>; policiesSource?: string; policiesError?: string; };
Examples: // Confidential attributes return Object.entries(catalogue.attributes).filter(([, a]) => a.confidential).map(([n]) => n);
// Attributes about passwords, with their syntax return Object.entries(catalogue.attributes).filter(([n]) => /pwd|password/i.test(n)).map(([n, a]) => ({ n, syntax: a.syntax, single: a.single }));
// Everything a user object may hold return catalogue.classes.user.may.length;
Inputs: code (required), domain (required), refresh. Returns: ok, logs, error, domain, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
execute and search are both script executors, but their targets are clearly separated (live domain vs local schema catalogue), and connection_add/remove/list/docs each have distinct scopes. Minor risk of confusing the two scripting tools, but descriptions resolve it well.
Names mix bare verbs (execute, search), a bare noun (docs), and resource_action compounds (connection_add/connection_remove/connections_list) with inconsistent pluralization. There is no predictable verb_noun pattern across the set.
Six tools is well-scoped for a server whose breadth lives inside the execute/search scripting surfaces. Connection lifecycle, documentation lookup, and schema search each earn their place without redundancy.
Covers domain connection lifecycle, full AD object and ACL read/write scripting, GPO lifecycle and security settings, schema/policy catalogue lookup, and Microsoft docs. No obvious dead ends for the stated AD and Group Policy management purpose.
Maintenance
Related MCP Connectors
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- FlicenseAqualityCmaintenanceProvides AI assistants with unified access to on-prem Active Directory via LDAP and Azure AD / Entra ID through the Microsoft Graph API. It enables comprehensive management and search of users, groups, computers, and cloud devices using 18 specialized tools.18-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely perform file operations, run terminal sessions, manage processes, search content, and inspect Git repositories on a local Windows machine under configurable permission and audit controls.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to see and control a Windows desktop through screenshots, built-in OCR, mouse and keyboard input, and accessibility trees read via UI Automation, MSAA and Chrome DevTools Protocol. It also manages windows, virtual desktops and element-level actions such as invoking controls or setting values, running on Node.js with the PowerShell that ships with Windows.9Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely work on Windows developer workstations through governed, project-scoped filesystem access, durable command execution, bounded search, Windows operations, and resource-aware runtime controls. It also supports optional developer-context backends for code navigation, repository graph exploration, and memory retrieval.1Apache 2.0