feat: add MCP support (#1471)

This commit is contained in:
Levi authored and GitHub committed 2026-09-05 20:21:39 +08:00
1 parent 39cd9034cd
commit f2145de571
83 files changed
+3119 -363

No files matched your search

@@ -1,6 +1,7 @@
class ApiServerState {
const ApiServerState({
required this.enabled,
required this.mcpEnabled,
required this.running,
required this.network,
required this.address,
@@ -10,6 +11,7 @@ class ApiServerState {
});
final bool enabled;
final bool mcpEnabled;
final bool running;
final String network;
final String address;
@@ -20,6 +22,7 @@ class ApiServerState {
factory ApiServerState.fromJson(Map<String, dynamic> json) {
return ApiServerState(
enabled: json['enabled'] as bool? ?? false,
mcpEnabled: json['mcpEnabled'] as bool? ?? false,
running: json['running'] as bool? ?? false,
network: json['network'] as String? ?? '',
address: json['address'] as String? ?? '',
@@ -50,6 +53,7 @@ class ApiServerOperationResult {
state: rawState == null
? const ApiServerState(
enabled: false,
mcpEnabled: false,
running: false,
network: '',
address: '',
@@ -20,6 +20,7 @@ class StartConfig {
late String network;
late String address;
bool apiEnable = false;
bool mcpEnable = false;
late String storage;
late String storageDir;
late int refreshInterval;
@@ -23,6 +23,7 @@ StartConfig _$StartConfigFromJson(Map<String, dynamic> json) => StartConfig()
..network = json['network'] as String
..address = json['address'] as String
..apiEnable = json['apiEnable'] as bool
..mcpEnable = json['mcpEnable'] as bool? ?? false
..storage = json['storage'] as String
..storageDir = json['storageDir'] as String
..refreshInterval = (json['refreshInterval'] as num).toInt()
@@ -38,6 +39,7 @@ Map<String, dynamic> _$StartConfigToJson(StartConfig instance) =>
'network': instance.network,
'address': instance.address,
'apiEnable': instance.apiEnable,
'mcpEnable': instance.mcpEnable,
'storage': instance.storage,
'storageDir': instance.storageDir,
'refreshInterval': instance.refreshInterval,