-
Notifications
You must be signed in to change notification settings - Fork 9
A 'pub-dev-search' mcp tool #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. |
Example transcript:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a plan for testing this?
Should it hit the real server? Fake out some http responses by passing in an HttpClient (this might not be that useful)?
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
I didn't think the testing very much through yet, but I definitely think we should provide fixed fake responses and not rely on a live server for testing. I'll try to cook up some tests. |
Co-authored-by: Jacob MacDonald <[email protected]>
Co-authored-by: Jacob MacDonald <[email protected]>
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
// Retrieve information about all the packages in parallel | ||
final subQueryFutures = packageNames | ||
.expand( | ||
(packageName) => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would just make this a list of records so its a bit easier to follow
pkgs/dart_tooling_mcp_server/lib/src/mixins/pub_dev_search.dart
Outdated
Show resolved
Hide resolved
'The response will describe each result with its download count,' | ||
' package description, topics, license, and a list of identifiers ' | ||
'in the public api', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkgs/dart_tooling_mcp_server/test_fixtures/pub_dev_responses/README.md
Outdated
Show resolved
Hide resolved
pkgs/dart_tooling_mcp_server/test_fixtures/pub_dev_responses/README.md
Outdated
Show resolved
Hide resolved
…EADME.md Co-authored-by: Jacob MacDonald <[email protected]>
…EADME.md Co-authored-by: Jacob MacDonald <[email protected]>
Please also add this tool to table here: https://github.com/dart-lang/ai/tree/main/pkgs/dart_tooling_mcp_server |
Co-authored-by: Jacob MacDonald <[email protected]>
Co-authored-by: Jacob MacDonald <[email protected]>
…art-lang#99) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates all CLI tools to only allow them to be ran under one of the client specified roots. - If paths are specified, those also must not escape the roots. - Make roots not required any longer, use the client specified roots by default for all tools. - Create some shared constants for argument names and a shared function to create the schemas for the roots parameters.
This ended up being a fair bit more complicated than I wanted, as it also refactors things and moves us towards a direction where we can support multiple connected apps (which was a natural extension of creating the resource URI, to include the debug session ID in it). Functionally, this: - Starts collecting errors as soon as a debug session is connected, and creates a runtime errors resource for each session. - Allows us to fire change notifications for when new errors come in. - Also added a `clear_runtime_errors` tool as well as an argument to the `hotReload` tool to clear the errors prior to the hot reload. - Drops the support for `since` in favor of just clearing the errors. Eventually we might want to support pagination of the resource instead (it is already modeled as many parts), I filed a feature request on the MCP repo for this, but it likely won't land for some time if at all.
Closes dart-lang#4. - Used this functionality to test the invalid protocol message flow, which does appear to work fine as is (json_rpc_2 handles it well for us), but is now tested. - Made some small breaking changes to the constructors for MCPClient/MCPServer/MCPBase so they all accept a single positional parameter for the stream channel, and this support is implemented once in MCPBase.
Related to dart-lang#96 - Tests the current behavior, ensures we aren't leaking exceptions beyond what is expected. - Also documents explicitly the behavior in initialize to encourage exception handling, and helping you to debug.
I will probably wait until Monday to actually merge this and tag it
This forwards directly to the [LSP signature help](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_signatureHelp) functionality. Allows requesting information about the signature of some API being _used_ at a specific cursor location. **Note**: Does not seem to give useful information if the location is a _definition_ site (such as one returned by a workspace_symbol lookup). But this looks like it is by design probably.
Makes the bot more interactive and also gives us a sense of total input/output token usage [Screen recording 2025-05-05 9.24.57 AM.webm](https://github.com/user-attachments/assets/993729bf-889a-485f-b295-9be52ca0e242) Also makes a small fix to the tooling server so it is compatible again (it had lost compatibility due to a recent change which added a list schema with no items schema, which seems to be required for gemini tools).
Adds a 'pub-dev-search' tool to the mcp tool list.
An attempt at #93
It strings together a number of (more or less secret) api calls from pub.dev to find relevant packages and information about them:
api/search/q=
for finding a list of packages (limits to 10 packages).api/packages/<package>
for finding the description and latest versionapi/packages/<package>/score
for finding scores and tagsdocumentation/<package>/latest/index.json
for listing top-level identifiers