Skip to main content

mcp_bundle 0.4.14 copy "mcp_bundle: ^0.4.14" to clipboard
mcp_bundle: ^0.4.14 copied to clipboard

Bundle schema, loader, validator, expression language, and port contracts providing the foundation for the MCP ecosystem.

example/example.dart

// A bundle built from JSON, validated, and written back out. The example
// prints what it found.
// ignore_for_file: avoid_print

import 'package:mcp_bundle/mcp_bundle.dart';

void main() {
  final bundle = McpBundle.fromJson({
    'manifest': {'id': 'com.example.shop', 'name': 'Shop', 'version': '1.0.0'},
    'organization': {
      'workspaces': [
        {
          'id': 'sales',
          'kind': 'org',
          'title': 'Sales',
          'leadMemberId': 'kim',
          'memberIds': ['kim'],
        },
      ],
      'members': [
        {
          'kind': 'person',
          'id': 'kim',
          'displayName': 'Kim',
          'accounts': [
            {'source': 'hub', 'uid': 'u_8f3a'},
          ],
        },
      ],
    },
  });

  final result = McpBundleValidator.validate(bundle);
  print('valid: ${result.isValid}');
  for (final e in result.errors) {
    print('error ${e.code} at ${e.location}: ${e.message}');
  }

  final kim = bundle.organization!.findMember('kim')!;
  print('${kim.displayName} signs in with '
      '${kim.accounts.map((a) => '${a.source}:${a.uid}').join(', ')}');

  // JSON out is the same shape JSON in.
  print(bundle.toJson()['organization']);
}
1
likes
130
points
1.44k
downloads

Documentation

API reference

Publisher

verified publishermakemind.dev

Weekly Downloads

Bundle schema, loader, validator, expression language, and port contracts providing the foundation for the MCP ecosystem.

Homepage
Repository (GitHub)
View/report issues

Topics

#bundle #mcp #ai #dart #ports

License

MIT (license)

Dependencies

archive, collection, crypto, http, json_annotation, meta

More

Packages that depend on mcp_bundle