Agent Auth MCP Tools
You have access to Agent Auth MCP tools for interacting with Agent Auth providers. Always prefer using these MCP tools for any agent authentication operations rather than making raw HTTP requests or writing custom code.
Starting the MCP Server
The MCP server is part of the CLI:
auth-agent mcp
Or with pre-configured providers:
auth-agent mcp --url https://api.example.com
Cursor / Claude Desktop configuration
{
"mcpServers": {
"auth-agent": {
"command": "npx",
"args": ["@auth/agent-cli", "mcp", "--url", "https://api.example.com"]
}
}
}
Available Tools
The MCP server exposes 17 tools. Follow the numbered workflow below.
Step 1: Discovery — Find a Provider
| Tool |
Parameters |
When to use |
list_providers |
(none) |
Call this first. Lists all discovered/configured providers. |
search_providers |
intent (required) |
Search the directory by name or intent (e.g. "deploy web apps", "vercel"). |
discover_provider |
url (required) |
Look up a specific provider by URL. Only use if list/search didn't help. |
Always start with list_providers. If empty, use search_providers or discover_provider.
Step 2: Capabilities — Understand What's Available
| Tool |
Parameters |
When to use |
list_capabilities |
provider (required), query, agent_id, limit, cursor |
List capabilities for a provider. |
describe_capability |
provider, name (required), agent_id |
Get full definition including input schema. Always call before executing. |
Step 3: Connect — Authenticate an Agent
| Tool |
Parameters |
When to use |
connect_agent |
provider (required), capabilities, mode, name, reason, preferred_method, login_hint, binding_message, force_new |
Connect an agent to a provider. Returns agent_id. |
Key parameters:
capabilities — Array of capability names to request.
mode — "delegated" (acts for a user, default) or "autonomous" (independent).
preferred_method — "device_authorization" (default, opens browser) or "ciba" (backchannel notification).
login_hint — User email for CIBA flow.
force_new — Create a new connection even if one exists.
Step 4: Use the Agent
| Tool |
Parameters |
When to use |
execute_capability |
agent_id, capability (required), arguments |
Execute a granted capability. |
agent_status |
agent_id (required) |
Check agent status, grants, and constraints. |
sign_jwt |
agent_id (required), capabilities, audience |
Sign an agent JWT for manual use. |
request_capability |
agent_id, capabilities (required), reason, preferred_method, login_hint, binding_message |
Request additional capabilities. |
disconnect_agent |
agent_id (required) |
Revoke an agent. |
reactivate_agent |
agent_id (required) |
Reactivate an expired agent. |
Host Management
| Tool |
Parameters |
When to use |
enroll_host |
provider, enrollment_token (required), name |
Enroll a host with a one-time token. |
rotate_agent_key |
agent_id (required) |
Rotate an agent's keypair. |
rotate_host_key |
issuer (required) |
Rotate the host keypair for a provider. |
Workflow Example
Here is the standard workflow for connecting to a provider and executing a capability:
1. list_providers
→ See what providers are already known
2. search_providers({ intent: "deploy web apps" })
→ Find a provider if none are known (or discover_provider with a URL)
3. list_capabilities({ provider: "https://api.example.com" })
→ See what the provider offers
4. describe_capability({ name: "deploy_app", provider: "https://api.example.com" })
→ Understand the input schema before executing
5. connect_agent({ provider: "https://api.example.com", capabilities: ["deploy_app"], name: "deploy-bot" })
→ Authenticate and get an agent_id
→ If approval is required, the user will be prompted
6. agent_status({ agent_id: "..." })
→ Confirm the agent is active and capabilities are granted
7. execute_capability({ agent_id: "...", capability: "deploy_app", arguments: { app: "my-app", env: "production" } })
→ Run the capability with the correct arguments
Important Rules
- Never make raw HTTP requests to Agent Auth endpoints. Always use MCP tools.
- Always call
list_providers first. This tells you what's already configured.
- Always call
describe_capability before execute_capability. You need the input schema.
- Always call
agent_status after connect_agent. The agent may be pending approval.
- Save the
agent_id returned by connect_agent — every subsequent tool needs it.
- Use constraints when connecting to limit agent permissions — pass them in the
capabilities parameter as objects with name and constraints fields.
- Handle approval flows. When
connect_agent returns approval info (device code URL or CIBA), the user must approve before the agent becomes active. Poll agent_status to check.
- Errors return structured objects like
{ error: "message", code: "error_code" } — check these and retry or adjust accordingly.
Capability Constraints
When connecting, you can restrict what an agent can do with its capabilities:
{
"provider": "https://api.example.com",
"capabilities": [
"read_data",
{
"name": "transfer_money",
"constraints": {
"amount": { "max": 1000, "min": 1 },
"currency": { "in": ["USD", "EUR"] }
}
}
]
}
Constraint types: eq (exact match), min/max (numeric bounds), in/not_in (allowed/blocked values).
When to Use CLI vs MCP
- Use MCP tools when operating inside an MCP-enabled environment (Cursor, Claude Code, Claude Desktop) — the tools are already available and integrated.
- Use the CLI when running from a terminal directly, scripting, or when MCP is not available.
- Both expose the same operations and share the same storage (
~/.agent-auth/).
1---2name: agent-auth-mcp3description: Use the Agent Auth MCP tools to discover providers, connect agents, manage capabilities, and execute operations through the MCP protocol. Use when working inside an MCP-enabled environment (Cursor, Claude Code, etc.) and need to authenticate agents, execute capabilities, or interact with Agent Auth providers.4---56# Agent Auth MCP Tools78You have access to Agent Auth MCP tools for interacting with Agent Auth providers. **Always prefer using these MCP tools for any agent authentication operations** rather than making raw HTTP requests or writing custom code.910## Starting the MCP Server1112The MCP server is part of the CLI:1314```bash15auth-agent mcp16```1718Or with pre-configured providers:1920```bash21auth-agent mcp --url https://api.example.com22```2324### Cursor / Claude Desktop configuration2526```json27{28 "mcpServers": {29 "auth-agent": {30 "command": "npx",31 "args": ["@auth/agent-cli", "mcp", "--url", "https://api.example.com"]32 }33 }34}35```3637## Available Tools3839The MCP server exposes 17 tools. Follow the numbered workflow below.4041### Step 1: Discovery — Find a Provider4243| Tool | Parameters | When to use |44| ------------------- | ------------------- | -------------------------------------------------------------------------- |45| `list_providers` | (none) | **Call this first.** Lists all discovered/configured providers. |46| `search_providers` | `intent` (required) | Search the directory by name or intent (e.g. "deploy web apps", "vercel"). |47| `discover_provider` | `url` (required) | Look up a specific provider by URL. Only use if list/search didn't help. |4849**Always start with `list_providers`.** If empty, use `search_providers` or `discover_provider`.5051### Step 2: Capabilities — Understand What's Available5253| Tool | Parameters | When to use |54| --------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------- |55| `list_capabilities` | `provider` (required), `query`, `agent_id`, `limit`, `cursor` | List capabilities for a provider. |56| `describe_capability` | `provider`, `name` (required), `agent_id` | Get full definition including input schema. **Always call before executing.** |5758### Step 3: Connect — Authenticate an Agent5960| Tool | Parameters | When to use |61| --------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |62| `connect_agent` | `provider` (required), `capabilities`, `mode`, `name`, `reason`, `preferred_method`, `login_hint`, `binding_message`, `force_new` | Connect an agent to a provider. Returns `agent_id`. |6364Key parameters:6566- `capabilities` — Array of capability names to request.67- `mode` — `"delegated"` (acts for a user, default) or `"autonomous"` (independent).68- `preferred_method` — `"device_authorization"` (default, opens browser) or `"ciba"` (backchannel notification).69- `login_hint` — User email for CIBA flow.70- `force_new` — Create a new connection even if one exists.7172### Step 4: Use the Agent7374| Tool | Parameters | When to use |75| -------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------- |76| `execute_capability` | `agent_id`, `capability` (required), `arguments` | Execute a granted capability. |77| `agent_status` | `agent_id` (required) | Check agent status, grants, and constraints. |78| `sign_jwt` | `agent_id` (required), `capabilities`, `audience` | Sign an agent JWT for manual use. |79| `request_capability` | `agent_id`, `capabilities` (required), `reason`, `preferred_method`, `login_hint`, `binding_message` | Request additional capabilities. |80| `disconnect_agent` | `agent_id` (required) | Revoke an agent. |81| `reactivate_agent` | `agent_id` (required) | Reactivate an expired agent. |8283### Host Management8485| Tool | Parameters | When to use |86| ------------------ | ------------------------------------------------- | --------------------------------------- |87| `enroll_host` | `provider`, `enrollment_token` (required), `name` | Enroll a host with a one-time token. |88| `rotate_agent_key` | `agent_id` (required) | Rotate an agent's keypair. |89| `rotate_host_key` | `issuer` (required) | Rotate the host keypair for a provider. |9091## Workflow Example9293Here is the standard workflow for connecting to a provider and executing a capability:9495```961. list_providers97 → See what providers are already known98992. search_providers({ intent: "deploy web apps" })100 → Find a provider if none are known (or discover_provider with a URL)1011023. list_capabilities({ provider: "https://api.example.com" })103 → See what the provider offers1041054. describe_capability({ name: "deploy_app", provider: "https://api.example.com" })106 → Understand the input schema before executing1071085. connect_agent({ provider: "https://api.example.com", capabilities: ["deploy_app"], name: "deploy-bot" })109 → Authenticate and get an agent_id110 → If approval is required, the user will be prompted1111126. agent_status({ agent_id: "..." })113 → Confirm the agent is active and capabilities are granted1141157. execute_capability({ agent_id: "...", capability: "deploy_app", arguments: { app: "my-app", env: "production" } })116 → Run the capability with the correct arguments117```118119## Important Rules120121- **Never make raw HTTP requests** to Agent Auth endpoints. Always use MCP tools.122- **Always call `list_providers` first.** This tells you what's already configured.123- **Always call `describe_capability` before `execute_capability`.** You need the input schema.124- **Always call `agent_status` after `connect_agent`.** The agent may be pending approval.125- **Save the `agent_id`** returned by `connect_agent` — every subsequent tool needs it.126- **Use constraints** when connecting to limit agent permissions — pass them in the `capabilities` parameter as objects with `name` and `constraints` fields.127- **Handle approval flows.** When `connect_agent` returns approval info (device code URL or CIBA), the user must approve before the agent becomes active. Poll `agent_status` to check.128- **Errors return structured objects** like `{ error: "message", code: "error_code" }` — check these and retry or adjust accordingly.129130## Capability Constraints131132When connecting, you can restrict what an agent can do with its capabilities:133134```json135{136 "provider": "https://api.example.com",137 "capabilities": [138 "read_data",139 {140 "name": "transfer_money",141 "constraints": {142 "amount": { "max": 1000, "min": 1 },143 "currency": { "in": ["USD", "EUR"] }144 }145 }146 ]147}148```149150Constraint types: `eq` (exact match), `min`/`max` (numeric bounds), `in`/`not_in` (allowed/blocked values).151152## When to Use CLI vs MCP153154- **Use MCP tools** when operating inside an MCP-enabled environment (Cursor, Claude Code, Claude Desktop) — the tools are already available and integrated.155- **Use the CLI** when running from a terminal directly, scripting, or when MCP is not available.156- Both expose the same operations and share the same storage (`~/.agent-auth/`).