# `Excessibility.MCP.Progress`
[🔗](https://github.com/lessthanseventy/excessibility/blob/v0.18.1/lib/excessibility/mcp/progress.ex#L1)

Helper for sending MCP progress notifications.

Progress notifications allow tools to report their progress during
long-running operations.

## Usage

    # In a tool's execute function:
    def execute(args, opts) do
      callback = Keyword.get(opts, :progress_callback)

      if callback do
        callback.("Starting...", 0)
        # ... do work ...
        callback.("Processing...", 50)
        # ... more work ...
        callback.("Complete", 100)
      end

      {:ok, result}
    end

    # When calling the tool with progress support:
    callback = Progress.callback(token: "op-123")
    Tool.execute(args, progress_callback: callback)

# `callback`

Creates a progress callback function.

The returned function can be passed to tools via the `:progress_callback` option.

## Options

- `:token` - Progress token for correlating notifications (optional)
- `:io` - IO device to write to (default: :stdio)

## Example

    callback = Progress.callback(token: "operation-123")
    callback.("Processing...", 50)

# `notify`

Sends a progress notification to stdout.

This is used internally by the callback function.

# `with_progress`

Wraps a function with progress notifications.

Sends start (0%) and complete (100%) notifications automatically.

## Example

    result = Progress.with_progress(
      "Running analysis",
      token: "analysis-1",
      fn ->
        expensive_operation()
      end
    )

---

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