Mosyle MDM MCP Server
MCP server for interacting with Mosyle Business MDM instances. Provides 35 tools across device management, user/group management, custom attributes, lost mode, and log streaming. Supports JWT authentication and a --read-only mode for safe operation.
Configuration
Authentication: Mosyle uses an API access token combined with email/password credentials to obtain a JWT bearer token. Create a dedicated API user in Mosyle Business rather than using a personal account.
Option 1: config.json
cp config.json.example config.json
# Edit config.json with your API credentials
Option 2: Environment Variables
export MOSYLE_HOST="businessapi.mosyle.com"
export MOSYLE_EMAIL="api-user@example.com"
export MOSYLE_PASSWORD="api-password"
export MOSYLE_ACCESS_TOKEN="your-access-token"
export MOSYLE_LOGS_HOST="businessapilogs.mosyle.com"
export MOSYLE_TIMEOUT="30"
Installation
Option 1: Using uvx (Recommended — no install needed)
uvx bibliocommons-mcp-mosyle
uvx runs the package directly from PyPI in an isolated environment. Install uv first if you don't have it:
curl -LsSf https://astral.sh/uv/install.sh | sh
Option 2: Using pip
pip install bibliocommons-mcp-mosyle
AI Client Setup
VS Code (with MCP Extension)
- Install an MCP-compatible extension in VS Code
- Open VS Code Settings (JSON):
Cmd+Shift+P→ "Preferences: Open User Settings (JSON)" - Add the server configuration:
{
"mcp.servers": {
"mosyle": {
"command": "uvx",
"args": ["bibliocommons-mcp-mosyle"]
}
}
}
Alternative: Using python directly
{
"mcp.servers": {
"mosyle": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_mosyle"]
}
}
}
Claude Desktop
-
Open Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the server configuration:
{
"mcpServers": {
"mosyle": {
"command": "uvx",
"args": ["bibliocommons-mcp-mosyle"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"mosyle": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_mosyle"]
}
}
}
Kiro IDE
- Open Kiro IDE settings
- Navigate to MCP Servers configuration
- Add the server:
{
"mcpServers": {
"mosyle": {
"command": "uvx",
"args": ["bibliocommons-mcp-mosyle"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"mosyle": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_mosyle"]
}
}
}
Kiro CLI
-
Create or edit the MCP configuration file:
- User level:
~/.kiro/settings/mcp.json - Project level:
<project-root>/.kiro/settings/mcp.json
- User level:
-
Add the server configuration:
{
"mcpServers": {
"mosyle": {
"command": "uvx",
"args": ["bibliocommons-mcp-mosyle"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"mosyle": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_mosyle"]
}
}
}
Configuration Notes
- Using
uvx(default): Automatically manages dependencies in isolated environments (likenpxfor Node.js) - Using
python(alternative): Requirespip install bibliocommons-mcp-mosylefirst - Add
--config /path/to/config.jsonto the args array to use a specific config file - Add
--read-onlyto the args array to disable destructive tools - After adding the configuration, restart your AI client for changes to take effect
For other AI clients (Amazon Q, GitHub Copilot, Cline, Zed, Cursor), see docs/ai-clients.md.
Docker
# Pull from Docker Hub (private)
docker pull bibliocommons/mcp-mosyle:latest
# Run in stdio mode
docker run -i --rm \
-v /path/to/config.json:/config.json:ro \
bibliocommons/mcp-mosyle:latest \
--config /config.json
# Run in HTTP mode
docker run -d --rm \
-v /path/to/config.json:/config.json:ro \
-p 8000:8000 \
bibliocommons/mcp-mosyle:latest \
--config /config.json --transport http --port 8000
# Run in expanded mode
docker run -i --rm \
-v /path/to/config.json:/config.json:ro \
bibliocommons/mcp-mosyle:latest \
--config /config.json --expanded
Web UI with Swagger
A REST API with interactive Swagger documentation is available:
python -m bibliocommons_mcp_mosyle.webui
Access the Swagger UI at: [http://localhost:8000/docs]
The Web UI provides:
- Interactive API documentation
- Try-it-out functionality for all endpoints
- OpenAPI/Swagger specification
- REST API access to all MCP tools
Standalone MCP Server
python -m bibliocommons_mcp_mosyle
CLI Flags
| Flag | Env Var | Description |
|---|---|---|
--config PATH |
MOSYLE_CONFIG |
Path to config.json |
--read-only |
MOSYLE_READ_ONLY |
Exclude destructive tools |
--expanded |
MOSYLE_EXPANDED |
Register all tools individually instead of gateway mode |
--transport stdio|http |
MOSYLE_TRANSPORT |
Transport mode (default: stdio) |
--port PORT |
MOSYLE_PORT |
HTTP port (default: 8000) |
--version |
— | Show version and exit |
Gateway Mode (Default)
By default, the server exposes 2 tools instead of 35 individual tools:
| Tool | Purpose |
|---|---|
mosyle_api |
Execute any Mosyle MDM action by name with a params dict |
mosyle_help |
Search available actions, parameters, and descriptions |
The AI assistant calls mosyle_help to discover available actions, then calls mosyle_api(action="list_devices", params={}) to execute them.
To register all individual tools (previous behavior), use --expanded:
python -m bibliocommons_mcp_mosyle --expanded
Available Tools
| Domain | Tools | Description |
|---|---|---|
| Devices | 9 | list_devices, update_device, shutdown_devices, restart_devices, wipe_devices, assign_device_user, unassign_device, enable_activation_lock, disable_activation_lock |
| Custom Attributes | 6 | list_custom_device_attributes, create_custom_device_attribute, assign_custom_device_attribute, update_custom_device_attribute, remove_custom_device_attribute, delete_custom_device_attribute |
| Variables | 3 | save_variable, delete_variable, lock_device |
| Users | 3 | list_users, create_user, update_user |
| User Groups | 5 | list_user_groups, create_user_group, update_user_group, add_users_to_group, remove_users_from_group |
| Device Groups | 3 | list_device_groups, get_device_group_info, update_device_group |
| Lost Mode | 4 | enable_lost_mode, disable_lost_mode, play_lost_mode_sound, request_device_location |
| Logs | 2 | list_action_logs, get_logs_stream |
See docs/API-REFERENCE.md for full parameter details.
Read-Only Mode
Disable all destructive tools for safe, audit-only operation:
# CLI flag
python -m bibliocommons_mcp_mosyle --read-only
# Environment variable
export MOSYLE_READ_ONLY=true
In read-only mode, the following 26 tools are excluded:
- Devices: update_device, shutdown_devices, restart_devices, wipe_devices, assign_device_user, unassign_device, enable_activation_lock, disable_activation_lock
- Custom Attributes: create_custom_device_attribute, assign_custom_device_attribute, update_custom_device_attribute, remove_custom_device_attribute, delete_custom_device_attribute
- Variables: save_variable, delete_variable, lock_device
- Users: create_user, update_user
- User Groups: create_user_group, update_user_group, add_users_to_group, remove_users_from_group
- Device Groups: update_device_group
- Lost Mode: enable_lost_mode, disable_lost_mode, play_lost_mode_sound
The remaining 9 read-only tools are: list_devices, list_custom_device_attributes, list_users, list_user_groups, list_device_groups, get_device_group_info, request_device_location, list_action_logs, get_logs_stream.
Security Notes
- Create a dedicated API user in Mosyle Business for MCP access rather than using a personal account
- The access token is a long-lived credential; store it securely and rotate periodically
- Never commit
config.jsonwith real credentials (it is excluded by.gitignore) - Use
config.json.exampleas a template - Prefer environment variables for production and CI environments
- Use
--read-onlymode when write access is not needed
Metadata
Release files for bibliocommons-mcp-mosyle 1.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bibliocommons_mcp_mosyle-1.3.6.tar.gz | 19.8 kB | Without provenance | Details for bibliocommons_mcp_mosyle-1.3.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bibliocommons_mcp_mosyle-1.3.6-py3-none-any.whl | Python 3 | none | any | Details for bibliocommons_mcp_mosyle-1.3.6-py3-none-any.whl |
Total release size: 33.1 kB
Release files / bibliocommons_mcp_mosyle-1.3.6.tar.gz
| Download URL | bibliocommons_mcp_mosyle-1.3.6.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f90d2518fd9fe6ac6258e83a88e5de76906f0f13912f3032d25335fce47d043
|
|
BLAKE2b-256 checksum How to use checksums |
e131cb33e14005cdd243c26d9c59b5d7ef5bcb67c3904a6be081c740da06f0e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / bibliocommons_mcp_mosyle-1.3.6-py3-none-any.whl
| Download URL | bibliocommons_mcp_mosyle-1.3.6-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c76a12c3a33a4bc22f2536fb652445ae97c6427665a7e2c5018d9bf1d6ab4ac8
|
|
BLAKE2b-256 checksum How to use checksums |
7aafb928f1d3a063c2a276628bfb91896472f4bcf6e76828dfda374fa4700c04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for bibliocommons-mcp-mosyle 1.3.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.