pubdev_context 0.4.0-rc.5
pubdev_context: ^0.4.0-rc.5 copied to clipboard
Model Context Protocol (MCP) server for pub.dev. Gives AI agents structured access to search, compare, evaluate, and inspect Dart and Flutter packages.
Changelog #
All notable changes to pubdev_context are documented here.
Format follows Keep a Changelog.
0.4.0-rc.5 #
Changed #
- Handler caching (package metadata, API indexes, source files, ASTs, search and version lists) was consolidated onto a single caching layer. Concurrent tool calls for the same package — e.g.
browse_api_symbols,find_symbols, andget_symbol_documentationin one agent turn — now share a single pub.dev fetch instead of issuing redundant requests, andget_package/compare_packagesshare one cache entry per package version instead of fetching and caching it twice. No change to tool inputs, outputs, or error codes.
0.4.0-rc.4 #
Added #
find_symbols— search a package's public API for symbols matching a query.get_api_diff— diff the public API between two versions (added/removed libraries, classes, methods, fields).get_source_slice— read package source by line range or by AST-located symbol.list_package_versions— all published versions bucketed into stable/prerelease/retracted.pub://package/{name}@{version}/pubspecandpub://meta/instructionsresources.- On-disk tarball cache with LRU eviction (
--cache-dir,--max-cache-size) and a global request concurrency limiter (--max-concurrent-requests). - Wire Trace — opt-in
--wire-tracewrites a human-readable log of every LLM tool/resource call and pub.dev request to a per-session file under<cache-dir>/wire-trace. Off by default; tune with--wire-trace-dirand--wire-trace-max-preview. See the README.
Changed #
- Breaking: package resource URIs are now versioned —
pub://package/{name}@{version}/{resource}.{version}is mandatory;@latestresolves to the latest stable and every body is prefixed with a[Resolved Version: x.y.z]header. compare_packagesfetches concurrently and emits the ADR 0002 nested error schema.
Removed #
get_method_bodyandget_package_source_file— superseded byget_source_slice.- All three MCP prompts and the
find_alternativesstub — out of V1 scope; the server no longer advertises thepromptscapability.
Fixed #
- Wire Trace — each top-level LLM request now separates from the previous one with a blank line, so interleaved concurrent requests stay visually distinct.
0.4.0-rc.2 #
Added #
get_throw_statementstool — scans a scoped region of a package's source forthrowexpressions and returns each one with the thrown type and surrounding control-flow context. Three call shapes:classonly (all throws in the class),class+method(one method), ormethodonly (top-level function). Closures inside a scanned method are excluded — only direct throws in the scanned scope are reported. Shares the AST snapshot cache withget_method_bodyso a source file is never parsed twice in the same agent turn.
0.4.0-rc.1 #
Added #
get_method_bodytool — returns the exact, untruncated source text of a method, constructor, accessor, or top-level function using AST-precise extraction (package:analyzer/parseString()). Providepackage,method, and optionalclassfor a class member; omitclassfor a top-level function. Supports named-constructor suffix matching ("fromJson"→ClassName.fromJson), default-constructor retrieval ("new"→ unnamed constructor, consistent withClassName.newsyntax), operator normalisation ("=="and"operator =="both resolve), and labelled getter+setter pairs when both exist for the same name. Top-level functions are located via the API index (qualifiedNamesuffix match); multiple matches returnambiguous_symbolwith analternativesarray for a qualified retry.DomainErrors.classNotFound(class_not_found) — returned when theclassparameter names a type not found in any source file of the package.DomainErrors.methodNotFound(method_not_found) — returned when the named member is absent from the class or no matching top-level function exists.
Changed #
- Breaking:
get_symbol_documentationno longer accepts anhrefparameter. It now acceptssymbol(required) and optionalversion. Agents pass a human-readable name ("Client","Client.send", or a fullqualifiedNamelike"http.Client") and the server resolves it internally — eliminating the mandatorybrowse_api_symbols → get_symbol_documentationtwo-step for agents that already know the symbol name. DomainErrorgains an optionalalternativesfield, included inambiguous_symbolerror payloads.- Tool
search_api_symbolsrenamed tobrowse_api_symbolsto better reflect its role as a discovery aid for when the symbol name is unknown. - Server instructions updated to reflect the direct-symbol workflow.
Fixed #
get_symbol_documentationnow correctly resolves a fullqualifiedNameinput (e.g."http.Client") via an exact-match pass. Previously, retrying anambiguous_symbolerror with a value from thealternativesarray always producedsymbol_not_found.get_symbol_documentationcache keys now include the effective version. Previously, a cached response for one version could silently be served for a different version, and a cached error from one version could block valid lookups in another.
0.3.0 - 2026-05-22 #
Added #
pub://meta/resources— new static resource that returns a JSON array of every available resource and resource template, each with its URI, MIME type, and description. Read it first to discover what the server exposes without enumerating resources manually.- Server instructions now list all six resource URIs and guide agents to read
pub://meta/resourcesbefore making resource calls.
Added (test) #
- Integration test suite in
test/integration/covering all five tools, four resources, and three lifecycle scenarios (49 tests total). Taggedintegrationindart_test.yaml; excluded from the defaultdart testrun viapaths: [test/unit]. Run withdart test test/integration/.
Changed #
- All tool, resource, resource template, and prompt descriptions rewritten as direct agent instructions. Each description states when to call it, what to do with the result, which tool to call next, and which patterns to avoid.
search_api_symbolsnow explicitly warns against multi-term queries. PubDevClientcaps concurrent HTTP requests at 5 by default, preventing429 Too Many Requestserrors when an agent issues several tool calls in parallel.
Fixed #
search_api_symbolsnow reports correct symbol kinds. Thekindinteger fromindex.jsonwas mapped to the wrong ordinal positions, causing enums to appear astypedef, mixins asconstant, and some typedefs to fall through to a raw integer string.- Package README and section extraction now uses DOM queries instead of regex. The previous approach returned content from the matched element to the end of the document and silently failed on elements with extra CSS classes, single-quoted attributes, or out-of-order class tokens.
0.2.0 - 2026-05-21 #
Added #
get_packagetool — full metadata for a named package: scores, SDK constraints, dependencies, recent versions, and README excerpt; supports optional version pinningget_changelogtool — parsed changelog as a newest-first list of entries withbreakingflags; supportsfrom_versionlower bound andversion_limitcapcompare_packagestool — side-by-sideComparisonMatrixfor 2–5 packages; partial failures are reported per package without blocking the remaining columnsget_symbol_documentationtool — full dartdoc page for a specific API symbol as plain textlist_package_source_filestool — file paths in a package tarball with optionaldirectoryandfileExtensionfilters; shares the 1-hour cache entry withget_package_source_fileget_package_source_filetool — raw content of a single source file from the pub.dev package tarball; resolves version automatically when omitted; returns closest-filename suggestions onsource_file_not_foundadd-and-setup-packageprompt — guides the LLM through reading a package README, explaining its purpose, writing boilerplate initialisation code, and listing native platform setup stepsanalyze-upgrade-impactprompt — guides the LLM through retrieving changelog entries, identifying breaking changes between two versions, and rewriting affected source codeevaluate-alternativesprompt — guides the LLM through searching for packages matching a use case, comparing the top results, and producing a recommendation with a markdown comparison matrixpub://meta/scoringresource — plain-text explanation of pub.dev's 160-point scoring system; embedded at compile timepub://meta/sdk-versionsresource — current stable Dart and Flutter SDK versions as a{ dart, flutter }JSON objectpub://package/{name}/readmeresource template — full package README astext/markdownpub://package/{name}/exampleresource template — package example code astext/markdownpub://package/{name}/apiresource template — dartdoc symbol index asapplication/jsonpub://package/{name}/changelogresource template — full changelog astext/markdown
0.1.0 - 2026-05-11 #
Added #
search_packagestool — search pub.dev by keyword with optional SDK, platform, and sort filters- In-memory TTL response cache with per-entry expiry (5-minute TTL for search results)
- CLI configuration via
--log-leveland--cache-dirflags with env var fallback - Stdio transport over stdin/stdout (via
dart_mcp ^0.5.1)