Developers / AAES Govern / MCP

Connect your
MCP client.

Connect an MCP client to your AAES Govern service. The MCP adapter forwards calls. The daemon remains the governance layer. AAES Operate has its own MCP endpoint, described on the Operate MCP page.

This page describes AAES Govern’s controls. AAES Operate has private-work permissions, operational reviews and recorded-spend limits; it does not include Govern. About AAES Govern

Planning a deployment? Use the MCP security checklist to review authorization, credential custody, and tool-action controls alongside this adapter contract.

One governance service

aaesmcp is an adapter that lets an MCP client call your AAES Govern service (the daemon). AAES Govern keeps the policy, registered capabilities, and application credentials. The adapter forwards calls using a bearer token issued by your deployment operator. In bridge mode, each agent presents its own credential.

The credential resolves the tenant. Callers do not supply a tenant ID. On brokered paths, AAES Govern uses the configured application credential without intentionally handing it to the model. Validate that downstream results, errors, logs, and client behavior do not expose credentials; this is not a guarantee against leakage through those channels.

The aaesmcp binary ships in the evaluation or deployment package. Remaining protocol notes ship with that package.

Authenticate with a token file

For the stdio process, provide the operator-issued bearer token in a local file with permissions 0600 or 0400. The token is never a flag and is never printed. The -token-file flag accepts the file path, not the token itself.

chmod 0600 /path/to/aaes-token

Replace /path/to/aaes-token with the file your operator gave you. Keep the token out of prompts and client configuration JSON. Only its file path belongs in the launch configuration.

Connect over stdio

After you receive the package, launch the facade against your daemon. Packaged Compose uses TLS by default; configure the facade's system trust for the separately authenticated deployment certificate and use its HTTPS endpoint. The loopback HTTP examples below assume a dedicated test daemon started with explicit -allow-insecure-http opt-in. Point the command at the binary on your host:

/path/to/aaesmcp -daemon http://127.0.0.1:8090 -token-file /path/to/aaes-token

For an MCP client that uses a mcpServers configuration object:

{
  "mcpServers": {
    "aaes": {
      "command": "/path/to/aaesmcp",
      "args": [
        "-daemon",
        "http://127.0.0.1:8090",
        "-token-file",
        "/path/to/aaes-token"
      ]
    }
  }
}

127.0.0.1:8090 is the default listener address; the URL scheme follows the deployment's TLS configuration. Match -daemon to your deployment's platform -listen address.

Streamable HTTP: POST only

Add a listener to expose the MCP endpoint locally:

/path/to/aaesmcp \
  -daemon http://127.0.0.1:8090 \
  -token-file /path/to/aaes-token \
  -listen 127.0.0.1:8765

Configure the client to send MCP requests to http://127.0.0.1:8765/mcp using POST.

tools/call over HTTP requires Authorization: Bearer with an operator-issued token. The process -token-file authenticates the stdio process to the daemon; it is not a fallback for HTTP.

No SSE stream. GET /mcp returns 405. Server-sent events are not implemented.

Use a client that can operate with POST-only MCP requests, or use stdio.

Bridge mode for agents that AAES Operate runs

Bridge mode serves agents that send only a tool name and its arguments. Each tool maps to one registered capability, version and action. AAES Govern derives the spend and the effect key from the tool's arguments under installed rules, and binds the call to the Govern task an operator mapped from the Operate project or routine the run belongs to. The run and task the client names are checked against the authenticated agent and against Operate's current state, and are recorded as attribution only. AAES Govern still makes every decision.

/path/to/aaesmcp \
  -daemon https://govern.example.com \
  -bridge-config /path/to/bridge-documents \
  -bridge-only \
  -listen 127.0.0.1:8765
  • -bridge-config names one bridge document (schema aaes/govern-bridge/1) or a directory with one document per Operate workspace. It needs -listen, because each agent sends its own Govern credential as Authorization: Bearer on every HTTP request, and stdio carries no per-request credential. The document format ships with the evaluation package.
  • The adapter checks the documents for changes every 10 seconds. A changed set that fails validation is not applied, and the previous documents keep serving.
  • tools/list returns only the mapped tools; the eight built-in tools below are not offered in bridge mode. A mapped tool carries readOnlyHint only when it is an explicitly mapped read that spends nothing.
  • A credential that no bridge document binds is refused. A call whose spend, task or attribution cannot be established is refused before AAES Govern is asked, and a call made while AAES Govern or Operate cannot answer is refused.
  • -bridge-only serves bridged agents and nothing else. The adapter reads no process token and refuses every call that no bridge document serves. It needs -bridge-config and -listen, and refuses -token-file, -task-id and the workload OAuth profile.

Optional workload OAuth profile

With the workload profile, each agent exchanges its OAuth client secret with AAES Govern for an access token. Set all three flags together, with -listen and -bridge-config, and leave -token-file unset:

  • -workload-origin: the canonical HTTPS origin agents use. The protected resource is <origin>/mcp and the authorization server is <origin>/govern/oauth.
  • -workload-private-origin: the daemon's private workload origin.
  • -workload-bridge-secret-file: the dedicated bridge secret that authenticates the adapter to that private origin. It stays between the adapter and the daemon.

The adapter publishes resource metadata at /.well-known/oauth-protected-resource/mcp and authorization-server metadata at /.well-known/oauth-authorization-server/govern/oauth, and forwards /govern/oauth/token and /govern/oauth/revoke to AAES Govern. An agent uses the client_credentials grant with client_secret_post, the resource <origin>/mcp and the scope govern:tools. Each client is a confidential client registered for one agent and one tenant; there is no dynamic client registration. Access tokens last five minutes. A request without a valid token receives 401 with a WWW-Authenticate challenge that names the resource metadata, and a token without govern:tools receives 403 with insufficient_scope. tools/list then shows only the mapped tools whose capability, version and action that agent holds.

A non-loopback http daemon or private origin needs -allow-plain-http, which sends agent credentials and the bridge secret in cleartext. The customer_hosted deployment profile (-deployment-profile) refuses that flag.

Tool discovery

The facade lists these eight built-in tools in the following order, then the capabilities this caller may use.

Built-in tools, in discovery order
OrderTool
1list_catalogue
2request_access
3my_entitlements
4request_status
5approval_status
6task_budget
7my_surfaces
8receipt_verify_pointer

The catalog lists capabilities a caller may request access to. The capabilities list shows what that caller already has permission to use.

my_surfaces lists the surfaces this actor holds, read only, from GET /v1/surfaces. If the deployment has no surface register or assignment store, it reports the daemon's refusal.

approval_status maps to the access-request read operation and expects an access-request identifier; it is not a general /v1/approvals/{id} lookup. The eight built-in tools do not include manager-card operations; agent managers read their inbox through the HTTP API or SDK.

Resources

Resources expose information available to the authenticated caller. The bearer token identifies the caller; resource URIs do not select a tenant or actor.

  • resources/list lists aaes://entitlements and aaes://catalogue, using AAES Govern's capability and catalog responses.
  • resources/templates/list lists aaes://task/{task_id} and aaes://receipts/{receipt_id}. These read the named task or receipt and return an explicit refusal if the identifier is absent.
  • The same template list includes aaes://policies/{capability_id}. It returns the policy's own fields from the catalog only when that capability is requestable by this caller. Otherwise, it returns AAES Govern's refusal reason.
  • resources/subscribe is refused explicitly. AAES Govern has no change feed, so the adapter cannot send change notifications.

The facade also serves two prompts, justify_access_request and explain_refusal. Each is grounded in the daemon's own answers at prompts/get time; when the daemon cannot be read, the prompt says so and instructs the model not to invent a justification.

Verify exported records offline

receipt_verify_pointer returns the command to run locally. Use the public aaesverify verifier against an export and public key from your evaluation install.

aaesverify --export <export.jsonl> --pubkey <key.pub>

This audit operation needs no running service. See the CLI reference for the offline audit commands.

Follow the daemon contract

The facade forwards to the HTTP API. Daemon refusals are JSON with a reason, plus a remedy when the daemon can name the smallest change that would satisfy the refusal.

The daemon contract is the public OpenAPI 3.1 schema. The operator console is served by the AAES Govern process on a separate listener and is not part of that contract.

A local check uses the official Python MCP SDK at the pinned versions 1.30.0 and 2.2.0 over stdio and stateless HTTP in bearer-token mode; other clients, SSE, sessions, bridge mode and the workload OAuth profile are not implied by that check.

Back to developer documentation · Request an evaluation