A Model Context Protocol (MCP) server for the Prey Public API.
This server provides read and write access to your Prey account with guardrails.
- Go 1.22+
- A Prey API Key with appropriate permissions
Read-only tools (default):
- Account summary
- Users list and details
- Devices list and details
- Device reports list and details
- Device location history (JSON or CSV)
- Labels list and details
- Zones list and details
- Automations list and details
- Mass actions list and details
Write tools (opt-in):
- Trigger device action (alarm/alert/lock)
- Set device missing/recovered
- Create label
- Create/update zone
- Delete device
Environment variables:
PREY_API_KEY(required)PREY_API_BASE(default:https://api.preyproject.com/v1)PREY_TIMEOUT_MS(default:30000)PREY_ALLOW_WRITE(default:false)PREY_ALLOWED_TOOLS(comma-separated allowlist)PREY_DEBUG(default:false)PREY_RATE_LIMIT_DISABLE(default:false)
Optional per-request headers (multi-tenant scenarios):
X-Prey-URLX-Prey-API-Key
By default the client enforces Prey limits (per API key):
- 2 requests/second
- 60 requests/minute
- 10,000 requests/hour
Disable with PREY_RATE_LIMIT_DISABLE=true.
prey.account.getprey.users.listprey.users.getprey.devices.listprey.devices.getprey.devices.deleteprey.devices.reports.listprey.devices.reports.getprey.devices.location_history.getprey.labels.listprey.labels.getprey.labels.createprey.zones.listprey.zones.getprey.zones.createprey.zones.updateprey.automations.listprey.automations.getprey.mass_actions.listprey.mass_actions.getprey.devices.action.triggerprey.devices.status.set
Supported transports:
stdiossestreamable-http
Docker (streamable-http):
docker run --rm -p 8000:8000 \
-e PREY_API_KEY=YOUR_KEY \
preyproject/mcp-prey:latest \
--transport streamable-http --address 0.0.0.0:8000 --endpoint-path /mcpDocker (SSE):
docker run --rm -p 8000:8000 \
-e PREY_API_KEY=YOUR_KEY \
preyproject/mcp-prey:latest \
--transport sse --address 0.0.0.0:8000 --base-path /Docker (write enabled):
docker run --rm -p 8000:8000 \
-e PREY_API_KEY=YOUR_KEY \
-e PREY_ALLOW_WRITE=true \
preyproject/mcp-prey:latest \
--transport streamable-http --address 0.0.0.0:8000 --endpoint-path /mcpStdio:
PREY_API_KEY=... \
PREY_ALLOW_WRITE=false \
./mcp-prey --transport stdioSSE:
PREY_API_KEY=... \
./mcp-prey --transport sse --address localhost:8000 --base-path /Streamable HTTP:
PREY_API_KEY=... \
./mcp-prey --transport streamable-http --address localhost:8000 --endpoint-path /mcpClaude Desktop (example config):
{
"mcpServers": {
"prey": {
"command": "docker",
"args": [
"run",
"--rm",
"-p",
"8000:8000",
"-e",
"PREY_API_KEY=YOUR_KEY",
"preyproject/mcp-prey:latest",
"--transport",
"streamable-http",
"--address",
"0.0.0.0:8000",
"--endpoint-path",
"/mcp"
]
}
}
}ChatGPT Developer Mode (SSE or streamable HTTP):
- Enable Developer mode in ChatGPT settings (Connectors → Advanced → Developer mode).
- Add a connector with your MCP server URL.
- Use it in a chat via the Developer mode tool picker.
Codex CLI (example):
codex mcp add prey --url http://localhost:8000/mcp
codex mcp listCodex config (example ~/.codex/config.toml):
[mcp_servers.prey]
url = "http://localhost:8000/mcp"Start the dev container:
task mcp-prey:dev:upRun tests (inside container):
task mcp-prey:dev:exec SV=mcp-prey-dev CMD='go test ./...'- Write tools are disabled unless
PREY_ALLOW_WRITE=true. - For large fleets, use pagination;
page_sizeis capped at 100. - CSV location history is returned as base64 with
content_type.
MIT