Skip to main content
Glama

meshcentral-mcp

An MCP server for MeshCentral, so Claude (or any MCP client) can list your machines, run commands, show messages and gracefully reboot them. It wraps MeshCentral's own meshctrl client.

Unofficial community project. Not affiliated with or endorsed by MeshCentral or Intel. Apache-2.0.

Safe by default

Reading is always allowed. Anything that changes a machine is off until the operator turns it on with an environment variable:

Variable

Enables

MESH_MCP_ALLOW_COMMANDS=1

mesh_run_command (the agent usually runs as root/SYSTEM, so this is full control)

MESH_MCP_ALLOW_POWER=1

mesh_graceful_reboot, mesh_cancel_reboot, mesh_power

MESH_MCP_ALLOW_NOTIFY=1

mesh_device_message, mesh_device_toast

MESH_MCP_ALLOW_ALL=1

all of the above

MESH_MCP_DEVICE_ALLOWLIST=omen,lab-*

restrict write tools to these device names / node ids (globs allowed)

Other safeguards: write tools refuse offline devices instead of queueing, ambiguous names are rejected, every write is logged as JSON to stderr (never including credentials), and commands run with no shell between the server and meshctrl.

Related MCP server: mcp-infra-readonly

Tools

Tool

Type

What it does

mesh_server_info

read

MeshCentral server version/settings

mesh_list_device_groups

read

device groups the account can see

mesh_list_devices

read

id, name, group, online, OS, user; optional filter, group, online_only

mesh_device_info

read

details for one device (name or node id)

mesh_run_command

write

run a command via the agent and return the output

mesh_graceful_reboot

write

shutdown /r (Windows) or shutdown -r (Linux/macOS) with a delay and a message

mesh_cancel_reboot

write

shutdown /a / shutdown -c

mesh_power

write

wake / sleep / reset / off through MeshCentral (reset and off are not graceful)

mesh_device_message, mesh_device_toast

write

message box / toast for the logged-in user

Setup

git clone https://github.com/klepsydra/meshcentral-mcp
cd meshcentral-mcp
npm install && npm run build

Create a login key on the MeshCentral server (this lets the account sign in without a password, and is revocable by regenerating it):

cd /path/to/meshcentral && node node_modules/meshcentral --logintokenkey   # prints a hex key
install -m 600 /dev/stdin ~/.meshcentral-login.key <<< "<the hex key>"

Use a dedicated MeshCentral user with only the device groups you want exposed. Passwords work too (MESHCENTRAL_PASSWORD), but the value is visible to local ps while a call runs, so prefer the key file.

Environment

Variable

Notes

MESHCENTRAL_URL

e.g. wss://mesh.example.com

MESHCENTRAL_USER

MeshCentral username

MESHCENTRAL_LOGIN_KEY_FILE

path to the key file (recommended), or MESHCENTRAL_LOGIN_KEY

MESHCENTRAL_PASSWORD, MESHCENTRAL_TOKEN

password / 2FA token alternative

MESHCENTRAL_DOMAIN

for multi-domain servers

MESHCTRL_PATH

use an existing meshctrl.js instead of the bundled meshcentral dependency

Claude Code

claude mcp add meshcentral \
  --env MESHCENTRAL_URL=wss://mesh.example.com \
  --env MESHCENTRAL_USER=mcp \
  --env MESHCENTRAL_LOGIN_KEY_FILE=$HOME/.meshcentral-login.key \
  --env MESH_MCP_ALLOW_POWER=1 \
  -- node /path/to/meshcentral-mcp/dist/index.js

Claude Desktop

{
  "mcpServers": {
    "meshcentral": {
      "command": "node",
      "args": ["/path/to/meshcentral-mcp/dist/index.js"],
      "env": {
        "MESHCENTRAL_URL": "wss://mesh.example.com",
        "MESHCENTRAL_USER": "mcp",
        "MESHCENTRAL_LOGIN_KEY_FILE": "/home/you/.meshcentral-login.key",
        "MESH_MCP_ALLOW_POWER": "1"
      }
    }
  }
}

Then ask: "Which machines are online?" or "Reboot omen in 2 minutes and warn whoever is logged in."

Sample client

examples/sample-client.mjs starts the server over stdio, lists tools and devices, and with --reboot <device> schedules a graceful reboot and cancels it (needs MESH_MCP_ALLOW_POWER=1). It is also a minimal template for calling the tools from your own code.

Development

npm test     # builds, then runs the tests with a fake meshctrl (no server needed)

Ideas and contributions welcome, especially an HTTP transport for remote connectors, file upload/download, and a pure-WebSocket backend that drops the meshctrl subprocess.

Available Tools

10 tools
mesh_cancel_rebootCancel a scheduled rebootA

Abort a pending shutdown/reboot started by mesh_graceful_reboot. Needs MESH_MCP_ALLOW_POWER=1.

Inputs: device (required).

mesh_device_infoDevice detailsB
Read-only

Detailed information about one device (accepts a name or node id).

Inputs: device (required).

mesh_device_messageMessage box on deviceB

Show a message box to whoever is logged in on the device. Needs MESH_MCP_ALLOW_NOTIFY=1.

Inputs: device (required), message (required), title.

mesh_device_toastToast on deviceB

Show a toast notification on the device. Needs MESH_MCP_ALLOW_NOTIFY=1.

Inputs: device (required), message (required), title.

mesh_graceful_rebootGracefully reboot a deviceA
Destructive

Schedule an OS-level graceful reboot (Windows: shutdown /r, Linux/macOS: shutdown -r) with a delay so logged-in users get a warning and apps can close. Needs MESH_MCP_ALLOW_POWER=1. Use mesh_cancel_reboot to abort during the delay.

Inputs: device (required), message, delay_seconds.

mesh_list_device_groupsList device groupsA
Read-only

List MeshCentral device groups (meshes) the account can see.

Inputs: no named parameters.

mesh_list_devicesList devicesA
Read-only

List devices with id, name, group, online state (agent connected), OS and logged-in user. Optional MeshCentral filter such as 'omen', 'g:PCs', 'os:windows', 'tag:prod'.

Inputs: group, filter, online_only.

mesh_powerPower action (agent-level)A
Destructive

Wake, sleep, hard reset or power off through MeshCentral's own power function (wake works on offline devices via a peer on the same LAN; reset/off are NOT graceful). Prefer mesh_graceful_reboot. Needs MESH_MCP_ALLOW_POWER=1.

Inputs: action (required), device (required).

mesh_run_commandRun command on a deviceA
Destructive

Run a shell command through the MeshCentral agent and return its output. Needs MESH_MCP_ALLOW_COMMANDS=1. The agent usually runs as root/SYSTEM, so treat this as full control of the machine.

Inputs: device (required), command (required), powershell, run_as_user, +1 more.

mesh_server_infoMeshCentral server infoB
Read-only

Version and settings of the connected MeshCentral server.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools are clearly separated by target and action (list devices, device info, run command, reboot, cancel reboot). The main overlap is mesh_graceful_reboot versus mesh_power, and mesh_device_message versus mesh_device_toast, but the descriptions explain when to prefer each.

    Naming Consistency4/5

    All tools share a consistent mesh_ prefix, which makes the set predictable. However, the suffix style is mixed: mostly verb_noun (list_devices, run_command), but also noun-style names like server_info and device_info.

    Tool Count5/5

    Ten tools is well-scoped for a MeshCentral remote-management server. Each tool corresponds to a distinct operational need: discovery, inspection, command execution, power control, and user notification.

    Completeness4/5

    The core remote-management lifecycle is covered: server and device discovery, device inspection, command execution, reboot/power management, and user messaging. Minor gaps remain around file transfer, device/group administration, or event/audit history, but common workflows are supported.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      A read-only MCP server that gives Claude safe access to Kubernetes clusters, enabling listing, describing, and monitoring resources without mutation risks and with secret masking.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables read-only MCP access to Tactical RMM, allowing agents to query devices, clients, sites, audit logs, software, and pending actions without any mutating capabilities.
      MIT