MCP server for AI assistants, on DeviceChain
DeviceChain includes an optional Model Context Protocol server so AI assistants can read what a person is allowed to read. It is built on one principle: an AI agent can never do more than the person who authorized it. It is a thin, curated layer over the platform's existing GraphQL API, not a broad gateway: its tools read, and in Preview they can also propose alarm actions that only a person can approve.
What an assistant can read
The read tools are each a query against the same GraphQL API the console uses. They cover devices and their capabilities, a device's last-known state, its latest measurements, raw and aggregated measurements over a range, reported positions, alarms and the commands issued to a device. A tool returns exactly what that user, in that tenant, is allowed to see.
There is no generic run-a-query tool, and sensitive reads such as credentials, the audit trail, notification recipients and provisioning secrets are deliberately left out.
Proposing alarm actions (Preview)
When an operator switches agent actions on and the user's grant includes the act scope, the server adds three Preview tools: propose_alarm_action, get_proposal and list_my_proposals. An agent can propose acknowledging or clearing alarms; it cannot approve or carry out anything.
A person approves in the console, from their own sign-in and with a recent second factor, and the final approval carries out the action as that person. Signing out ends that approval. There is no automatic mode.
How access is granted
The server is an OAuth 2.1 resource server in front of an authorization server on the platform: authorization code with PKCE, RFC 8414 metadata, refresh-token rotation and RFC 8707 audience binding. The user signs in, chooses the tenant to grant and consents. Until dynamic client registration ships, an administrator registers clients.
Why it cannot overreach
The server holds no privileged platform credential. Every call forwards the caller's own validated token to the GraphQL service, which re-applies the same tenant and role checks. The tenant is pinned when access is granted rather than passed as a parameter, so no tool takes a tenant argument an agent could change. Tools do accept device identifiers, filters and time ranges. An access token issued for the server names it as its audience, and any other token is rejected.
Each tool call writes one line to the service's log with the tenant, the actor, the client and the outcome, because reads are not entries in the audit journal.
What it does not do.
- MCP has no approval or execution tool. An agent cannot send a command or start a rollout: only alarm acknowledge and clear proposals are carried out, after a person approves them.
- Enabling the mcp service is not enough: the authorization server stays off until an operator configures an issuer URL, and until then no client can obtain a token. The mcp service is also not in a default deployment.
- The tools that list devices do not yet say whether a device is disabled.