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
@@ -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",
|
||||
|
||||
@@ -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