MCPServer class

Model Context Protocol (MCP) Server for Strategic Logger

Provides a native MCP server that allows AI agents to:

  • Register structured logging events
  • Query recent logs with filtering
  • Access logging context for debugging
  • Monitor application health through logs

Constructors

MCPServer.new({int port = 3001, String host = 'localhost'})

Properties

hashCode int
The hash code for this object.
no setterinherited
isRunning bool
Whether the MCP server is currently running
no setter
logHistory List<MCPLogEntry>
Current log history for testing
no setter
logStream Stream<MCPLogEntry>
Stream of log entries for real-time monitoring
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addLogEntry(MCPLogEntry entry) → void
Adds a log entry to the history
fromLogEntry(LogEntry logEntry) MCPLogEntry
Converts a LogEntry to MCPLogEntry
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() Future<void>
Starts the MCP server
stop() Future<void>
Stops the MCP server
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance MCPServer
no setter