Server constructor
Server({
- required String name,
- required String version,
- String? description,
- String? title,
- String? websiteUrl,
- List<
McpIcon> ? icons, - String? instructions,
- ServerCapabilities capabilities = const ServerCapabilities(),
- int? pageSize,
- bool serverInfoInResults = true,
- Duration cacheTtl = Duration.zero,
- bool publicLists = false,
- Duration progressMinInterval = const Duration(milliseconds: 50),
- McpTaskStore? taskStore,
Creates a new MCP server with the specified parameters
Implementation
Server({
required this.name,
required this.version,
this.description,
this.title,
this.websiteUrl,
this.icons,
this.instructions,
this.capabilities = const ServerCapabilities(),
this.pageSize,
this.serverInfoInResults = true,
this.cacheTtl = Duration.zero,
this.publicLists = false,
this.progressMinInterval = const Duration(milliseconds: 50),
McpTaskStore? taskStore,
}) : taskStore = taskStore ?? McpTaskStore(),
assert(pageSize == null || pageSize > 0),
assert(!cacheTtl.isNegative) {
_taskChanges = this.taskStore.changes.listen(_onTaskChange);
_metricsCollector = MetricsCollector();
_standardMetrics = StandardMetrics(_metricsCollector);
// Initialize resource counters
_updateResourceMetrics();
}