Kandji Integration
This integration provides tools to manage Apple devices through the Kandji MDM platform. It supports device information retrieval and remote device management actions.
Implemented Tools
Device Information Tools
-
list_kandji_devices
- Lists devices managed by Kandji
- Returns device details including name, model, OS version, serial number, blueprint name, and last enrollment
- Supports search and pagination parameters
-
get_kandji_device
- Gets detailed information about a specific Kandji device
- Requires device ID as parameter
- Returns complete device information including MDM status and agent details
Device Management Actions
Configuration
The integration requires the following configuration:
interface KandjiConfig {
apiKey: string;
baseUrl: string;
}
Testing Instructions
Prerequisites
-
Set environment variables:
export KANDJI_API_KEY="your-api-key-here"
export KANDJI_BASE_URL="https://yourorg.api.kandji.io"
-
Ensure you have devices enrolled in your Kandji instance for testing
Running Tests
yarn install
yarn build
yarn test:integration
Test Coverage
The integration tests cover:
- Device listing and retrieval
- Blueprint information
- Device action commands (with proper error handling for non-MDM devices)
Note: Device action tests may show expected failures if test devices are not MDM-managed or if specific action endpoints are not available in your Kandji instance.
Important Notes
Device Management Requirements
- MDM Management: Most device actions require the device to be enrolled and managed by MDM
- Device Status: Devices must be online and connected to receive commands
- Platform Limitations: Some actions (shutdown, restart) are macOS-only
- Permissions: Ensure your API key has appropriate permissions for device actions
Error Handling
The integration provides comprehensive error handling:
- Network and API errors are caught and returned as structured responses
- MDM status errors are handled gracefully
- Missing endpoints return appropriate error messages
Rate Limits
Kandji API has the following rate limits:
- 10,000 requests per hour per customer
- 50 requests per second
Future Considerations
Potential enhancements for future versions:
- Bulk Operations: Support for bulk device actions
- Policy Management: Tools for managing device policies and configurations
- App Management: Installing and removing applications on devices
- User Management: Creating and managing user accounts
- Reporting: Enhanced reporting and analytics capabilities
- Webhook Support: Real-time notifications for device events
Security Best Practices
- Store API keys securely using environment variables
- Use principle of least privilege for API key permissions
- Regularly rotate API keys
- Monitor API usage for unusual activity
- Test device actions in non-production environment first
Troubleshooting
Common Issues