Skip to content

Conversation

@jakemac53
Copy link
Contributor

@jakemac53 jakemac53 commented Jul 15, 2025

Towards #220.

I also added a utility function for created stdio stream channels to simplify the examples (and real user code), and fixed a bug in the PromptMessage constructor.

Still missing a few examples, but this covers the most common use cases.

cc @gaaclarke

@github-actions
Copy link

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

// 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe for these examples, it would be good to add a dartdoc comment at the top that describes what each example is meant to show and a pointer to the README.md. In general, for examples, these don't have enough comments.

It's also helpful when perusing the code in an IDE to have dartdoc links back to the classes that are relevant (e.g. to MCPServer and PromptsSupport for this one).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had Gemini add some comments and then cleaned them up a bit, also moved some things around to simplify it.

The version checking for instance doesn't need to happen manually (it is handled for you) and also things can be registered in the constructor instead of initialize which is more concise (no need to override and call super).

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@auto-submit auto-submit bot merged commit 61ba1ea into main Jul 16, 2025
29 checks passed
@auto-submit auto-submit bot deleted the examples branch July 16, 2025 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants