intellicrack.mcp.progress
Progress a server reports on a request that is still running.
A client asks for progress by giving a request a progressToken in its _meta; the server answers with
notifications/progress carrying the token, how far it has got, optionally the total, and optionally a message. Intellicrack asks for
it on every tool call, resource read and prompt fetch, on both protocol generations, and hands each notice on as an McpProgress.
The message is the server’s own text, so it is cleaned of hidden characters and forged fence markers and bounded before anything shows it. Whether a notice counts as progress for the request’s deadline is decided by the connection: only a value above the last one does, as the protocol requires progress to increase.
- PROGRESS_MESSAGE_LIMIT: Final[int] = 300
The most characters of a server’s progress message that are kept.
- class ProgressKind[source]
Bases:
StrEnumWhich kind of request the progress is for.
- Variables:
TOOL – A
tools/call.RESOURCE – A
resources/read.PROMPT – A
prompts/get.
- TOOL = 'tool'
- RESOURCE = 'resource'
- PROMPT = 'prompt'
- __new__(value)
- class McpProgress[source]
Bases:
objectOne progress notice from a server.
- Variables:
server_id (str) – The server reporting.
kind (ProgressKind) – The kind of request.
subject (str) – The tool’s name, the resource’s URI or the prompt’s name.
progress (float) – How far the server has got.
total (float | None) – The total it is working towards, or
Nonewhen unknown.message (str | None) – What the server said about it, cleaned, or
None.
- kind: ProgressKind
- classmethod from_wire(server_id, kind, subject, *, progress, total, message)[source]
Build a notice from what the server sent, cleaning its text.
- Parameters:
- Returns:
The notice, its message cleaned and bounded and a total that is not a positive finite number dropped.
- Return type:
- property fraction: float | None
How much of the total is done.
- Returns:
A value from 0 to 1, or
Nonewhen the total is unknown.- Return type:
float | None
- type ProgressFn = Callable[[McpProgress], None]
Receives each progress notice for one request.