MCP Server

Athena has a built-in Model Context Protocol (MCP) server. Any MCP-compatible client can connect to it to read and operate your fleet: agents and inventory, commands, deployments, collections, compliance, monitoring, reports, users, settings and remote tools. There is no extra service to install and no extra port to open. The client signs in as a real Athena user, gets that user’s permissions, and every tool call is written to the audit log.

The MCP server is a licensed feature, included in the Pro plan. It runs inside your Athena server like the console, the REST API and the PowerShell module. It works in an air-gapped network. Athena acts only as the server here: clients connect to it, and it does not connect out to any MCP service.

What you need#

RequirementWhere to check it
A license that includes the MCP serverSettings → License. The Features list must show MCP server as Included. See Licensed features.
The mcp.use permissionLets an account open an MCP session. By default only the Admin role has it. You can grant it to other roles under Roles & Permissions.
The permissions for the work you want doneEvery tool checks the same permission as the matching console page or REST endpoint. For example, the agent list needs agents.view. See Permission Model & Role Bundles.
An API token (recommended)A long-lived credential for the client. See Authenticating below.

You don’t need to switch anything on. The MCP server is available whenever the license includes it. To control who can use it, grant or remove mcp.use on a role.

mcp.use grants no access on its own. An account that has mcp.use and nothing else can connect, but it gets an empty tool list. What a client can see and do always depends on the other permissions of the account it signs in as.

The address clients connect to#

The MCP endpoint is /mcp on the web console port:

https://athena.example.local:8443/mcp

Authenticating#

An MCP client authenticates the same way as a REST client: it sends a bearer credential on every request. Use an API token (ath_…). Unlike a sign-in session, a token survives server restarts and has its own expiry, and you can revoke it on its own. Configure your client to send either header:

Authorization: Bearer ath_…
# or
X-Athena-Api-Token: ath_…

A short-lived session token from POST api/auth/login (see API Reference) also works. However, it expires on the session clock, and a server restart can sign it out (see Sessions & Server Restarts). That makes it a poor fit for a client you leave configured.

Create a token for the client in the console#

  1. Sign in as the account the client should act as. Consider a dedicated service account whose role holds only what the client needs.
  2. Click your initials badge in the top bar, choose Profile, and in the API Tokens panel click New token.
  3. Give it a recognisable name and a lifetime. If you limit it to selected permissions, include mcp.use and the permissions for the tools the client needs.
  4. Copy the token when it is shown. It is displayed only once.

Or create it with PowerShell#

# A read-only client: may open an MCP session and read agents, nothing else
New-AthenaApiToken -Name "mcp-client" -Permission mcp.use,agents.view

A token never holds more than its owner. Each call is checked against the owner’s current role, plus the token’s scope if it has one. A token limited to selected permissions that does not list mcp.use cannot connect. For lifetime limits, revoking and the admin view of every token, see API Tokens.

Connection responses#

ResponseMeaning
401 UnauthorizedNo credential, or the credential is invalid. For an API token, the WWW-Authenticate header says why (for example revoked or expired).
403 ForbiddenThe account (or the token’s scope) lacks mcp.use, or the license in force does not include the MCP server.
404 Not FoundThe request went to the agent port instead of the web port.

What a client can do#

The server publishes a catalogue of tools named athena_…. They cover the same operations as the console and the REST API. Each tool is marked as read-only or not, and as destructive or not, so the client can tell reads apart from changes.

AreaExamples
Agents & inventoryList and find agents (by hostname or tag), fleet statistics, every inventory section (OS, hardware, software, services, updates, network, local groups…), refresh inventory, tags, maintenance mode, restart, migrate, delete or revoke an agent, Secure Boot certificate update, staged agent rollouts.
Commands & scansCreate, execute, retry, cancel and review commands; command templates; scan definitions and their results.
DeploymentsDeployment packages, plans and files; create, start, pause, cancel and retry executions; deployment history and statistics.
Reports, collections & complianceRun built-in and saved reports, ad-hoc queries, collections and their members, compliance rules, baselines and assignments, the audit log, scheduled jobs, the offline Windows Update catalogue.
MonitoringMonitors, alerts (query, acknowledge, resolve, purge) and automatic tagging rules.
Remote toolsRemote file browser, remote registry, remote services, remote sessions and RustDesk.
Identity & settingsUsers, registration tokens, API tokens, the credential vault, certificates and the root CA, each settings group, the license state, database backup and maintenance, server restart.
ApplianceAppliance status and update history.
ModulesLoaded modules can add their own tools, named after the module. They follow the same permission, confirmation, redaction and audit rules.

A client only sees the tools it may call. The tool list is filtered by the account’s permissions (and the token’s scope). A client never learns that a tool outside its permissions exists, and calling one directly is refused. The usual license rules also apply inside every tool. For example, on a lapsed license a tool that would start new work returns the same license message the console shows, ending with “Upload a current license file under Settings to restore it.” On a lapsed license (as opposed to one that never included the feature), the MCP server stays available, so read-only tools keep working.

Confirmation on high-impact tools#

MCP clients cannot be prompted by the server, so Athena guards high-impact tools with a required confirm argument instead. The client must pass back the target’s own identifying value, which it can only know by reading the target first. A mismatch, or a missing value, means nothing happens. Letter case and spaces at the start or end are ignored. Anything else must match exactly.

Tools such as…Pass in confirm
Delete, revoke or restart an agent; issue an uninstall code; start the Secure Boot update; change unattended access or the recording policy; open a remote session; remote file, registry and service changes; RustDesk changes on one computerThe agent’s hostname
The multi-agent versions (restart several computers, Secure Boot update on several agents)The hostnames, comma-separated
Execute, retry or delete a commandThe target hostname, or for several targets the hostnames comma-separated in alphabetical order (for example APP-01,DB-02)
Start or delete a deployment or execution; delete a package, command template, scan definition, monitor, tagging rule, collection, compliance rule or baseline, saved report or scheduled job; run a job now; reveal, update or delete a vault credentialThe item’s name
Create, update, delete a user, or reset or change a user’s passwordThe username
Create a long-lived API tokenYour own username
Restart the serverThe server’s machine name
Fleet-wide or server-wide actionsA fixed word, given in the tool’s description: all-agents, all-sessions, backup, optimize or mint

A wrong or missing confirmation is refused with a message such as:

Refusing to delete this agent: the 'confirm' argument must exactly match the target's own
identifying string (its hostname, username or name, depending on the tool). Read the target
first and pass the value it reports back.

The refusal deliberately does not include the expected value, so it cannot be copied from the error. Each tool’s description tells the client which value to pass.

Secrets stay on the server#

Before a tool returns a result, Athena removes secret values from it. Fields whose names end in password, secret, token, passphrase, private key, API key, secret key, signing key or server key are replaced, as are connection strings, password and token hashes, BitLocker PINs and similar values. They appear as "[redacted]" (or as an empty value when they are not text). Fields that only say whether a secret is set, such as “password set”, are kept.

A tool returns a secret only when that is the whole point of the tool:

Audit trail and monitoring#

Every tool call, successful or not, writes one McpToolInvoked event to the audit log. No tool can skip it.

FieldValue
Event typeMcpToolInvoked
SeverityInformation when the call worked; Warning when it failed or was refused (permissions, license, confirmation)
UserThe account the client signed in as (the token owner)
ResourceMcpTool/<tool name>
DescriptionMCP tool '<tool>' invoked by <user>, with and failed added on failure, plus the error message

To review MCP activity, open the Audit Log and filter on the event type McpToolInvoked (see Filtering by event type). If you scrape Athena’s Prometheus metrics, the counter athena_mcp_tool_calls_total counts tool calls labelled by result: ok, error or denied (refused by the license or a credential or package permission check).

Troubleshooting#

SymptomCheck
The client cannot connect (403)Is MCP server included under Settings → License? Does the account’s role have mcp.use? If the token is limited to selected permissions, does it list mcp.use?
The client connects but lists no tools, or fewer than expectedThe list only shows tools the account (and the token’s scope) is allowed to call. Add the needed permissions to the role, or create a token with a wider scope.
404 on /mcpThe client is pointed at the agent port. Use the web port (8443 by default).
401 after it used to workThe token expired or was revoked, or its owner was disabled. Check the WWW-Authenticate header and the ApiTokenAuthFailed audit events. If you used a session token, a server restart may have signed it out. Switch to an API token.
A change is refused with “Refusing to …”The confirm argument did not match. Read the target first and pass the exact hostname, username or name it reports.
A tool returns a license messageThe license has lapsed or does not include that feature. See Licensing.
TLS or certificate errors in the clientThe client machine does not trust the server’s HTTPS certificate. See Server TLS Certificate.

Recommended practices#