diff --git a/DEPS b/DEPS index cdf0a5d5a5f..f95e7414fc6 100644 --- a/DEPS +++ b/DEPS @@ -131,7 +131,7 @@ vars = { ### /third_party/pkg dependencies # 'tools/rev_sdk_deps.dart' will rev pkg dependencies to their latest; put an # EOL comment after a dependency to instead pin at the current revision. - "ai_rev": "5f9c50fc93c978e059a3ab2a071faeca6f81fd68", + "ai_rev": "706d22444f2ca6123aeb8f1f4508b1d4451b6d0d", "core_rev": "b59ecf4ceebe6153e1c0166b7c9a7fdd9458a89d", "dartdoc_rev": "f1fe17752b1193ad52d69271ceb686cc3e4712b0", "ecosystem_rev": "d5233c6dd0767cffa5742e32c4bc7c230c9c4b12", diff --git a/utils/dart_mcp_server/BUILD.gn b/utils/dart_mcp_server/BUILD.gn index 839ceb8d10a..06c3bc2b7ce 100644 --- a/utils/dart_mcp_server/BUILD.gn +++ b/utils/dart_mcp_server/BUILD.gn @@ -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, diff --git a/utils/dart_mcp_server/dart_mcp_server.dart b/utils/dart_mcp_server/dart_mcp_server.dart new file mode 100644 index 00000000000..90becff8c74 --- /dev/null +++ b/utils/dart_mcp_server/dart_mcp_server.dart @@ -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 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, + ), + ); +}