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

Strategy for propagating `notifications/cancelled` into handler state.

`ExMCP.Server.HandlerServer` marks the request cancelled in its own state
and then hands the notification to a tracker module so that servers can
observe cancellation the way their handler is written. The module is chosen
at start-up with the `:cancellation_tracker` option:

    ExMCP.Server.HandlerServer.start_link(
      handler: MyHandler,
      cancellation_tracker: MyApp.CancellationTracker
    )

This keeps `HandlerServer` free of handler-shape-specific branches: it just
calls the configured module.

The default implementation is `ExMCP.Server.CancellationTracker.Default`.

# `mark_cancelled`

```elixir
@callback mark_cancelled(request_id :: term(), handler_state :: term()) ::
  handler_state :: term()
```

Records `request_id` as cancelled and returns the (possibly updated) handler
state.

Implementations run inside the server process, so they must not block.

---

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