Standalone TypeScript workspace for building and serving pinned Riverpod documentation snapshots, MCP read tools, and deterministic audit helpers for Flutter repos.
- public GitHub repo with a pinned Riverpod
3.2.1fixture snapshot - deterministic MCP server and audit CLI
- standalone local/stdin usage is supported today from a local checkout or package artifact
- remote hosting is not implemented yet; Cloudflare would need an HTTP transport adapter
- docs-only MCP is the secure default; local audit tools are opt-in
Generic documentation tools (Context7, raw upstream docs, ChatGPT training data) can tell you the correct Riverpod 3.0 migration patterns, codegen syntax, and ConsumerWidget usage. They answer "how does Riverpod work?" But they cannot answer "how does Riverpod work in MY project?" - and that is the question that matters when you are refactoring, auditing, or scorching code.
During a production onboarding/paywall rewrite of a Flutter app (Clueless
Clothing), we needed to delete quiz_view_model.dart and rebuild from scratch.
Context7 correctly told us the Riverpod 3.0 codegen patterns to use. But it
could not tell us that:
onboardingServiceProviderwas defined INSIDEquiz_view_model.dart(not in its own file)- That provider had 4 external consumers across 3 features (dashboard, auth, app loading gate)
- Deleting the file would silently kill the provider and break the app at runtime (not at compile time, since other files imported it transitively)
- The provider used
@Riverpod(keepAlive: true)because it cached auth tokens that survived widget disposal
We had to manually grep the entire codebase to discover this. A project-aware tool would surface it immediately.
| Capability | Generic docs (Context7, etc.) | riverpod-knowledge-graph |
|---|---|---|
| Riverpod API syntax and patterns | Yes | Yes (pinned snapshot) |
| Migration guides (StateNotifier to Notifier) | Yes | Yes |
| Provider dependency graph for YOUR project | No | Yes (audit_repo) |
| Cross-feature consumption map | No | Yes (which providers are read/watched outside their feature) |
| Stale pattern detection | No | Yes (finds legacy StateNotifier, missing codegen, etc.) |
| keepAlive vs autoDispose audit | No | Yes (flags mismatches between provider lifecycle and usage) |
| Code generation health check | No | Yes (detects stale .g.dart files) |
| Migration blast radius analysis | No | Yes ("if I delete this, what breaks?") |
| Custom local rules per project | No | Yes (overlay contract) |
Generic docs tools answer "how does Riverpod work?" This tool answers "how does Riverpod work in your project?" - and those are different questions.
- a normalized Riverpod corpus rooted in upstream docs snapshots
- read/query MCP tools for snapshots, topics, docs, and guidance lookups
- audit helpers for repo overlays and Riverpod authoring checks
- a pinned fixture snapshot for Riverpod
3.2.1
riverpod-3.2.1-fixture
list_snapshotslist_topicsget_docsearch_docsget_guidance_for_patternaudit_repoexplain_findingcompare_local_policy
npm install
npm run buildInspect the package CLI:
npm exec -- riverpod-knowledge-graph helpPrint the Codex MCP config block for this checkout:
npm exec -- riverpod-knowledge-graph bootstrap-codexRun the MCP server:
npm exec -- riverpod-knowledge-graph mcpRun the MCP server with local audit tools enabled:
npm exec -- riverpod-knowledge-graph mcp-auditRun the standalone audit CLI against a consuming Flutter repo.
You can start from examples/clueless-flutter-overlay.json:
npm exec -- riverpod-knowledge-graph audit-repo \
--repo-root /path/to/flutter/repo \
--overlay /path/to/RIVERPOD_OVERLAY.json \
--snapshot riverpod-3.2.1-fixtureBuild a snapshot:
npm run build:snapshot -- \
--docs-root /path/to/website/docs \
--sidebar /path/to/website/sidebars.js \
--snapshot riverpod-3.2.1-fixture \
--ref <git-ref> \
--repo-url https://github.com/rrousselGit/riverpod \
--out-dir ./corpus/snapshotsMaintainer checks:
npm run checkProvision a Mac mini or other local workstation from a checkout:
npm run provision:mac-miniSupported today:
- local checkout on a workstation or Mac mini
- packaged artifact usage through the compiled
dist/entrypoint - stdio MCP wiring from Codex, Claude Code, or any local MCP client
- docs-only MCP as the secure default surface
Not supported yet:
- direct remote MCP hosting on Cloudflare Workers
- HTTP/SSE or streamable MCP transport
The current server is stdio-only. A Cloudflare deployment would need a transport adapter, authentication, and a decision on how snapshots are bundled and updated remotely.
The best supported path today is local-first:
- run this package from a Mac mini or workstation
- wire Codex to the local stdio MCP with
bootstrap-codex - treat Cloudflare or other remote hosting as a separate future rollout
That keeps the trust boundary honest. Codex bootstrap is concrete and testable today; remote hosting still needs transport, auth, and request-isolation work.
mcpexposes the docs/read surface onlymcp-auditenables local repo and overlay inspection tools- public MCP read tools no longer accept caller-controlled corpus-root overrides
- do not expose
mcp-auditin shared or remote environments without additional auth
See SECURITY.md for the trust boundary and residual risks.
Docs-only default:
[mcp_servers.riverpod_knowledge_graph]
command = "node"
args = [
"/absolute/path/to/riverpod-knowledge-graph/bin/riverpod-knowledge-graph.mjs",
"mcp",
]A ready-to-edit template lives at examples/codex-config.toml.
Or install the docs-only block directly into your local Codex config:
npm exec -- riverpod-knowledge-graph bootstrap-codex --write --backupAudit-enabled local setup:
[mcp_servers.riverpod_knowledge_graph]
command = "node"
args = [
"/absolute/path/to/riverpod-knowledge-graph/bin/riverpod-knowledge-graph.mjs",
"mcp-audit",
]An audit-enabled template lives at examples/codex-config-audit.toml.
Install the audit-enabled block into your local Codex config:
npm exec -- riverpod-knowledge-graph bootstrap-codex \
--mode audit \
--write \
--backupThe repo ships an idempotent setup script for trusted local machines:
RKG_BOOTSTRAP_MODE=docs npm run provision:mac-miniSet RKG_BOOTSTRAP_MODE=audit only when the machine should have local repo audit
access. You can override the target config path with CODEX_CONFIG_PATH.
The script:
- verifies
nodeandnpm - enforces Node
20+ - reuses an existing
node_modules, or uses the pinnedpnpm-lock.yamlthroughcorepackon fresh installs - falls back to
npm install --package-lock=falseonly when no lockfile-managed path exists - builds the compiled package
- runs
npm run check - writes or updates the Codex MCP block with a backup
- published artifacts and
npm packinclude the compileddist/entrypoint - source checkouts still fall back to
tsxwhendist/has not been built yet - a fresh machine sanity check is
npm run check - agents should start from
AGENTS.mdplus the example configs, not from ad hoc flags - the best bootstrap surface for agents today is
bootstrap-codex, not hand-edited TOML
Consuming repos provide a thin overlay that pins one snapshot and lists their
local rules. A concrete example lives at examples/clueless-flutter-overlay.json.
{
"repo": "my-org/my-flutter-repo",
"pinnedSnapshotId": "riverpod-3.2.1-fixture",
"localRules": [
{
"id": "keep_alive_for_async_mutations",
"description": "Async mutating notifiers should opt into keepAlive.",
"severity": "warning"
}
]
}