# `PtcRunner.Kernel.MCPOAuth.Context`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/kernel/mcp_oauth/context.ex#L1)

Principal-scoped host authorization context.

Hosts construct a context from already authenticated tenant/principal
identity. No MCP response, manifest, process dictionary, or application
environment may supply these values. Construction atomically claims the
principal lifecycle epoch from the configured store under the caller's
absolute deadline.

# `credential_resolver`

```elixir
@type credential_resolver() :: (binary(), integer() -&gt;
                            {:ok, term()} | {:error, atom()})
```

# `interaction`

```elixir
@type interaction() :: module() | nil
```

# `t`

```elixir
@type t() :: %PtcRunner.Kernel.MCPOAuth.Context{
  credential_resolver: credential_resolver(),
  interaction: interaction(),
  principal_epoch: term(),
  principal_id: binary(),
  store: PtcRunner.Kernel.MCPOAuth.Store.t(),
  tenant_id: binary()
}
```

# `grant_key`

```elixir
@spec grant_key(t(), PtcRunner.Kernel.MCPOAuth.Authority.t(), term()) ::
  PtcRunner.Kernel.MCPOAuth.GrantKey.t()
```

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, atom()}
```

---

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