Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions mcp_examples/bin/workflow_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ import 'package:google_generative_ai/google_generative_ai.dart' as gemini;

/// The list of Gemini models that are accepted as a "--model" argument.
/// Defaults to the first one in the list.
const List<String> allowedGeminiModels = [
'gemini-2.5-pro-preview-03-25',
'gemini-2.0-flash',
'gemini-2.5-flash-preview-04-17',
];
const List<String> allowedGeminiModels = ['gemini-2.5-pro', 'gemini-2.5-flash'];

void main(List<String> args) {
final geminiApiKey = Platform.environment['GEMINI_API_KEY'];
Expand Down Expand Up @@ -161,8 +157,6 @@ final class WorkflowClient extends MCPClient with RootsSupport {
StreamSinkTransformer.fromHandlers(
handleData: (String data, EventSink<List<int>> innerSink) {
innerSink.add(utf8.encode(data));
// It's a log, so we want to make sure it's always up-to-date.
fileByteSink.flush();
},
handleError: (
Object error,
Expand Down Expand Up @@ -552,6 +546,13 @@ final class WorkflowClient extends MCPClient with RootsSupport {
description: description,
nullable: nullable,
);
case JsonType.enumeration:
final schema = inputSchema as EnumSchema;
return gemini.Schema.enumString(
enumValues: schema.values.toList(),
description: description,
nullable: nullable,
);
default:
throw UnimplementedError(
'Unimplemented schema type ${inputSchema.type}',
Expand Down
1 change: 1 addition & 0 deletions pkgs/dart_mcp_server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
failure.
* Add failure reason field to analytics events so we can know why tool calls are
failing.
* Add a flutter_driver command for executing flutter driver commands on a device.
* Allow for multiple package arguments to `pub add` and `pub remove`.
* Require dart_mcp version 0.3.1.

Expand Down
3 changes: 2 additions & 1 deletion pkgs/dart_mcp_server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ For more information, see the official VS Code documentation for
| `hot_reload` | Hot reload | Performs a hot reload of the active Flutter application. This is to apply the latest code changes to the running application. Requires "connect_dart_tooling_daemon" to be successfully called first. |
| `get_widget_tree` | Get widget tree | Retrieves the widget tree from the active Flutter application. Requires "connect_dart_tooling_daemon" to be successfully called first. |
| `get_selected_widget` | Get selected widget | Retrieves the selected widget from the active Flutter application. Requires "connect_dart_tooling_daemon" to be successfully called first. |
| `set_widget_selection_mode` | Set Widget Selection Mode | Enables or disables widget selection mode in the active Flutter application. Requires "connect_dart_tooling_daemon" to be successfully called first. |
| `set_widget_selection_mode` | Set Widget Selection Mode | Enables or disables widget selection mode in the active Flutter application. Requires "connect_dart_tooling_daemon" to be successfully called first. This is not necessary when using flutter driver, only use it when you want the user to select a widget. |
| `get_active_location` | Get Active Editor Location | Retrieves the current active location (e.g., cursor position) in the connected editor. Requires "connect_dart_tooling_daemon" to be successfully called first. |
| `flutter_driver` | Flutter Driver | Run a flutter driver command |
| `pub_dev_search` | pub.dev search | Searches pub.dev for packages relevant to a given search query. The response will describe each result with its download count, package description, topics, license, and publisher. |
| `remove_roots` | Remove roots | Removes one or more project roots previously added via the add_roots tool. |
| `add_roots` | Add roots | Adds one or more project roots. Tools are only allowed to run under these roots, so you must call this function before passing any roots to any other tools. |
Expand Down
Loading