ServerBootstrap class

Implemented types

Constructors

ServerBootstrap({String name = 'knowledge_builder', String version = '0.1.0', Project? project, AssetExtractor extractor = const StubAssetExtractor(), Set<ToolScope> visibility = const {ToolScope.external}, bool debugMode = false})

Properties

activeVisibility Set<ToolScope>
Visibility filter the host launches with. Tools outside the filter stay tracked (for introspection) but never reach the transport.
no setteroverride
debugMode bool
no setteroverride
dispatchLog List<Map<String, Object?>>
Read-only snapshot of recent dispatches (kernel observability surface; reference impl caps the buffer at ~200 entries).
no setteroverride
externalSpec McpServerSpec?
External dial-back description for this host. Returns null for in-process implementations that never expose a wire transport. Transport-binding implementations override this once start() has wired a concrete URL / port / command pair so consumers (Claude Code's --mcp-config, sibling hosts, debug tooling) can reach the server without re-encoding wire details. See host/mcp_server_spec.dart.
no setteroverride
extractor AssetExtractor
Replace the LLM-backed asset extractor at runtime — host wires the real provider once mcp_llm session is available.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
name String
Caller-supplied server identity surfaced on initialize.
final
pipeline PatchPipeline?
no setter
project Project?
getter/setter pair
promptDefinitions List<KernelPromptDef>
Read-only snapshot of every registered prompt definition.
no setteroverride
queue ReviewerQueue?
no setter
resourceUris List<String>
Read-only snapshot of every registered resource URI (parity with toolDefinitions / promptDefinitions). Used by hosts and tests to confirm what the server exposes — e.g. the MCP Serving bundle document at bundle://manifest.json.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
server Server
Underlying mcp_server instance. Reference-impl detail — hosts that need to drive the raw server (e.g. attaching prompt handlers directly) reach in here. Code outside the mcp_host adapter should prefer the KernelServerHost surface.
final
toolDefinitions List<KernelToolDef>
Read-only snapshot of every registered tool definition.
no setteroverride
toolScopes Map<String, ToolScope>
Read-only snapshot of registered tool scopes.
no setteroverride
version String
final

Methods

addPrompt({required String name, required String description, required List<KernelPromptArgument> arguments, required KernelPromptHandler handler}) → void
Register an MCP prompt. The handler returns a KernelGetPromptResult (description + list of messages); the host translates to the wire shape (mcp.GetPromptResult for the reference impl, host-specific for custom transports).
override
addResource({required String uri, required String name, required String description, required String mimeType, required KernelResourceHandler handler}) → void
Register an MCP-style resource. The handler returns KernelReadResourceResult; the host translates to its wire shape.
override
addTool({required String name, required String description, required Map<String, dynamic> inputSchema, required KernelToolHandler handler, ToolScope scope = ToolScope.external}) → void
Register a tool. Idempotent re-registration replaces the handler.
override
callTool(String name, Map<String, dynamic> args) Future<KernelToolResult>
In-process tool dispatch. Used by BundleActivation flows whose toolDispatcher closure routes through the host's local server surface, by BundleSessionBridge mirroring, and by host code that wants to invoke a tool without going over the transport.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register() → void
Idempotent tool registration. Call once before connecting a transport.
override
removePrompt(String name) bool
Remove a previously registered prompt. Returns true when an entry was removed (the call is idempotent on missing names).
override
removeResource(String uri) bool
Remove a previously registered resource. Returns true when an entry was removed (the call is idempotent on missing URIs).
override
removeTool(String name) bool
Remove a previously registered tool. Returns true when an entry was removed.
override
setExternalStdioSpec({required String command, List<String> args = const <String>[], Map<String, String> env = const <String, String>{}}) → void
Publish a stdio dial-back spec. Hosts that ship the kernel as a child process (Claude Code calling vibe_studio's stdio MCP surface) call this so externalSpec surfaces the launch command / args / env consumers need.
shutdown() Future<void>
Tear the transport down.
override
start(KernelTransportKind transport, {String host = '127.0.0.1', int port = 7820}) Future<void>
Dispatch the chosen transport to the matching startX method.
override
startSse({String host = '127.0.0.1', int port = 7821, String endpoint = '/sse', String messagesEndpoint = '/message'}) Future<void>
startStdio() Future<void>
startStreamableHttp({String host = '127.0.0.1', int port = 7820, String endpoint = '/mcp'}) Future<void>
startTransport(TransportType transport, {String host = '127.0.0.1', int port = 7820}) Future<void>
Legacy entry point — accepts the infra/server TransportType enum used by older callers (transport_picker.pickTransport).
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

factory({required String name, required String version, Set<ToolScope> visibility = const {ToolScope.external}, bool debugMode = false}) ServerBootstrap
KernelServerHostFactory-shaped entry point. Hosts pass this to KernelApp.boot(serverHostFactory: ServerBootstrap.factory) so every endpoint binds an MCP-server-backed surface.