# `MCPKit.SessionStore`
[🔗](https://github.com/mcostasilva/mcp_kit/blob/v0.2.4/lib/mcp_kit/session_store.ex#L1)

Storage contract for persistent MCP sessions.

The session store is the durable authority for MCP session metadata. Runtime
stream state, queued notifications, and pending outbound requests live in
`MCPKit.Runtime`, not in the store.

# `create_session`

```elixir
@callback create_session(map()) :: {:ok, struct() | map()} | {:error, term()}
```

Creates a new persistent MCP session.

Implementations should persist the session id, initialization status,
negotiated protocol version, and any client metadata needed by the host app.

# `delete_session`

```elixir
@callback delete_session(String.t()) ::
  {:ok, struct() | map()} | {:error, :not_found | term()}
```

Deletes a persisted session by id.

Returns `{:error, :not_found}` when the session does not exist.

# `fetch_session`

```elixir
@callback fetch_session(String.t()) ::
  {:ok, struct() | map()} | {:error, :not_found | term()}
```

Fetches a persisted MCP session by id.

Returns `{:error, :not_found}` when the session does not exist.

# `mark_initialized`

```elixir
@callback mark_initialized(struct() | map()) :: {:ok, struct() | map()} | {:error, term()}
```

Marks a session as initialized after `notifications/initialized`.

# `touch_session`

```elixir
@callback touch_session(struct() | map()) :: {:ok, struct() | map()} | {:error, term()}
```

Updates any session heartbeat or last-seen metadata after a successful request.

---

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