mbilalbenli/pub-dev-mcp
If you are the rightful owner of pub-dev-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Pub.dev Package Intelligence MCP is a server that interfaces with the official pub.dev APIs, enabling users to explore Dart and Flutter packages directly within their chat environment.
Pub.dev Package Intelligence MCP
A Model Context Protocol (MCP) server that wraps the official pub.dev APIs so assistants can discover Dart and Flutter packages, inspect versions, validate compatibility, explore dependency trees, and review score insights without leaving their chat environment.
Highlights
- Eight MCP tools (
search_packages,latest_version,check_compatibility,list_versions,package_details,publisher_packages,score_insights,dependency_inspector). - NativeAOT-ready .NET 9 implementation with Clean Architecture slices.
- Resilient HTTP client with retries, circuit breaking, and caching.
- Structured logging with Serilog and full OpenTelemetry traces/metrics.
- Dual transports: stdio for local assistants and HTTP+JSON-RPC for remote deployment.
Prerequisites
- .NET 9 SDK (9.0.0-preview or newer with C# 13)
- PowerShell 7+ or Windows PowerShell 5.1 for helper scripts
- Access to the pub.dev REST API over HTTPS
- For NativeAOT publish on Windows: Visual Studio Build Tools with the C++ Desktop Development workload and Windows 11 SDK installed
Refer to for expanded setup details and troubleshooting tips.
Getting Started
Clone & Restore
# From the directory where you keep repos
git clone https://github.com/mbilalbenli/pub-dev-mcp.git
cd pub-dev-mcp
dotnet restore PubDevMcp.sln
Run via stdio (default)
dotnet run --project src/PubDevMcp.Server/PubDevMcp.Server.csproj -- --stdio
Run via HTTP
$env:ASPNETCORE_URLS="http://localhost:5111";
dotnet run --project src/PubDevMcp.Server/PubDevMcp.Server.csproj -- --http
The HTTP transport exposes:
POST /rpcfor JSON-RPC requestsGET /health/liveandGET /health/readyfor health probes
NativeAOT Publish (Self-Contained)
dotnet publish src/PubDevMcp.Server/PubDevMcp.Server.csproj `
-c Release `
-r win-x64 `
/p:PublishAot=true /p:SelfContained=true /p:PublishTrimmed=true /p:InvariantGlobalization=true `
--no-restore
Note: Cross-OS NativeAOT publishing isnt supported. Always publish on the same OS you target.
The publish output lives under src/PubDevMcp.Server/bin/Release/net9.0/<RID>/publish/. Copy the contents to your deployment target.
Testing
# Contract and schema checks
dotnet test tests/contract/PubDevMcp.Tests.Contract.csproj --configuration Release
# Integration coverage
dotnet test tests/integration/PubDevMcp.Tests.Integration.csproj --configuration Release
# Compliance harness
dotnet test tests/compliance/PubDevMcp.Tests.Compliance.csproj --configuration Release
Benchmark profiles for NFR validation live in tests/performance/ and can be executed with:
cd tests/performance
dotnet run --configuration Release
Registry Submission Snapshot
- Transports: stdio, http
- License: MIT (add
LICENSEfile before publishing) - Maintainer Contact: GitHub Issues
- Upstream Docs:
Prior to submission:
- Promote this code to a public repository with a stable
mainbranch. - Tag a release (e.g.,
v1.0.0) built with NativeAOT binaries. - Attach Release build/test logs and the quickstart link to the release notes.
- Complete the GitHub MCP registry metadata form (see
specs/001-build-an-mcp/registry-metadata.yaml).
Architectural Overview
src/
PubDevMcp.Domain // Immutable domain models
PubDevMcp.Application // MediatR handlers + validation
PubDevMcp.Infrastructure// HTTP client, caching, logging, telemetry
PubDevMcp.Server // JsonRpc pipeline, transports, DI wiring
tests/
contract/ // OpenAPI + tool contract verification
compliance/ // JSON-RPC compliance tests
integration/ // Transport + observability integration tests
performance/ // BenchmarkDotNet suite (p95 <= 7s guardrail)
Support & Feedback
Questions or issues? Please open a GitHub issue at https://github.com/mbilalbenli/pub-dev-mcp/issues. Contributions are welcome via pull requests.