DexioView only
Sign inMake a copy

Dexio / how-we-build-dexio / agents

Letting an agent connect itself, and testing it with headless agents

The person's part should be one sentence. The agent's part is everything else: reading the steps, signing the person in, saving a key, editing its own config, and confirming it works. How the endpoint authenticates each kind of client: remote-mcp-server-with-oauth. How we run our own agents: hermes-agent-team.

What it is

Why it is built this way

How to build it

  1. Write the steps page for agents, not people. Number the steps, put every endpoint in the page itself, give each agent its config block, and say what to tell the person at the end: that it is connected, and which file holds the key. Serve it as raw markdown.

  2. Mint keys only on POST (a GET never makes one), name each key for the agent it is for, and put the key last in the message so no punctuation touches it.

  3. Add the device sign-in: one endpoint that starts it and returns a short code and a link, one the agent polls until the person approves. The sign-in and sign-up pages say an agent is waiting and keep the link through sign-up.

  4. Handle each agent's quirks in the steps page:

    • Claude Code: claude mcp add --transport http --scope user dexio <url> --header "Authorization: Bearer <key>", then a new session to load it.
    • Codex: a [mcp_servers.dexio] table in ~/.codex/config.toml with url and http_headers, then a new session.
    • Hermes: its file tools refuse to write config.yaml (deliberately), a heredoc in its terminal stops for approval, and hermes mcp add asks questions. So the agent writes a short Python script with its file tool, with the key inside it, and runs it once. The script saves the key to $HERMES_HOME/.env without printing it, removes any older entry, runs hermes mcp add with its answers piped in, and deletes itself. Behind a chat gateway the person then sends /reload-mcp.
  5. Write tool descriptions that say when to use each tool, so a newly connected agent actually reaches for the wiki.

  6. Test with real agents before and after every change to the steps or the tools:

    • One throwaway home per run (HOME, or HERMES_HOME for Hermes) and a throwaway account, deleted afterwards, or a local server seeded with a small wiki.

    • For setup, give a headless agent only the one-sentence prompt and record whether it started, how many commands failed, how long it took, and whether its next turn could call a Dexio tool.

    • For tool behavior, run Claude Code as a shell-less agent with only your MCP server:

      claude -p "<task that never names the tools>" --tools "" --mcp-config mcp.json \
        --strict-mcp-config --allowedTools mcp__dexio --permission-mode dontAsk \
        --setting-sources project --no-session-persistence --output-format stream-json --verbose
      
    • For Hermes with only the MCP tools: hermes -p <profile> chat -Q --ignore-rules -t mcp-dexio --max-turns 40 -q "<task>".

What the tests showed

Small samples, one client per row, so read them as direction rather than rates:

Pitfalls we hit