Skip to content

MCP Server

Audex ships as an MCP server so Claude Code can request scoped, short-lived credentials natively for AWS, GCP, Azure, or Vault — without Bash wrapping.


Add to your project’s .mcp.json:

{
"mcpServers": {
"audex": {
"command": "/path/to/audex",
"args": ["mcp"]
}
}
}

Set provider-specific environment variables before starting Claude Code:

For AWS:

Terminal window
export AUDEX_ROLE_ARN="arn:aws:iam::123456789012:role/AudexAgentRole"

For GCP:

Terminal window
gcloud auth application-default login
export AUDEX_GCP_SERVICE_ACCOUNT="audex-agent@my-project.iam.gserviceaccount.com"

For Azure:

Terminal window
az login
export AZURE_SUBSCRIPTION_ID="12345678-1234-1234-1234-123456789012"

When Claude Code starts, it connects to the Audex MCP server automatically. Claude then sees three native tools.


Run a command with scoped, short-lived credentials for AWS, GCP, Azure, or Vault.

ParameterTypeRequiredDescription
allowstringYesComma-separated IAM/permission actions (format depends on provider)
commandstring[]YesCommand and arguments to execute
providerstringNoCloud provider: “aws”, “gcp”, “azure”, “vault” (default: “aws”)
ttlstringNoTime-to-live (default: “15m”)
budgetnumberNoBudget limit in USD (AWS only)
role_arnstringNoIAM role ARN (AWS) or service account email (GCP)
profilestringNoNamed policy profile (e.g., “s3-readonly”)
resourcestringNoResource ARN restriction

Examples:

// AWS: read S3
audex_run({
provider: "aws",
allow: "s3:GetObject,s3:ListBucket",
command: ["aws", "s3", "ls"]
})
// GCP: read Cloud Storage
audex_run({
provider: "gcp",
allow: "storage.objects.get,storage.objects.list",
command: ["gsutil", "ls"]
})
// Azure: list storage accounts
audex_run({
provider: "azure",
allow: "Microsoft.Storage/storageAccounts/read",
command: ["az", "storage", "account", "list"]
})
// Using a profile
audex_run({
provider: "aws",
profile: "s3-readonly",
command: ["aws", "s3", "ls"]
})

List credential sessions with their status and metadata.

ParameterTypeRequiredDescription
statusstringNoFilter by status
limitnumberNoMax results (default: 20)

View the audit trail of session events.

ParameterTypeRequiredDescription
session_idstringNoFilter by session ID
limitnumberNoMax entries (default: 50)

The MCP server runs as a long-lived process communicating over stdin/stdout using JSON-RPC (the Model Context Protocol). It is built in Rust using the rmcp crate (the official MCP SDK). No Anthropic API key is required.

When Claude calls audex_run:

  1. Audex creates a session and issues STS credentials (same as tryaudex run CLI)
  2. The command runs as a subprocess with credentials injected
  3. stdout and stderr are captured (not inherited, since stdin/stdout is the MCP channel)
  4. Results are returned to Claude as structured text
  5. Session is logged to the audit trail

BehaviorCLI (tryaudex run)MCP (audex_run)
stdioInherited (you see output live)Captured (returned to Claude)
InteractionUser runs it manuallyClaude calls it as a tool
OutputPrinted to terminalReturned as MCP tool result
Session trackingSameSame
Audit loggingSameSame

You can test the server manually by sending JSON-RPC messages:

Terminal window
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | tryaudex mcp

The server should respond with its capabilities and tool definitions.