Click on "Install 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., "@Skills MCP ADReset the password for user bwayne and unlock their account"
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.
π About the Project
Skills MCP AD is a production-ready Model Context Protocol (MCP) server that enables AI assistants like Claude, ChatGPT, and Gemini to securely manage Active Directory environments.
Built by Skills IT and battle-tested in real MSP (Managed Service Provider) operations, this MCP delivers:
β¨ 45 comprehensive tools for complete AD lifecycle management π’ Multi-client architecture - manage multiple AD domains from a single codebase π Enterprise-grade security - Bearer Token authentication with audit logging β‘ Production-tested - deployed in real-world MSP environments π Easy scaling - add new AD domains in minutes with automated scripts
Why Skills MCP AD?
For Managed Service Providers (MSPs):
Manage multiple client Active Directory domains from one platform
Isolate configurations and credentials per client
Scale effortlessly as your client base grows
Reduce AD management overhead by 70%
For IT Teams:
AI-powered AD operations via natural language
Comprehensive toolset covering users, groups, OUs, computers, GPOs
Streamable HTTP transport compatible with Claude Code and Gemini
Automated onboarding/offboarding workflows
Architecture Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Claude / ChatGPT / Gemini β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β MCP Protocol (Streamable HTTP)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Skills MCP AD β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Users β β Groups β β OUs β β Computers β β
β β (14 tools) β β (10 tools) β β (8 tools) β β (7 tools) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Password β β GPOs β β Search β β Reports β β
β β (4 tools) β β (3 tools) β β (2 tools) β β (5 tools) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β LDAP/LDAPS Protocol
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Active Directory β
β (Windows Server / Samba AD) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββποΈ Multi-Client Architecture
The game-changer for MSPs: Skills MCP AD's unique architecture allows you to manage multiple Active Directory domains from a single codebase.
How It Works
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β .base-code/ β
β (Shared Codebase) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Source Code (Python, FastAPI, LDAP3) - 45 Tools β β
β β Single point of maintenance and updates β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Client A β β Client B β β Client C β
β Port: 8850 β β Port: 8851 β β Port: 8852 β
β Token: xxx β β Token: yyy β β Token: zzz β
β Config: β β Config: β β Config: β
β ad-config.json β β ad-config.json β β ad-config.json β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β AD Domain A β β AD Domain B β β AD Domain C β
β company-a.com β β company-b.com β β company-c.com β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββKey Benefits
β Single Codebase - Update once, deploy everywhere β Isolated Configurations - Each client has separate credentials and tokens β Independent Ports - Run multiple instances simultaneously β Easy Scaling - Add new clients in under 2 minutes β Cost Efficient - One deployment handles unlimited AD domains
Directory Structure
active-directory/
βββ .base-code/ # Shared source code (this repo)
β βββ src/ # Python MCP implementation
β βββ requirements.txt # Dependencies
β βββ README.md # This file
β
βββ client-a/ # Client A instance
β βββ ad-config/
β βββ ad-config.json # Client A AD credentials & config
β
βββ client-b/ # Client B instance
β βββ ad-config/
β βββ ad-config.json # Client B AD credentials & config
β
βββ scripts/
βββ install-client.sh # Script to add new clientsπΌ Need Help with Active Directory or AI?
Skills IT - Technology Solutions specializes in IT infrastructure and has deep expertise in Active Directory and Windows Server. Our team has expertise in Artificial Intelligence and Model Context Protocol (MCP), offering complete solutions for automation and system integration.
Our Services:
β Active Directory consulting and implementation
β Custom MCP development for your infrastructure
β AI integration with corporate systems
β User and group management automation
β Specialized training and support
π WhatsApp/Phone: +55 63 3224-4925 - Brazil π§π· π Website: skillsit.com.br π§ Email: contato@skillsit.com.br
"Transforming infrastructure into intelligence"
π Quick Start
Prerequisites
Python 3.11+ or Docker
LDAP access to Active Directory
Service account with appropriate AD permissions
Installation (Docker - Recommended)
# 1. Clone the repository
git clone https://github.com/DevSkillsIT/Skills-MCP-AD.git
cd Skills-MCP-AD
# 2. Configure your Active Directory connection
cp ad-config/ad-config.example.json ad-config/ad-config.json
# Edit ad-config.json with your AD server details
# 3. Start the server
docker-compose up -d
# 4. Verify it's running
curl http://localhost:8850/health \
-H "Authorization: Bearer your_token_here"Expected response:
{
"status": "healthy",
"ldap_connected": true,
"domain": "yourdomain.com",
"timestamp": "2025-12-09T10:00:00.000Z"
}Installation (Python)
# 1. Clone and set up virtual environment
git clone https://github.com/DevSkillsIT/Skills-MCP-AD.git
cd Skills-MCP-AD
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# .venv\Scripts\activate # Windows
# 2. Install dependencies
pip install -r requirements.txt
# 3. Configure Active Directory
cp ad-config/ad-config.example.json ad-config/ad-config.json
# Edit ad-config.json with your AD credentials
# 4. Run the server
python -m src.server_httpConnect to Claude Code
# Add MCP server to Claude Code
claude mcp add --transport http ad http://localhost:8850/mcp \
--headers "Authorization: Bearer your_token_here"Connect to Gemini CLI
Edit ~/.gemini/settings.json:
{
"mcpServers": {
"ad": {
"httpUrl": "http://localhost:8850/mcp",
"headers": {
"Authorization": "Bearer your_token_here"
},
"timeout": 30000
}
}
}π§° Tools (45)
Skills MCP AD provides 45 comprehensive tools organized by functional area:
π₯ User Management (14 tools)
Tool | Description | Write Operation |
| UsuΓ‘rios e contas de domΓnio no Active Directory com filtros | β Read |
| Detalhes completos de usuΓ‘rio especΓfico por username | β Read |
| Busca de usuΓ‘rios por atributos no AD | β Read |
| Get authenticated user info | β Read |
| Create new user account | β Write |
| Update user attributes | β Write |
| Remove user from AD | β Write |
| Enable user account | β Write |
| Disable user account | β Write |
| Unlock locked account | β Write |
| Add user to multiple groups | β Write |
| Remove user from groups | β Write |
| Get user's group memberships | β Read |
| Authenticate user credentials | β Read |
π Password Management (4 tools)
Tool | Description | Write Operation |
| Reset user password | β Write |
| Set new password | β Write |
| Force password change at next login | β Write |
| Check password expiration date | β Read |
ποΈ Group Management (10 tools)
Tool | Description | Write Operation |
| List domain groups | β Read |
| Get detailed group information | β Read |
| Search groups by attributes | β Read |
| Create new security/distribution group | β Write |
| Update group attributes | β Write |
| Remove group from AD | β Write |
| Add member to group | β Write |
| Remove member from group | β Write |
| List group members (recursive) | β Read |
| Analyze nested group structure | β Read |
π’ Organizational Units (8 tools)
Tool | Description | Write Operation |
| List OUs with hierarchy | β Read |
| Get OU details | β Read |
| Create new OU | β Write |
| Update OU attributes | β Write |
| Remove empty OU | β Write |
| Move object between OUs | β Write |
| List contents of OU | β Read |
| Get OU hierarchy tree | β Read |
π» Computer Management (7 tools)
Tool | Description | Write Operation |
| List computer accounts | β Read |
| Get computer details | β Read |
| Create computer object | β Write |
| Remove computer account | β Write |
| Disable computer account | β Write |
| Find inactive computers (90+ days) | β Read |
| Reset computer account password | β Write |
π― Group Policy Objects (3 tools)
Tool | Description | Write Operation |
| List domain GPOs | β Read |
| Get GPO details | β Read |
| Get GPO link information | β Read |
π Search & Query (2 tools)
Tool | Description | Write Operation |
| Generic LDAP search with custom filters | β Read |
| Complex search with multiple criteria | β Read |
π Reporting & Audit (5 tools)
Tool | Description | Write Operation |
| Domain information and policies | β Read |
| List Domain Admins members | β Read |
| List locked user accounts | β Read |
| Users inactive for N days | β Read |
| List disabled accounts | β Read |
π‘ Usage Examples
Employee Onboarding
"Create a new user John Smith with username jsmith, email jsmith@company.com,
add to Sales group and VPN-Users group, and set password to Welcome2025!
with password change required at first login"AI executes:
create_user- Creates user in default OUadd_user_to_groups- Adds to Sales and VPN-Usersforce_password_change- Enforces password change
Employee Offboarding
"Disable user carlos.souza, remove from all groups,
and move to Terminated-Users OU"AI executes:
disable_user- Disables accountget_user_groups- Lists current groupsremove_user_from_groups- Removes all membershipsmove_object- Moves to appropriate OU
Password Reset
"Reset password for maria.santos to TempPass123!
and require password change at next login"AI executes:
unlock_user- Unlocks if lockedreset_password- Sets new passwordforce_password_change- Enforces change policy
Security Audit
"Show me all Domain Admins and users who haven't
logged in for more than 90 days"AI executes:
get_domain_admins- Lists privileged accountsget_inactive_users- Finds stale accounts (90+ days)
Bulk User Creation
"Create these users in the Finance group with password Company@2025
and force password change:
- Ana Costa (ana.costa)
- Bruno Lima (bruno.lima)
- Carla Dias (carla.dias)"AI executes:
create_user- Creates each userset_password- Sets initial passwordadd_user_to_groups- Adds to Finance groupforce_password_change- Enforces policy
Stale Computer Cleanup
"Find all computers that haven't connected to the domain
in 6 months and show their details"AI executes:
get_stale_computers- Finds inactive computers (180+ days)get_computer- Gets details for each
βοΈ Configuration
Configuration File Structure
Create ad-config/ad-config.json:
{
"ldap_server": "ldap://dc.yourdomain.com",
"ldap_port": 389,
"use_ssl": false,
"base_dn": "DC=yourdomain,DC=com",
"bind_user": "CN=MCPService,CN=Users,DC=yourdomain,DC=com",
"bind_password": "YourSecurePassword123!",
"default_user_ou": "OU=Users,DC=yourdomain,DC=com",
"default_group_ou": "OU=Groups,DC=yourdomain,DC=com",
"default_computer_ou": "OU=Computers,DC=yourdomain,DC=com",
"auth_token": "your_secure_bearer_token_here"
}Configuration Parameters
Parameter | Description | Required | Default |
| LDAP server URL (ldap:// or ldaps://) | β Yes | - |
| LDAP port (389 or 636 for SSL) | β Yes | 389 |
| Use LDAPS (recommended for production) | β No | false |
| Base Distinguished Name for domain | β Yes | - |
| Service account DN | β Yes | - |
| Service account password | β Yes | - |
| Default OU for user creation | β No | CN=Users |
| Default OU for group creation | β No | CN=Users |
| Default OU for computer creation | β No | CN=Computers |
| Bearer token for MCP authentication | β Yes | - |
SSL/TLS Configuration (Production)
For production deployments, use LDAPS:
{
"ldap_server": "ldaps://dc.yourdomain.com",
"ldap_port": 636,
"use_ssl": true,
"validate_cert": true,
"ca_cert_path": "/path/to/ca-certificate.pem"
}Service Account Permissions
The service account (bind_user) requires these Active Directory permissions:
Read Operations (Minimum):
β Read all properties - on Domain root
β List contents - on Domain root
Write Operations (If needed):
β Create/Delete User objects - on Users OU
β Create/Delete Group objects - on Groups OU
β Create/Delete Computer objects - on Computers OU
β Reset Password - on Users OU
β Write all properties - on specific OUs
Security Best Practices:
Create a dedicated service account (e.g.,
MCPService)Grant minimum permissions required for your use case
Use LDAPS in production
Rotate
bind_passwordandauth_tokenregularlyRestrict network access to MCP server
π’ Multi-Client Management
Adding New Clients
Use the included script to add new AD domains in minutes:
# Syntax: ./scripts/install-client.sh <slug> <name> <port>
cd /opt/mcp-servers/active-directory
# Example: Add ACME Corporation on port 8853
./scripts/install-client.sh acme-corp "ACME Corporation" 8853What the script does:
Creates client directory structure:
acme-corp/ad-config/Generates configuration template:
ad-config.jsonCreates PM2 process configuration
Registers new MCP instance on specified port
Port Allocation Strategy
Standard port allocation for multi-client deployments:
Client | Port | Process Name |
Client 1 | 8850 | mcp-ad-client1 |
Client 2 | 8851 | mcp-ad-client2 |
Client 3 | 8852 | mcp-ad-client3 |
Client N | 8850+N | mcp-ad-clientN |
Configuration Isolation
Each client has completely isolated:
β AD credentials (
bind_user,bind_password)β Authentication tokens (
auth_token)β LDAP connection settings
β Default OUs for object creation
Process Management (PM2)
# List all MCP AD instances
pm2 list | grep mcp-ad
# View logs for specific client
pm2 logs mcp-ad-client1
# Restart specific client
pm2 restart mcp-ad-client1
# Restart all AD MCP instances
pm2 restart allUpdating Shared Codebase
When updating .base-code/, all clients automatically use the new code:
cd .base-code/
git pull origin main
# Restart all instances to apply updates
pm2 restart allπ Security
Authentication
All requests require Bearer Token authentication:
Authorization: Bearer your_secure_token_hereGenerate secure tokens:
# Linux/Mac
openssl rand -hex 32
# PowerShell
[Convert]::ToBase64String((1..32 | ForEach-Object { Get-Random -Minimum 0 -Maximum 256 }))Security Best Practices
β
Use LDAPS in production - Encrypt LDAP traffic (port 636)
β
Rotate credentials - Change auth_token and bind_password quarterly
β
Minimum permissions - Service account should have least privilege
β
Network restrictions - Firewall MCP server to allowed IPs only
β
Audit logging - Enable detailed logging for compliance
β
Secret management - Use environment variables or secrets manager
Audit Logging
All operations are logged with:
β° Timestamp
π€ Authenticated user/token
π― Operation performed (tool name + parameters)
β Result (success/failure)
π Source IP address
View logs:
# Docker deployment
docker-compose logs -f skills-mcp-ad
# Python deployment
tail -f logs/mcp-ad.logπ§ͺ Testing
Health Check
# Test server health and LDAP connectivity
curl http://localhost:8850/health \
-H "Authorization: Bearer your_token_here"Expected response:
{
"status": "healthy",
"ldap_connected": true,
"domain": "yourdomain.com",
"base_dn": "DC=yourdomain,DC=com",
"timestamp": "2025-12-09T10:00:00.000Z",
"tools_count": 45
}Test MCP Protocol
# List available tools
curl -X POST http://localhost:8850/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_token_here" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 1
}'Test User Listing
# List domain users
curl -X POST http://localhost:8850/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_token_here" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "ad_list_users_with_filters",
"arguments": {
"max_results": 10
}
},
"id": 2
}'π§ Troubleshooting
Common Issues
Problem | Cause | Solution |
| Server not running | Check Docker: |
| Invalid token | Verify |
| Invalid AD credentials | Check |
| Network/firewall | Test connectivity: |
| Service account lacks rights | Grant required AD permissions to |
| Invalid/self-signed cert | Set |
Debug Mode
Enable detailed LDAP operation logging:
Docker:
# docker-compose.yml
environment:
- LOG_LEVEL=DEBUGPython:
export LOG_LEVEL=DEBUG
python -m src.server_httpVerify LDAP Connectivity
# Test LDAP bind from command line
ldapsearch -H ldap://dc.domain.com:389 \
-D "CN=MCPService,CN=Users,DC=domain,DC=com" \
-W \
-b "DC=domain,DC=com" \
"(objectClass=domain)"Check Port Availability
# Linux/Mac
lsof -i :8850
# Windows
netstat -an | findstr :8850π€ Contributing
We welcome contributions from the community! Whether it's bug reports, feature requests, or code contributions.
Development Setup
# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/Skills-MCP-AD.git
cd Skills-MCP-AD
# 2. Create virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# .venv\Scripts\activate # Windows
# 3. Install development dependencies
pip install -r requirements-dev.txt
# 4. Configure test AD (or use Samba AD test container)
cp ad-config/ad-config.example.json ad-config/ad-config.json
# 5. Run tests
pytest tests/ -v
# 6. Run linter
ruff check .
# 7. Run formatter
black .Testing Changes
# Run specific test categories
pytest tests/test_user_tools.py -v
pytest tests/test_group_tools.py -v
pytest tests/test_security.py -v
# Run with coverage
pytest --cov=src --cov-report=htmlCommit Standards
We follow Conventional Commits:
feat: add GPO management tools
fix: resolve LDAP timeout issue
docs: update configuration examples
refactor: improve error handling in user tools
test: add integration tests for password resetPull Request Process
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'feat: add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request with clear description
π License
This project is licensed under the MIT License - see the LICENSE file for details.
You are free to:
β Use commercially
β Modify
β Distribute
β Use privately
π Acknowledgments
Built with Model Context Protocol (MCP) SDK
LDAP integration powered by ldap3 library
HTTP transport via FastAPI
Inspired by the need for better AD automation in MSP operations
π Support
Get Help
π Bug Reports: GitHub Issues
π¬ Discussions: GitHub Discussions
π§ Email: contato@skillsit.com.br
π Website: skillsit.com.br
About Skills IT
Skills IT - SoluΓ§Γ΅es em Tecnologia is a Brazilian technology company specializing in MSP solutions and AI-powered automation tools.
We build MCP servers that empower IT teams and MSPs to manage their infrastructure more efficiently through AI assistants.
Our MCP Ecosystem
MCP | Description | Repository |
Skills-MCP-AD | Active Directory Management | |
Skills-MCP-GLPI | ITSM & Asset Management | |
Skills-MCP-Hudu | IT Documentation | |
skills-mcp-whm-pro | WHM/cPanel Hosting |
Contact
π± Phone: +55 (51) 98049-2520
π§ Email: contato@skillsit.com.br
π Website: skillsit.com.br
πΌ GitHub: @DevSkillsIT
π Location: Canoas/RS, Brazil π§π·
Made with β€οΈ by Skills IT - SoluΓ§Γ΅es em TI - BRAZIL
Empowering MSPs with intelligent automation
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.