change the MCP server build script to point at the custom binary
update package:ai in deps, add entrypoint script for the mcp server which injects an analytics instance Change-Id: I1fd770a061085e7303c24b0c76e48d208687d9ad Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437080 Auto-Submit: Jake Macdonald <jakemac@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
committed by
Commit Queue
parent
bb08090c5a
commit
1e639b977e
@@ -13,12 +13,12 @@ group("dart_mcp_server_aot") {
|
||||
}
|
||||
|
||||
aot_snapshot("dart_mcp_server_aot_snapshot") {
|
||||
main_dart = "../../third_party/pkg/ai/pkgs/dart_mcp_server/bin/main.dart"
|
||||
main_dart = "dart_mcp_server.dart"
|
||||
output = "$root_gen_dir/dart_mcp_server_aot.dart.snapshot"
|
||||
}
|
||||
|
||||
aot_snapshot("dart_mcp_server_aot_product_snapshot") {
|
||||
main_dart = "../../third_party/pkg/ai/pkgs/dart_mcp_server/bin/main.dart"
|
||||
main_dart = "dart_mcp_server.dart"
|
||||
output = "$root_gen_dir/dart_mcp_server_aot_product.dart.snapshot"
|
||||
|
||||
# dartaotruntime has dart_product_config applied to it,
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
/// A custom entrypoint used by `dart mcp-server`. Injects an analytics instance
|
||||
/// using the [DashTool.dartTool] tool.
|
||||
library;
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dart_mcp_server/dart_mcp_server.dart';
|
||||
import 'package:unified_analytics/unified_analytics.dart';
|
||||
|
||||
void main(List<String> args) async {
|
||||
exitCode = await DartMCPServer.run(
|
||||
args,
|
||||
analytics: Analytics(
|
||||
tool: DashTool.dartTool,
|
||||
// The actual version is part up to the first space.
|
||||
dartVersion: Platform.version.split(' ').first,
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user