ModelHttpServer class final

A ModelMcpServer listening on 127.0.0.1, for ModelHttpServer.start.

One instance owns one HTTP socket and one ModelMcpServer wired to it — mirroring bin/model_mcp.dart's one process, one ModelSession, except the process here is the GUI, already running for a person, and this is an extra way in beside the window.

Properties

hashCode → int
The hash code for this object.
no setterinherited
port → int
The port this bound to — the one to put in the session file.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
token → String
The token every request must present — write this into the session file (writeMcpSessionFile) so whatever starts this can hand it to an agent.
no setter

Methods

close() → Future<void>
Closes the socket and the ModelMcpServer wired to it. Does not touch the session file — a caller that wrote one owns removing it too.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

start({required ModelSession session, int port = 0, String? token, List<ModelPictureTool> extraTools = const <ModelPictureTool>[], void onToolCall(String toolName, Map<String, Object?> arguments, PictureAnswer answer, Duration elapsed)?, void onInitialize(String clientName)?, String? pausedBecause()?}) → Future<ModelHttpServer>
Binds 127.0.0.1:$port and serves session there. See LoopbackMcpServer.start for port and token.