Documentation & context fetcher for Dart & Flutter packages
Agent-agnostic. Pub.dev integrated. Zero-cloning required.
Installation • Tools • Architecture • Client Setup • Testing
Your AI coding agent knows the language. dart_docs_mcp gives it the library knowledge it's missing.
A Dart-based MCP server that fetches metadata, READMEs, examples, and API surfaces directly from pub.dev and GitHub. Works with any agent that supports MCP — Gemini CLI, Antigravity, Claude Code, Cursor, or anything else.
- 📦 Metadata & Docs: Fetches READMEs and
example/directories for instant library onboarding. - 🔍 API Surface Exploration: Provides a concise "virtual header" of public classes and methods.
- ⚡ Source Grepping: Search internal
lib/files using regex without cloning the repository. - 📈 Changelog Intelligence: Extracts targeted version ranges to assist with migrations and breaking changes.
- 🌳 Type Hierarchy: Reconstructs inheritance trees for complex class structures.
brew tap alfredobs97/tap
brew install dart-docs-mcpdart run bin/server.dart# Production AOT build
docker build --target runtime -t dart-docs-mcp:latest .
docker run -i dart-docs-mcp:latest| Tool | Capability |
|---|---|
get_package_docs |
Fetch README + example/ for usage context. |
get_api_surface |
Get a "virtual header" of all public APIs from index.json. |
search_package_code |
Grep internal source code via keyword/regex (capped at 15 matches). |
get_changelog |
Targeted version diffs between specific releases. |
get_type_hierarchy |
Map class inheritance and implementations (e.g., sealed classes). |
cross_reference |
Map README features to specific implementation files. |
This server is built using the Model Context Protocol (MCP), an open standard that enables AI models to interact with local and remote tools.
- Request: An MCP client sends a JSON-RPC request over
stdio. - Orchestration: The server routes requests to specific tool implementations in
lib/mcp/tools/. - Execution: Services fetch data from pub.dev API, Dartdoc assets, and GitHub fallbacks.
- Response: Context is formatted and injected back into the LLM's conversation.
gemini mcp add local stdio dart_docs_mcp --command dart-docs-mcpAdd this to your MCP configuration JSON:
{
"mcpServers": {
"dart_docs_mcp": {
"command": "dart-docs-mcp",
"args": []
}
}
}claude mcp add dart_docs_mcp -- dart-docs-mcpUse the mcp_dart_cli inspector to call tools manually:
# Install the CLI
dart pub global activate mcp_dart_cli
# Test a tool query
mcp_dart inspect --tool get_package_docs --json-args '{"package_name": "http"}'dart test