# Connecting an AI agent to Hugy

Hugy is a user-owned memory for AI agents, stored as markdown files (for example USER.md and MEMORY.md). Agents connect over MCP. Files are encrypted in transit and at rest.

## Step 0: the user creates a token (required for every client)

1. The user signs in at https://hugy.ai/app/ (free; Hugy emails a sign-in link).
2. Under "Connect your agents", the user creates a named token for this agent, for example "Claude Duet", and copies it. Hugy shows it only once.
3. Use it below in place of `<YOUR_TOKEN>`. Treat it like a password: anyone who has it can read and write the user's memory files until it is revoked. The user can revoke any token in the app.

There is no OAuth flow. An agent cannot create a token by itself; ask the user for one.

## Connection details

- Endpoint: `https://hugy.ai/app/mcp` (MCP Streamable HTTP, JSON-RPC 2.0, protocol version 2025-06-18)
- Header auth: `Authorization: Bearer <YOUR_TOKEN>`
- URL auth (for clients without custom headers): `https://hugy.ai/app/mcp/<YOUR_TOKEN>`. Because this address contains the token, keep it private.

## Per-client steps

### Meta Muse (beta, not yet verified)
1. Add Hugy as a connected service (custom MCP connector) if your Muse plan offers one.
2. Use the single connector address: `https://hugy.ai/app/mcp/<YOUR_TOKEN>`
3. Status: the token-in-URL form works on the Hugy server, but we have not yet confirmed a full connection from Muse.

### Claude Duet
1. Claude Duet uses the connectors on your Claude account. In Claude, open Settings, then Connectors, and add a custom connector.
2. Server URL: `https://hugy.ai/app/mcp`
3. Authentication: bearer token, with your Hugy token as the value.

### OpenAI Dots (paid ChatGPT Pro, Business or Enterprise plans only)
1. If your plan allows custom connectors, add one with server URL `https://hugy.ai/app/mcp`.
2. Use your Hugy token as the bearer token.

### Grok Bot (works with the token-in-URL form)
1. Add Hugy as an MCP connector using the single connector address: `https://hugy.ai/app/mcp/<YOUR_TOKEN>`
2. Status: works. A Grok Bot connection with this token-in-URL form completed initialize and tools/list on October 27, 2026. Keep this address private, since it contains your token.

### OpenClaw
Add Hugy under `mcp.servers` in your OpenClaw config:

```json
{
  "mcp": {
    "servers": {
      "hugy": {
        "url": "https://hugy.ai/app/mcp",
        "headers": { "Authorization": "Bearer <YOUR_TOKEN>" }
      }
    }
  }
}
```

### Hermes
Add Hugy under `mcp_servers` in your Hermes config:

```yaml
mcp_servers:
  hugy:
    url: "https://hugy.ai/app/mcp"
    headers:
      Authorization: "Bearer <YOUR_TOKEN>"
```

### Any other MCP client
Point it at `https://hugy.ai/app/mcp` with the bearer header, or at `https://hugy.ai/app/mcp/<YOUR_TOKEN>` if it cannot send headers.

## Tools

- `list_files`: list the user's memory files with size and last update.
- `read_file(name)`: read one file, e.g. USER.md or MEMORY.md.
- `write_file(name, content)`: create or replace a file with full new content.
- `append_memory(text, file?)`: append one dated fact or preference (defaults to MEMORY.md).
- `search(query)`: case-insensitive text search across all files.

Recommended: read USER.md and MEMORY.md at the start of a task, and save durable facts with `append_memory`.

## More agent docs

All agent guides: https://hugy.ai/agents/index.md

## Using Hugy with several agents

To share memory across platforms (session protocol, shared files, handoffs), follow https://hugy.ai/agents/coordination.md

## Check it worked

Ask the agent: "Read my Hugy USER.md file." Then ask it to remember something, and open https://hugy.ai/app/ to see the new line in MEMORY.md.
