Skip to content

Commit 01fbfcd

Browse files
committed
use the shared clientInfo field
1 parent a33b871 commit 01fbfcd

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

pkgs/dart_mcp_server/lib/src/server.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,6 @@ final class DartMCPServer extends MCPServer
7575
@override
7676
final Analytics? analytics;
7777

78-
/// Only safe to call after [initialize].
79-
@override
80-
ClientImplementation get clientInfo => _clientInfo;
81-
82-
/// Assigned in [initialize].
83-
late final ClientImplementation _clientInfo;
84-
85-
@override
86-
FutureOr<InitializeResult> initialize(InitializeRequest request) {
87-
_clientInfo = request.clientInfo;
88-
return super.initialize(request);
89-
}
90-
9178
@override
9279
/// Automatically logs all tool calls via analytics by wrapping the [impl],
9380
/// if [analytics] is not `null`.

pkgs/dart_mcp_server/lib/src/utils/analytics.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,15 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:dart_mcp/server.dart';
65
import 'package:unified_analytics/unified_analytics.dart';
76

87
/// An interface class that provides a access to an [Analytics] instance, if
98
/// enabled.
109
///
11-
/// Also provides a [clientInfo] getter which is required for analytics
12-
/// requests.
13-
///
1410
/// The `DartMCPServer` class implements this class so that [Analytics]
1511
/// methods can be easily mocked during testing.
1612
abstract interface class AnalyticsSupport {
1713
Analytics? get analytics;
18-
19-
ClientImplementation get clientInfo;
2014
}
2115

2216
enum AnalyticsEvent { callTool, readResource }

0 commit comments

Comments
 (0)