Skip to main content

dart_context_mcp 0.10.1 copy "dart_context_mcp: ^0.10.1" to clipboard
dart_context_mcp: ^0.10.1 copied to clipboard

Local Dart/Flutter code context CLI and MCP server for AI agents: symbol lookup, impact analysis, and a dependency graph, without reading every file.

example/dart_context_mcp_example.dart

// ignore_for_file: avoid_print
import 'package:dart_context_mcp/dart_context_mcp.dart';

/// Indexes a Dart/Flutter project and prints a compact overview - the same
/// data the `overview` CLI command and `dart_overview` MCP tool return.
///
/// Run with: `dart run example/dart_context_mcp_example.dart <project_root>`
/// (defaults to the current directory if no argument is given).
void main(List<String> arguments) {
  final root = arguments.isNotEmpty ? arguments.first : '.';
  final index = CodeIndex.loadOrBuild(root);
  print(buildOverviewReport(index).text);

  // The same index also answers targeted questions without re-parsing:
  final settingsMatches = index.findSymbols('main');
  if (settingsMatches.isNotEmpty) {
    print('\n---');
    print(buildContextReport(index, 'main', limit: 5).text);
  }
}
2
likes
160
points
216
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Local Dart/Flutter code context CLI and MCP server for AI agents: symbol lookup, impact analysis, and a dependency graph, without reading every file.

Repository (GitHub)
View/report issues

Topics

#dart #flutter #mcp #ai #agent

License

MIT (license)

Dependencies

analyzer, args, path

More

Packages that depend on dart_context_mcp