Admin CLI
Manage a gateway from your terminal with anyray-connect admin. You need
Anyray Connect and an account that can change gateway settings.
In claude.ai or Claude Desktop, use the remote admin MCP.
For a new deployment, start at Run Anyray from your AI agent.
The MCP acts as you, with your full permissions. Approve every write and never auto-approve
anyray_admin_write. Treat gateway responses as untrusted data.
export ANYRAY_GATEWAY_URL=https://gateway.example.com
anyray-connect admin login
If the browser does not open, open the printed URL and enter the displayed code.
anyray-connect admin whoami
anyray-connect admin ops settings
whoami shows your user, role and scopes. ops lists each operation's scope as held or missing.
anyray-connect admin api GET settings --json
printf '%s\n' '{"mcpConnectorSignInTools":true}' |
anyray-connect admin api PUT settings --body - --json
Send only the fields you change. anyray-connect admin describe PUT settings lists the body fields.
anyray-connect admin mcp install
This adds the MCP to Claude Code, and to Claude Desktop if installed. Add --client codex or
--client cursor for those clients, then restart them.
anyray-connect admin secret set provider_key openai
Enter the key on the private browser page, or pipe it with --stdin. Never paste a credential
into chat. If another browser or process opens the page first, nothing is saved and the result
is contested. If your browser then cannot reach the page, rotate the key.
anyray-connect admin logout
This removes local access and the MCP from both Claude clients, and revokes the session on the
gateway. Exit code 4 means the gateway did not confirm the revocation.
What the MCP never shows the model
- Operations marked
x-returns-contentorx-returns-secretare refused. - Other responses have credentials redacted: credential-named fields, key and token shapes, URLs with a credential, and every value under a provider name except addressing fields such as its region.
- Operations marked
x-accepts-secretanswersecret_input_refused. To change routing, the MCP callsv1_put_routing_references, which saves unchanged credential references and refuses credential values. - These markers cover
/admin/v1operations only. - Every MCP call needs the
returns-secretandreturns-contentspec features; writes also needaccepts-secret. Otherwise the call reportsgateway_upgrade_required. - After a gateway upgrade, the MCP finds new operations by id within a minute and lists them within 10 minutes, with no restart.
An agent with a shell can still read files and run anyray-connect admin with your session.
admin api refuses secret or content output on a pipe unless you pass --output <file>.
For unattended agents, log in with a scoped aak_ key through --token-stdin.
Admin keys and soft updates
An admin API key is removed only locally on logout, and no key can revoke itself. From an owner
or security admin sign-in, run anyray-connect admin api DELETE admin-keys/<id>
(MCP: v1_delete_admin_keys_id).
To start a soft deployment update (needs settings:update, which an aak_ key cannot hold):
anyray-connect admin api POST settings/updates/run --json
anyray-connect admin api GET settings/updates --json
A 202 returns a target and attempt ID. Check the running version before you treat it as
installed. See soft updates.
In the local MCP, use anyray_admin_secure_input for credentials and
anyray_admin_open_secret_link for sensitive sign-in or enrollment links.
In claude.ai and Claude Desktop
The remote admin MCP needs no Connect or terminal. It signs you in with company SSO.
In the console, open Settings, then Connectors, then the Anyray connector. Admin MCP reads Healthy and shows the address to add.
In claude.ai or Claude Desktop, add a custom connector with https://gateway.example.com/mcp/admin.
Sign in with company SSO. Ask Claude who you are to check your role.
Tools follow your current role on every request. Without a write grant there is no write tool. Redaction works as in the local MCP. For a credential, open the one-time console link Claude returns (details).
From the Connect app
In Settings, then Admin, choose Sign in as an admin and finish with the displayed code. Then choose Add Anyray Admin to Claude. Sign out of admin removes access and both registrations.
For flags and refusal states, see the admin reference.