# `ExMCP.Server.Context`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/server/context.ex#L1)

Access to the validated context of the currently executing server callback.

This is primarily useful for MRTR-aware handlers that retain their existing
callback arity. The value is scoped to the callback invocation and must not
be read later from a spawned process.

# `current`

```elixir
@spec current() :: ExMCP.Server.RequestContext.t() | nil
```

# `input_responses`

```elixir
@spec input_responses() :: map() | nil
```

# `progress_token`

```elixir
@spec progress_token() :: ExMCP.Types.progress_token() | nil
```

# `report_progress`

```elixir
@spec report_progress(number(), number() | nil, String.t() | nil) ::
  :ok
  | {:error,
     :no_request_context
     | :progress_not_requested
     | :request_not_streaming
     | :stream_closed
     | :stream_timeout}
```

Reports progress for the currently executing request callback.

Modern streamable-HTTP handlers use this request-scoped helper instead of a
connection-wide server process. The request must include
`_meta.progressToken`, and its HTTP response must be an active SSE stream.
Delivery is acknowledged before this function returns, which guarantees the
notification is written before the request's final JSON-RPC response.

# `request_state`

```elixir
@spec request_state() :: term()
```

# `send_log_message`

```elixir
@spec send_log_message(atom() | String.t(), String.t(), map()) ::
  :ok
  | {:error,
     :no_request_context
     | :logging_not_requested
     | :invalid_log_level
     | :request_not_streaming
     | :stream_closed
     | :stream_timeout}
```

Sends a log notification on the currently executing request's HTTP stream.

Request-scoped log delivery is available only while that request owns an
active SSE response. It never falls back to another request or subscription
stream.

MCP protocol Logging is deprecated as of 2026-07-28 and retained throughout
ExMCP 1.x. Prefer stderr for stdio diagnostics or OpenTelemetry for new
structured-observability integrations.

---

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