VmServiceDiscovery class

Finds running Flutter/Dart apps without being handed a URI.

Uses the Dart Tooling Daemon (DTD). flutter run and the IDEs start a DTD instance per workspace and register their app's VM Service with it, so DTD already knows the auth-coded WebSocket URI that is otherwise only ever printed to flutter run's stdout.

This is the same mechanism the official dart mcp_server uses.

Constructors

VmServiceDiscovery()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

describe(List<DiscoveredApp> apps) → String
Renders discovered apps for an MCP tool response.
discoverApps({String? workspaceFilter, Duration timeout = const Duration(seconds: 10)}) → Future<List<DiscoveredApp>>
Connects to every local DTD instance and collects the VM Service URIs of the apps they manage.
listDtdInstances({String? dartExecutable}) → Future<List<DtdInstance>>
Runs dart tooling-daemon --list and parses the result.
parseForTest(String text) → List<DtdInstance>
Exposed for tests: parse without touching the filesystem.
toJsonText(List<DiscoveredApp> apps) → String
Convenience for JSON consumers.