Skip to main content

MCP Server

The dashboard speaks the Model Context Protocol, so an assistant such as Claude can work with your estate the way an operator does: read the alerts, look at a host's history, find out what went wrong and propose a fix. It reads whatever it needs by itself. Anything that changes a host is proposed as a job and waits until a person approves it in the inbox.

Nothing is switched on by this feature. The endpoint answers only to an API token, and nothing happens until you create one and connect a client.

The endpoint​

POST /api/mcp

The endpoint is MCP over Streamable HTTP, stateless: there is no session, every request carries its own token and is answered with plain JSON. GET and DELETE answer 405.

What is accepted:

  • an ordinary API token as Authorization: Bearer selv_…;
  • a read-only token as well, although it answers GET only everywhere else: it is offered the read tools and nothing more;
  • no browser session, and no token the desktop app holds. Both are refused.

Setting it up​

Give the assistant an account of its own rather than a person's token.

  1. Create an account for it under Settings → Users (see Users and Permissions), for example with the role Operator.
  2. Grant it the customers it should look after. It sees and may touch exactly what an account with that role and those grants may, and nothing beyond.
  3. Sign in as that account and create a token under Profile → API tokens (see API Tokens). Choose read only for an assistant that should only look, read and write for one that may propose changes.

With a dedicated account everything the assistant does is attributed to it: the audit log names it, and so do the job lists. Because it is the requester of its own jobs, a person other than the assistant has to approve them.

Connecting a client​

The client needs the URL and the token. With Claude Code:

claude mcp add --transport http selvara https://<your-instance>/api/mcp \
--header "Authorization: Bearer <token>"

Any other MCP client that supports Streamable HTTP takes the same two things: the URL https://<your-instance>/api/mcp and the header Authorization: Bearer <token>.

Tools​

A read-only token is offered the read tools. A read-write token gets all of them, except that get_audit_log is offered to administrator accounts only.

Naming hosts and customers​

Wherever a tool takes systemId, it also takes host: an id, an exact name, a hostname, an FQDN or an IP address the agent reports. systemId accepts the same references. Customers are given as customer (id, exact name or exact code) next to customerId. A reference that matches nothing, or several hosts, is answered with what to call next (search_hosts, list_customers) and, when ambiguous, the candidates. Hosts and customers in answers appear as host: {id, name} and customer: {id, name}.

Totals, hints and pages​

Lists return total (or totalInScope, hasMore) and nextCursor; an empty result carries a hint naming what the filters matched and what to loosen. Most lists return 100 rows per page by default (list_scripts and the installs and package modes of search_software 25); limit goes up to 100. Tools that submit a job return approvePath, the dashboard page where a person approves it; wait_for_job returns at once while a job still awaits approval.

ToolKindWhat it does
get_fleet_overviewreadHosts by state, open alerts and what needs attention, in total and per customer
list_customersreadCustomers with their ids, codes and host counts, to turn a name into an id
list_agentsreadAgents with their version, whether it is outdated, connection and rollout state
list_clustersreadClusters with their members and whether they are healthy, and why not
get_clusterreadOne cluster with each member's state and health values
list_alertsreadOpen and recent alerts, filtered by customer, host, severity, metric, q or since; returns a total
get_alertreadOne alert with its rule, host, self-healing attempts and a slice of the timeline
search_hostsreadHosts by name, hostname, IP, customer or tag (q), and exact filters: OS, status, kind, service, region, alerts, outdated agent, cluster, attention
get_hostreadA host's details, status, open alerts, latest jobs and a short inventory
get_timelinereadThe events of a host, a customer or the fleet, since a given time, by kind or minimum severity
search_softwarereadWhich hosts have a package installed, in which version, with pending updates; or the fleet's package list
search_hardwarereadHosts by hardware and OS facts: memory, CPU, virtualisation, OS version
get_host_inventoryreadOne host's hardware, disks, network and, on request, its packages
get_current_metricsreadThe current value of each metric, from the live series
get_metric_historyreadHistory from the 5-minute and 1-hour rollups, for a window of at most 7 days
list_jobsreadJobs with their state, requester and approval state; filter by q and since; returns a total
get_jobreadOne job in full
get_job_outputreadThe end of a job's output
wait_for_jobreadWaits for a job to finish, for up to 60 seconds, and returns its state and the end of its output
list_scriptsreadThe script library the account may see
get_scriptreadA script with its parameters and the body of its current version
get_patch_overviewreadPending and security updates, restarts and patch runs, in total and per customer
list_patch_hostsreadThe patchable hosts with their updates, restart state, policy and latest run
list_pending_updatesreadPending updates across hosts, one row per package and version
get_patchesreadPending patches of a host
list_patch_runsreadPatch runs under way or finished
get_patch_runreadOne patch run with what its dry run planned and what its apply changed
get_vulnerabilitiesreadVulnerabilities of a host, of a customer, or of every host the account reaches; known exploited only on request
list_certificatesreadCertificates by expiry, with expired, expiring, weak and self-signed ones
get_compliancereadCompliance checks, endpoint protection (antivirus, firewall, BitLocker) and the security overview
list_maintenance_windowsreadMaintenance windows, whether open now, the next occurrence, and which cover a host
list_alert_rulesreadAlert rules with metric, condition, threshold and scope, or those that apply to a host
get_audit_logreadRecent audit entries, filtered by host, customer, q or target; offered to administrator accounts only
get_inboxreadWhat is waiting for a person: approvals and questions
acknowledge_alertwriteAcknowledges an alert, with a comment
add_notewriteAdds a note to an alert or a host, such as the assistant's diagnosis
run_scriptwriteSubmits a library script as a job that waits for approval
run_commandwriteSubmits a free command as a job that waits for approval
manage_servicewriteSubmits a service start, stop or restart that waits for approval
start_patch_runwritePatches up to 50 hosts; the apply of each waits for approval
reboot_hostwriteSubmits a restart of a host that waits for approval
cancel_patch_runwriteCancels a patch run that has not finished
cancel_jobwriteWithdraws a job that is still waiting
request_shellwriteAsks for time-limited shell access to one host; a person must approve
get_shellreadThe state of a shell grant: pending, active, expired, and its working directory
list_shell_grantsreadThe token's open shell grants, and recently ended ones on request
shell_execwriteRuns a command in an active shell grant, without per-command approval
end_shellwriteEnds a shell grant now

A typical pass: list_alerts with since at the assistant's own pace, get_alert, the read tools to investigate, add_note with the diagnosis, then run_command or run_script as a proposal. A person approves it in the inbox, and the assistant follows the job with wait_for_job and checks with get_current_metrics that the fix worked.

The assistant asks; the dashboard never contacts it. There is no push to a client.

Commands​

run_command submits a free command, written for bash, sh, powershell or python to fit the host's operating system, as a script.run job. The approval dialog shows the full command, its language and the reason the assistant gave.

  • No agent update is needed. A host that allows script.run in the actions list of its config.yaml (see Agent Settings) runs an approved command; a host that does not allow it rejects the job.
  • A command cannot be scheduled.
  • A retry of a command job waits for approval again.

Shell access​

For work that takes many commands, request_shell asks for a time-limited shell on one host instead of one approval per command. A person approves it once, and shell_exec then runs commands on that host until the grant ends. The tools need a token, not a browser session.

  1. request_shell with host (or systemId), reason and optionally minutes (30 by default, at most 240). It answers with a grantId in state pending; if the token already has a grant on that host, it answers with that grant instead. list_shell_grants shows the token's open grants.
  2. The assistant polls get_shell until the state is active. A request nobody decides lapses after an hour.
  3. shell_exec with grantId, command, language (bash by default; powershell on Windows) and timeoutSeconds. It waits up to about a minute for the result and otherwise answers running with the job id, which wait_for_job follows. Each command starts in the directory the last one ended in; Python commands run without that tracking.
  4. end_shell when done.

How it is kept safe:

  • Approval is always required, even for a customer whose policy asks for none from people. Without Require approval the token's account decides and is the only one notified; under it another account that may decide access at that customer does, and the token's account may not. The approver may shorten the duration, never extend it.
  • Time limit. A grant is valid from approval until its end. Once the end has passed, commands are refused; nothing has to run for that to hold.
  • One host, one token. Commands are refused when the grant belongs to another token or host, or is not active. The host must be an approved agent host, and the account still needs access.shell at the customer and the right to run scripts. At most one pending or active grant exists per token and host.
  • Recorded. Each command is a script.run job that carries the grant, with its output, shown on the grant's page (/shell-grants/<id>). The audit log has shell_grant.request, .approve, .deny, .command (job id and the first 200 characters), .end, .revoke and .expire, naming "Claude (Jane Admin)".
  • Revocation. The token's account or an administrator can revoke a grant from its page; end_shell ends it; revoking the token or losing access.shell ends it as well. Commands already running finish, new ones are refused.

See Shell Grants.

Patching​

get_patch_overview answers "how many updates are pending" in one call, for every customer the account reaches or for one of them; list_patch_hosts and list_pending_updates go into detail.

start_patch_run starts a patch run on each host, as Patch now does. The dry run goes ahead at once, because it only plans. The apply then waits for a person under Patches → Approvals and in the inbox, whatever the dry run found and whatever the customer's policy says, and the person sees the plan before confirming. The run restarts the host only when asked: reboot is never unless the assistant chooses if_needed or always, and the approval shows that choice. With windowId the run follows a maintenance window, as list_maintenance_windows names them. A host left waiting for a restart can be restarted with reboot_host, which waits for approval as well.

Safety model​

  • Approval, always. Every job an MCP tool submits waits for approval in the inbox and the jobs list, whatever the customer's policy says. That holds for run_script, run_command and manage_service alike, and for the apply of a patch run started with start_patch_run, and for reboot_host. See Approval.
  • A reason for each. Every one of those tools needs a reason. It is recorded in the audit log, prefixed via MCP:, and shown beside the job.
  • Attribution. The account of the token is the requester, and the token is named with it: the bell, the mail and the audit log show "Claude (Jane Admin)", the token name and then the account. Its jobs carry that name in the lists. A request made before upgrading shows the account only.
  • Who is asked. Without the customer's Require approval policy a held job is a confirmation by the requester: only the token's account is notified (bell and mail), and with the dashboard open a dialog pops up at once to approve or deny. Under Require approval the account cannot approve its own request, so the other accounts that may decide are notified. See Approving at once.
  • Rights are the account's. The token carries only the account's identity. The role and the customer grants are read again on every request, so demoting the account or withdrawing a grant takes effect at once.
  • No secrets through the assistant. A library script with a secret parameter cannot be run through run_script; run it from the dashboard. Everything the assistant is given passes through the provider of its model, and a password or key typed there would too.
  • What stays out. Tunnels, SSH keys, connections, users and settings have no tools: they hold access and secrets. The audit log is offered to an administrator account only, as in the dashboard.
  • Read-only tokens. They are offered the read tools and cannot reach the write tools.
  • Shell grants are the one exception to approval per command, and only for a granted host and time. See Shell access.
  • Revocation. Revoking the token stops the assistant at the next request. See Expiry and revocation.

Limits​

  • Lists are paged with a cursor and return at most 100 entries per page; most default to 100.
  • Job output is returned as a tail, the end of what the host sent, not all of it.
  • get_metric_history accepts a window of at most 7 days and reads the rollups. For the value right now use get_current_metrics: the last bucket of a rollup is an average and does not say how the host is at this moment.
  • wait_for_job blocks for up to 60 seconds. If the job is not finished by then, it answers with its current state; call it again.
  • The usual rate limits of the API apply to the token.