How akvus/ai works
Project type and purpose
• This is a monorepo for two related Dart packages under an AI/GenAI theme.
• dart_mcp: a core library to define and run “MCP” (Model‑Client‑Protocol) servers & clients.
• dart_tooling_mcp_server: an MCP‑based server exposing Dart tooling (analyzer, format, fixes, docs) to AI models.
File structure
• Top‑level:
• .github/workflows → CI/CD for tests, publishing, health checks.
• pkgs/dart_mcp → library package with lib/, example/, test/ subfolders.
• pkgs/dart_tooling_mcp_server → executable package (bin/main.dart), lib/, test/, fixtures/.
• Patterns:
• Monorepo containing reusable library + specialized server.
• dart_mcp subdivides into API definitions, client implementation, server implementation.
• dart_tooling_mcp_server composes dart_mcp’s server, adds mixins for real tools.
• Config files:
• pubspec.yaml in each package.
• analysis_options.yaml (static analysis rules).
• GitHub Actions YAMLs (CI, publish).
README
• Confirms two packages, brief descriptions.
Main components & interactions
A. Monorepo root
– Houses CI/CD (GitHub Actions), versioning, labels, dependency updates.
B. dart_mcp package
– API module (initialization, completions, prompts, logging, resources, roots, sampling, tools).
– Client module (builds & sends MCP requests).
– Server module (implements handlers for each API category).
C. dart_tooling_mcp_server package
– CLI entrypoint (bin/main.dart) that starts an MCP server.
– Composes dart_mcp’s server module.
– Mixins layer integrating:
• Analyzer (static code analysis engine)
• Dart CLI (format, fix, pub commands)
• DTD (doc tool)
– Test harness & fixtures (sample Flutter & CLI apps).
D. External systems & tools
– Dart Analyzer engine
– Dart CLI (dart format, dart fix, pub get)
– DTD (documentation generation)
– Pub.dev (package registry) and GitHub (source, issues, actions)
Architectural patterns & principles
• Modular library / plugin pattern: dart_mcp defines abstract API & pluggable server hooks.
• Separation of concerns: clear client vs. server responsibilities.
• Composition over inheritance: dart_tooling_mcp_server uses mixins to “plug in” real tool behaviors.
• Monorepo CI orchestration: single pipeline running tests & publishes for each package.