Skip to main content

mcp_ingest 0.2.0 copy "mcp_ingest: ^0.2.0" to clipboard
mcp_ingest: ^0.2.0 copied to clipboard

Convert any file format to standardized document structure for the MCP knowledge system.

example/example.dart

// Text in, a normalized document with chunks and fragments out.

import 'package:mcp_ingest/mcp_ingest.dart';

Future<void> main() async {
  final pipeline = IngestPipeline.defaults();

  final result = await pipeline.ingest(
    IngestInput.fromString(
      '{"total": 12, "vendor": "Kiwi Cafe"}',
      filename: 'receipt.json',
      mimeType: 'application/json',
    ),
    IngestOptions.defaults.copyWith(
      workspaceId: 'demo',
      extractFragments: true,
      fragmentRules: const [
        FragmentRule(
          id: 'total',
          field: 'total',
          pattern: 'total',
          patternType: FragmentPatternType.keyword,
          valueType: FragmentValueType.currency,
        ),
      ],
    ),
  );

  if (result.error != null) {
    print('ingestion failed: ${result.error}');
    return;
  }
  print(
      '${result.chunks.length} chunk(s), ${result.fragments.length} fragment(s)');
  print(
      'evidence ${result.evidence!.evidenceId} in ${result.evidence!.workspaceId}');
}
0
likes
140
points
130
downloads

Documentation

API reference

Publisher

verified publishermakemind.dev

Weekly Downloads

Convert any file format to standardized document structure for the MCP knowledge system.

Homepage
Repository (GitHub)
View/report issues

Topics

#ingest #mcp #document #parsing #normalization

License

MIT (license)

Dependencies

archive, async, crypto, html, markdown, mcp_bundle, mcp_fact_graph, path, pool, stream_transform, uuid, xml, yaml

More

Packages that depend on mcp_ingest