tree: c9477907beb0c2ef4808165bace600248bcc94ad [path history] [tgz]
  1. prompts_client.dart
  2. prompts_server.dart
  3. README.md
  4. resources_client.dart
  5. resources_server.dart
  6. roots_and_logging_client.dart
  7. roots_and_logging_server.dart
  8. tools_client.dart
  9. tools_server.dart
pkgs/dart_mcp/example/README.md

Client and Server examples

For each client or server feature, there is a corresponding example here with the {feature}_client.dart and {feature}_server.dart file names. Sometimes multiple features are demonstrated together where appropriate, in which case the file name will indicate this.

To run the examples, run the client file directly, so for instance dart run example/tools_client.dart with run the example client which invokes tools, connected to the example server that provides tools (at example/tools_server.dart).

Full Featured Examples

See https://github.com/dart-lang/ai/tree/main/mcp_examples for some more full featured examples using gemini to automatically invoke tools.

The example client there is also useful for testing your own server.