Authentik Diagnostic MCP Server
A Model Context Protocol (MCP) server that provides read-only diagnostic and monitoring capabilities for Authentik instances. This server is designed specifically for monitoring, troubleshooting, and gaining insights into your Authentik deployment without making any modifications.
Features
Event Monitoring & Audit Logs
- Comprehensive event tracking and audit trail analysis
- Real-time monitoring of authentication events
- Event filtering and search capabilities
- Historical event analysis for troubleshooting
User Information (Read-Only)
- User account status monitoring
- User activity tracking
- Group membership analysis
- Authentication history review
System Health Monitoring
- System configuration review
- Version and build information
- Health status checks
- Configuration drift detection
Application Status Monitoring
- Application availability monitoring
- Provider status tracking
- Flow execution monitoring
- Integration health checks
Diagnostic Capabilities
- Issue identification and analysis
- Performance monitoring
- Security event analysis
- Compliance reporting
MCP Integration
This server is designed to be used with MCP-compatible tools and platforms. It provides a standardized interface for monitoring and diagnosing Authentik instances through the Model Context Protocol.
Configuration
The server requires the following configuration parameters:
base-url: Base URL of your Authentik instance (required)token: Authentik API token (required)verify-ssl: Enable/disable SSL certificate verification (optional, default: true)
Environment Variables
You can also configure the server using environment variables:
AUTHENTIK_BASE_URL: Base URL of your Authentik instanceAUTHENTIK_TOKEN: Authentik API tokenAUTHENTIK_VERIFY_SSL: SSL certificate verification (true/false)
Command Line
authentik-diag-mcp --base-url https://your-authentik-instance.com --token your-readonly-token
Configuration Options
--base-url: Base URL of your Authentik instance (required)--token: Authentik API token with read permissions (required)--no-verify-ssl: Disable SSL certificate verification
Environment Variables
export AUTHENTIK_BASE_URL=https://your-authentik-instance.com
export AUTHENTIK_TOKEN=your-readonly-token
API Token Setup
For diagnostic purposes, create a token with minimal read-only permissions:
- Log in to your Authentik instance as an administrator
- Navigate to Directory > Tokens
- Click Create to create a new token
- Set Intent to "API"
- Choose minimal read permissions (no write/delete permissions needed)
- Copy the generated token for use with this diagnostic server
Available Diagnostic Tools
Event Monitoring
authentik_list_events- List system events with advanced filteringauthentik_get_event- Get detailed event informationauthentik_search_events- Search events by context and criteriaauthentik_get_user_events- Get events for specific users
User Information (Read-Only)
authentik_get_user_info- Get user information for diagnosticsauthentik_list_users_info- List users with basic informationauthentik_get_user_events- Analyze user-specific events
Group Information (Read-Only)
authentik_get_group_info- Get group information for diagnosticsauthentik_list_groups_info- List groups with membership detailsauthentik_get_group_members- Analyze group membership
Application Status (Read-Only)
authentik_get_application_status- Check application healthauthentik_list_applications_status- Monitor all applications
Flow Status (Read-Only)
authentik_get_flow_status- Check flow execution statusauthentik_list_flows_status- Monitor all authentication flows
System Health
authentik_get_system_config- Review system configurationauthentik_get_version_info- Get version and build information
Provider Status (Read-Only)
authentik_list_providers_status- Monitor provider healthauthentik_get_provider_status- Check specific provider status
Resources
Access to read-only diagnostic resources:
authentik://events- Event monitoring and audit logsauthentik://users/info- User information for diagnosticsauthentik://groups/info- Group information for diagnosticsauthentik://applications/status- Application status monitoringauthentik://flows/status- Flow status monitoringauthentik://system/health- System health information
Example Usage
# Monitor recent authentication events
events = await authentik_list_events({
"action": "login",
"ordering": "-created",
"page_size": 20
})
# Check user account status
user_info = await authentik_get_user_info({"user_id": 123})
# Analyze failed login attempts
failed_logins = await authentik_search_events({
"search": "failed",
"action": "login_failed"
})
# Get system health information
system_config = await authentik_get_system_config()
# Monitor application status
app_status = await authentik_list_applications_status()
Monitoring Use Cases
Security Monitoring
- Track failed authentication attempts
- Monitor suspicious login patterns
- Analyze access violations
- Review privilege escalations
Performance Analysis
- Identify slow authentication flows
- Monitor API response times
- Analyze user experience metrics
- Track system performance trends
Compliance Reporting
- Generate audit reports
- Track user access patterns
- Monitor data access events
- Compliance verification
Troubleshooting
- Diagnose authentication issues
- Identify configuration problems
- Analyze user experience issues
- Debug integration problems
Security Features
Read-Only Design
- No write operations supported
- Safe for production monitoring
- Minimal permissions required
- No data modification risk
Audit Trail
- All diagnostic queries are logged
- Tracking of monitoring activities
- Compliance with audit requirements
- Transparent operation logging
Best Practices
Token Management
- Use dedicated read-only tokens
- Rotate tokens regularly
- Monitor token usage
- Restrict token scope
Monitoring Strategy
- Regular health checks
- Automated alerting
- Trend analysis
- Proactive monitoring
Security
- Always use HTTPS
- Verify SSL certificates
- Monitor access logs
- Implement rate limiting
MCP Integration & Usage
This server is designed to be managed by MCP-compatible tools and platforms. It provides a standardized interface for monitoring and diagnosing Authentik instances through the Model Context Protocol.
Example Configurations
VS Code / GitHub Copilot Workspace (settings.json):
"mcp": {
"servers": {
"authentik-diag": {
"command": "uvx",
"args": [
"authentik-diag-mcp",
"--base-url", "https://your-authentik-instance",
"--token", "your-api-token"
]
}
}
}
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"authentik-diag": {
"command": "uvx",
"args": [
"authentik-diag-mcp",
"--base-url",
"https://your-authentik-instance",
"--token",
"your-api-token"
]
}
}
}
Integration Notes
- Use
uvx authentik-diag-mcpfor Python versions as shown above - For Node.js versions, use
npx @cdmx/authentik-diag-mcpif you are using the Node.js implementation - Replace
authentik-diag-mcpwithauthentik-mcpfor full API access if needed - Let your MCP tool manage the environment and server lifecycle
- Direct CLI usage is not recommended for most users
Requirements
- Python 3.10 or higher
- Valid Authentik API token with read permissions
License
MIT License - see LICENSE file for details.
Support
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Changelog
See CHANGELOG.md for version history and changes.
Metadata
Release files for authentik-diag-mcp 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| authentik_diag_mcp-0.1.2.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| authentik_diag_mcp-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.8 kB
Release files / authentik_diag_mcp-0.1.2.tar.gz
| Download URL | authentik_diag_mcp-0.1.2.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e389ca886eedba5a9481af32f980bb00f2da75199760ae7c2f3436a6f9534ff
|
|
BLAKE2b-256 checksum How to use checksums |
a6aeeb1c638c268b9e1f71bf5c2d76adcba7ed0bb72f04d3dd84e72d052505a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.9
|
Release files / authentik_diag_mcp-0.1.2-py3-none-any.whl
| Download URL | authentik_diag_mcp-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ab17027f558b83d7304b524adcdb7eadc1c071547c5f060e7a69983c89375d4
|
|
BLAKE2b-256 checksum How to use checksums |
9a2b690c8a2d7b9b21b7de40e6b243d7b77cf929f1a391686d006f8133dc4ae2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.9
|