# `mix attesto_mcp.install.sessions`
[🔗](https://github.com/XukuLLC/attesto_mcp/blob/v1.0.5/lib/mix/tasks/attesto_mcp.install.sessions.ex#L58)

Wires the Ecto-backed Anubis MCP session store into a host application

Configures `AttestoMCP.Anubis.SessionStore.Ecto` - a Postgres-backed
`Anubis.Server.Session.Store` - so MCP sessions survive a deploy/node
replacement and a client reconnects with its initialized state restored.

What it changes (deterministic):

  * adds the `config :anubis_mcp, :session_store` block (enabled, the Ecto
    adapter, the repo, and a 30-minute TTL) to `config/config.exs`;
  * with `--registry`, adds the `horde` dependency for the clustered
    `AttestoMCP.Anubis.Registry.Horde`.

What it leaves to you (printed as a notice, because the locations are
app-specific and must not be blind-edited):

  * run `mix attesto_mcp.gen.session_migration --repo <Repo>` to create the
    `attesto_mcp_sessions` table;
  * with `--registry`, wire `registry: {AttestoMCP.Anubis.Registry.Horde, []}`
    into your Anubis server child spec, and connect the nodes (e.g.
    `libcluster`).

Idempotent: re-running does not duplicate the config block or the dependency.

## Example

```sh
mix attesto_mcp.install.sessions --repo MyApp.Repo --registry
```

## Options

* `--repo` - the `Ecto.Repo` the session store uses. Defaults to the
  application's `<App>.Repo`.
* `--registry` - also add the `horde` dependency for the clustered registry
  adapter (and print the wiring notice). Off by default.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
