MCP & A2A

Two protocols designed for AI clients. Same API key, different shape.

Both protocols are auth-gated by your API key Every MCP / A2A request must carry Authorization: Bearer kfl_.... Each tenant only ever sees their own agents, snapshots, and incidents.

1. Generate an API key

  1. Log in at kefal.dev/app.
  2. Open the Settings tab in the dashboard header.
  3. Click Generate new API key. Optionally label it (e.g. claude-desktop, ci-deploy-agent).
  4. The plaintext key (kfl_ + 48 hex chars) is shown once — store it in your password manager immediately. You can revoke and re-issue at any time.

2. MCP — Model Context Protocol

MCP is the lightest path to use Kefal from a chat-style AI assistant: Claude Desktop, Cursor, Claude Code, or any client that speaks the streamable-HTTP MCP transport. The endpoint is:

https://kefal.dev/mcp/

Claude Desktop

Edit your Claude Desktop config (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json). Add a streamable-HTTP server:

{
  "mcpServers": {
    "kefal": {
      "url": "https://kefal.dev/mcp/",
      "headers": {
        "Authorization": "Bearer kfl_your_key_here"
      }
    }
  }
}

Restart Claude Desktop. The 6 Kefal tools appear in the tool picker.

Cursor

In Cursor settings → MCP → Add new MCP server, paste the same JSON shape under "url" + "headers". Cursor will auto-discover the tools on first connection.

Claude Code (CLI)

claude mcp add --transport http kefal https://kefal.dev/mcp/ \
  --header "Authorization: Bearer kfl_your_key_here"

Then run claude as usual — the tools below are available inline.

The 6 tools

list_agents

List the agents enrolled under your account.

Params: none. Returns: array of {id, hostname, last_seen, created_at}.

get_agent_status

Latest snapshot for one agent: hostname, OS, kernel, uptime, IPs, top processes, listening ports, logged-in users.

Params: agent_id (UUID). Returns: snapshot object. Errors with isError: true if the agent doesn't belong to you or has no snapshots yet.

list_incidents

Filter incidents by status and severity, newest first.

Params: status (open|acknowledged|dismissed, optional), severity (low|medium|high|critical, optional), limit (default 20, max 100).

get_incident

Full record for one incident: triggering data, causal chain, metadata, remediation state.

Params: incident_id (UUID).

acknowledge_incident

Mark an incident as acknowledged (= seen, no action). Reversible from the dashboard.

Params: incident_id (UUID). Returns: {id, status}.

get_topology

Topology graph: hosts, services, ports, identities, plus the edges between them.

Params: none. Returns: {nodes: [...], edges: [...]}.

Example exchange

You:    Are any of my servers compromised right now?
Claude: [calls list_incidents with status="open"]
        You have 3 open incidents:
          • HIGH service_privilege_exposure on kefal (port 4444)
          • MEDIUM transition_novelty (proc:nc appeared)
          • LOW host_gone_silent (db-staging, last seen 2h ago)
        Want me to acknowledge the first one or pull the causal chain?

3. A2A — Agent-to-Agent

A2A is for autonomous agents that need to delegate security checks without a human in the loop. Kefal advertises a public Agent Card and accepts JSON-RPC tasks at a single endpoint.

Discovery

Any peer can fetch the Agent Card unauthenticated:

GET https://kefal.dev/.well-known/agent.json

The card describes Kefal's name, description, two skills (server-audit, incident-management), the authentication scheme, and the JSON-RPC endpoint. CORS is wide-open on this resource specifically — discovery works from any origin.

Send a task

POST https://kefal.dev/a2a
Authorization: Bearer kfl_your_key
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "a2a.task.send",
  "params": {
    "task_id": "pre-deploy-check",
    "message": {
      "role": "user",
      "content": "list open incidents"
    }
  }
}

The response is a synchronous completed task with a single text artifact:

{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "task_id": "pre-deploy-check",
    "status": "completed",
    "artifacts": [
      {"type": "text", "content": "3 open incident(s):\n  - high/service_privilege_exposure detected …"}
    ]
  }
}

Supported methods

When to use A2A vs MCP

Use casePick
Human in the loop, chat-style assistant calling toolsMCP
Autonomous agent doing pre-deploy gate checksA2A
Need fine-grained access to specific tool paramsMCP
Need a one-shot natural-language status checkA2A
Need cross-agent discovery (peer doesn't know Kefal exists yet)A2A (the Agent Card is the discovery surface)

4. Auth, errors, and limits

5. Troubleshooting

401 Unauthorized

Tool calls return isError: true

MCP client times out on connection