HttpSseTransport class

An MCP transport that exposes ApolloMcpServer over HTTP using the Server-Sent Events (SSE) transport:

  • GET /sse opens an SSE stream. The first event (event: endpoint) tells the client which URL to POST messages to (/message?sessionId=...). Server→client JSON-RPC messages are streamed as event: message frames.
  • POST /message?sessionId=... delivers one client→server JSON-RPC message; the server replies over the session's SSE stream. Returns 202 Accepted.

SECURITY: binds to 127.0.0.1 by default. Exposing this on a public interface grants unauthenticated code execution — front it with auth/TLS and an explicit host only in a trusted environment.

Constructors

HttpSseTransport({McpLimits limits = const McpLimits(), bool nullSafetyChecks = false, RepositoryAdapter? repository, RepoConfig repoConfig = const RepoConfig()})

Properties

address InternetAddress?
The bound address, available after start.
no setter
hashCode int
The hash code for this object.
no setterinherited
limits McpLimits
final
nullSafetyChecks bool
Server-wide default for the tools' nullSafety argument.
final
port int?
The bound port, available after start.
no setter
repoConfig RepoConfig
final
repository RepositoryAdapter?
Optional workspace/repository backend shared by all sessions (exposes the apollovm.fs.*/search.*/code.*/git.* tools when set).
final
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
start({int port = 8080, String host = '127.0.0.1'}) Future<void>
Binds an HttpServer on host:port and starts serving.
stop() Future<void>
Stops the server and closes all active sessions.
toString() String
A string representation of this object.
inherited

Operators

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