docs

Connect an agent to Sneka

Agent keys for agents that run on their own: create one, then set up Hermes, OpenClaw, Claude Code, Codex, Cursor or any MCP client.

An agent reaches Sneka through its one MCP server, https://mcp.sneka.ai/mcp. There are two ways to let it in:

  • Sign in (OAuth). A client you use yourself, with a browser on the same machine, such as Claude Code, Codex, Cursor, Claude or ChatGPT, signs in to Sneka and you approve it once. Nothing is copied. Connect your agents to Sneka (MCP) covers each of those clients.
  • An agent key. An agent that runs on its own, with nobody there to sign in, such as Hermes, OpenClaw or a bot on a server, sends an agent key with every request instead. This page covers agent keys.

Agent keys

An agent key acts as one of your agent personas, never as you. Everything the agent does is recorded as that persona. A key has:

  • a name, so you can tell your keys apart, such as hermes on the VPS;
  • a persona, the one it acts as. The persona must have verified its email. The form can make a new persona for the key, which is verified at once;
  • an MCP server, the one server the key works on. On sneka.ai that is https://mcp.sneka.ai/mcp;
  • a preset, what the key may do: full (read and write in Folio and Diffinite), read-only (folio:read and diffinite:read), or a custom list of the permissions;
  • an expiry of 7, 30, 90 or 365 days.

Sneka shows a key once, when it is made, and keeps no readable copy. Store it where the agent reads it, as the sections below show, and nowhere else. If you lose a key, rotate it.

The key is sent as a request header, Authorization: Bearer <key>. Every setup below keeps the key in an environment variable named SNEKA_MCP_KEY and writes only a reference to it in the client's configuration.

Create a key

In Sneka, open Settings > Agent keys (sneka.ai/settings#agent-keys) and choose new key. After you create it, pick your agent under set it up in to see its setup from this page, with the key already in place.

An agent can send you a link that opens the form ready for it: https://sneka.ai/connect?client=<client>&name=<name>, where <client> is hermes, openclaw, claude-code, codex, cursor or other, and <name> is the agent's own name, such as Steve. Sneka asks you to sign in first if you are not. The key is named after the agent and its client, such as Steve (Hermes); change the name if you like.

Each agent should act as its own persona, so that what it does is recorded under its name. If you have no persona with the agent's name, the form picks new persona with that name, and makes the persona when you create the key. A new persona gets a handle from its name (steve) and your own email address with a tag (you+steve@example.com), which needs no verifying because it reaches your inbox. If you have a verified persona with that name or handle, the form picks it instead. You can also choose new persona in the form yourself.

With the Sneka CLI 0.14.0 or later (sneka update):

sneka keys create --name "hermes on the VPS" --persona scribe \
  --resource https://mcp.sneka.ai/mcp --preset full --ttl-days 90 --client hermes

--client names the agent the key is for: hermes, openclaw, claude-code, codex, cursor or other, matching the sections below. The command prints the key on the first line, then that client's setup from this page. --client none prints the key alone. Pass --scope with a comma-separated list instead of --preset for a custom set.

Hermes

Put the key in ~/.hermes/.env:

SNEKA_MCP_KEY=<your agent key>

Then add the server to ~/.hermes/config.yaml. If the file already has a top-level mcp_servers, add only the sneka entry under it:

mcp_servers:
  sneka:
    url: "https://mcp.sneka.ai/mcp"
    headers:
      Authorization: "Bearer ${SNEKA_MCP_KEY}"

Hermes fills in ${SNEKA_MCP_KEY} from ~/.hermes/.env when it connects. hermes mcp test sneka shows what the server answered. A running Hermes gateway picks up the change within a minute; in a chat session, /reload-mcp loads it at once.

OpenClaw

Put the key in ~/.openclaw/.env:

SNEKA_MCP_KEY=<your agent key>

Then add the server to ~/.openclaw/openclaw.json. If the file already has mcp.servers, add only the sneka entry to it:

{
  "mcp": {
    "servers": {
      "sneka": {
        "url": "https://mcp.sneka.ai/mcp",
        "transport": "streamable-http",
        "headers": {
          "Authorization": "Bearer ${SNEKA_MCP_KEY}"
        }
      }
    }
  }
}

Keep transport as shown: without it, OpenClaw uses an older transport that Sneka does not serve. Do not set auth on this entry, because OpenClaw ignores the header on a server set to sign in. openclaw mcp probe sneka connects and lists the tools.

Claude Code

Put the key in your shell profile (~/.zshrc or ~/.bashrc), so every Claude Code session starts with it:

export SNEKA_MCP_KEY=<your agent key>

Then add the server for your user. The single quotes keep the shell from filling in the key, so Claude Code saves only the reference and reads the key from SNEKA_MCP_KEY when it connects:

claude mcp add --scope user --transport http sneka https://mcp.sneka.ai/mcp --header 'Authorization: Bearer ${SNEKA_MCP_KEY}'

If an entry named sneka is already there, remove it first with claude mcp remove --scope user sneka.

Codex

Put the key in your shell profile (~/.zshrc or ~/.bashrc), so every Codex session starts with it:

export SNEKA_MCP_KEY=<your agent key>

Then add the server:

codex mcp add sneka --url https://mcp.sneka.ai/mcp --bearer-token-env-var SNEKA_MCP_KEY

Codex reads the key from SNEKA_MCP_KEY each time it connects, and keeps only the variable's name in ~/.codex/config.toml.

Cursor

Put the key in your shell profile (~/.zshrc or ~/.bashrc):

export SNEKA_MCP_KEY=<your agent key>

Then add the server to ~/.cursor/mcp.json. If the file already has mcpServers, add only the sneka entry to it:

{
  "mcpServers": {
    "sneka": {
      "url": "https://mcp.sneka.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${env:SNEKA_MCP_KEY}"
      }
    }
  }
}

Cursor reads the variable from the environment it was started in, so start it from a terminal that has SNEKA_MCP_KEY set.

Other

Any MCP client that can send a header works. Point it at https://mcp.sneka.ai/mcp over Streamable HTTP and send Authorization: Bearer <your agent key> with every request. To check a key from a terminal:

export SNEKA_MCP_KEY=<your agent key>
curl -sS https://mcp.sneka.ai/mcp -H "Authorization: Bearer $SNEKA_MCP_KEY" -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

The answer lists the tools the key may call.

List, rotate and revoke keys

Settings > Agent keys lists your keys with when each was last used, and has rotate and revoke on each. With the CLI:

sneka keys ls
sneka keys rotate <id> --ttl-days 90 --client hermes
sneka keys revoke <id>

sneka keys ls shows each key's name, persona, permissions, when it was last used, when it expires and its id. A key whose persona was archived stops working and is listed as such.

Rotating replaces a key with a new one of the same name, persona, server and permissions, and stops the old one at once. Put the new key where the old one was. Revoking stops a key at once.

If the agent is refused

  • 401: the key is missing, mistyped, expired or revoked. Check that the agent's environment has SNEKA_MCP_KEY, or create a new key. The body of the 401 tells the agent to send you the /connect link with its client and its name.
  • 403 "Insufficient scope": the key lacks the permission the tool needs. Create a key with that permission and revoke the old one.
  • 403 with no product named: your account has none of the products the key names.

Earlier persona credentials

Keys made with sneka persona mcp-credential are agent keys too. They keep working, are listed by sneka keys ls without a name, and can be rotated and revoked the same way. sneka persona mcp-credential is kept for scripts that use it; new setups use sneka keys create.