exec method
Run command.
The contents of katana.yaml and the arguments of the command are passed to context.
コマンドを実行します。
contextにkatana.yamlの内容やコマンドの引数が渡されます。
Implementation
@override
Future<void> exec(ExecContext context) async {
final json = <String, dynamic>{};
for (final entry in mcps.entries) {
if (!entry.value.apply(context)) {
continue;
}
final res = entry.value.body(context);
json.addAll(res);
}
await File(fileName).writeAsString(
jsonEncode({"mcpServers": json}),
);
}