ReadonlyconfigReadonlynameReadonlypromptsReadonlyregistryReadonlyresourcesOptional ReadonlysessionReadonlytoolsReadonlyversionReadonlyviewerProcess a single inbound JSON-RPC message. Returns the response (if any) or null for notifications. Side-effect notifications (progress, log) flow through the attached sink, not the return value.
Read-only access to the auth scope for transports that need to gate access.
Open the in-process viewer for the first loaded model if configured to
do so, otherwise a no-op. Makes ServerConfig.autoOpenViewer /
.viewerPort (issue #2731 finding 4) actually take effect for any
caller that constructs MCPServer with config, not just the CLI.
Precedence: overrides (an explicit, per-call instruction — this is
what a CLI flag like --viewer represents) beats this.config (set at
construction, e.g. by an embedder) beats the built-in default of "do
not auto-open, port 0". A field left undefined at one level falls
through to the next.
No-ops (returns null) when auto-open resolves to false/undefined,
or when no model is loaded yet. Errors from ViewerManager.open()
propagate — callers that already have their own logging/fallback (the
CLI does) can catch and report; callers that don't want that risk can
check registry.count() first.
Optionaloverrides: { autoOpen?: boolean; port?: number }Broadcast a notifications/resources/updated to subscribers.
Notify clients that the tool list has changed (e.g., after model load).
Attach an outgoing-message sink. Required before handling messages.