Skip to main content

flutter_a2ui_mcp 1.0.0 copy "flutter_a2ui_mcp: ^1.0.0" to clipboard
flutter_a2ui_mcp: ^1.0.0 copied to clipboard

Dynamic Agent-to-User Interface (A2UI) widget for Flutter. Connect to LLMs, execute MCP tools, and render dynamic interactive generative A2UI widgets.

flutter_a2ui_mcp #

An interactive, dynamic A2UI & Agentic MCP Widget for Flutter.

flutter_a2ui_mcp brings together Google's A2UI (Agent-to-User Interface, successor to GenUI), the Model Context Protocol (MCP), and native Dart tools. It enables LLMs to emit structured UI components and render rich, interactive Flutter widgets directly in the conversation flow, while retaining full agentic tool-calling capabilities and live state inspection.


✨ Features #

  • Dynamic A2UI Surface Rendering – Render model-generated interactive forms, cards, tables, and custom widgets directly inline in the chat transcript.
  • Pluggable A2UI Catalog – Define custom components using JSON schemas (A2uiCatalogItemDefinition) or Dart builders with basicCatalog() and ComponentImplementation.
  • Multi-LLM Support – OpenAI, Anthropic Claude, Google Gemini, Ollama (local), Mistral AI, and custom OpenAI-compatible endpoints.
  • Embedded On-Device LLMs – Run GGUF models locally with llamadart without network dependencies.
  • MCP & Local Tool Calling – Connect remote HTTP/SSE MCP servers, local subprocess servers, and Dart-native tools.
  • App Embedding Support & Visibility Controls – Fully customizable header controls (showAppBar, showStatusBadges, showSkillsControls, showAssistantStatistics, showMemoryArchive, showToolsCatalog, showWorkflowActions) for embedding directly into host applications.
  • Interactive Agent Inspector & Top-Bar Toggle – Side-by-side live inspection of system prompts, tool calls, JSON payloads, and execution traces.
  • Cross-Platform – Android, iOS, macOS, Windows, Linux, and Web.

🚀 Installation #

Add to your pubspec.yaml:

dependencies:
  flutter_a2ui_mcp: ^1.0.0
  a2ui_flutter: ^0.3.0
  a2ui_core: ^0.7.0

Then import:

import 'package:flutter_a2ui_mcp/flutter_a2ui_mcp.dart';

💡 Quick Start #

import 'package:flutter/material.dart';
import 'package:flutter_a2ui_mcp/flutter_a2ui_mcp.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: A2uiMcpPlayground(
          initialLlmConfig: LlmConfig(
            provider: LlmProvider.gemini,
            model: 'gemini-2.5-flash',
            apiKey: 'YOUR_GEMINI_API_KEY',
          ),
        ),
      ),
    );
  }
}

🧩 Adding Custom Catalog Components #

You can provide custom components to the A2UI catalog via a2uiCatalogItems:

A2uiMcpPlayground(
  a2uiCatalogItems: [
    A2uiCatalogItemDefinition(
      name: 'CounterCard',
      description: 'A custom counter card widget',
      schema: S.object(
        properties: {
          'title': S.string(description: 'Card title'),
          'initialCount': S.integer(description: 'Starting count'),
        },
        required: ['title'],
      ),
      builder: (context, data) {
        final title = data['title'] as String? ?? 'Counter';
        return Card(
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
          ),
        );
      },
    ),
  ],
)

🔄 Migrating from flutter_genui_mcp #

flutter_a2ui_mcp is the official successor to flutter_genui_mcp. For seamless migration:

  • Replace flutter_genui_mcp dependency with flutter_a2ui_mcp.
  • Replace import 'package:flutter_genui_mcp/flutter_genui_mcp.dart'; with import 'package:flutter_a2ui_mcp/flutter_a2ui_mcp.dart';.
  • FlutterGenUiMcp and GenuiMcpPlayground remain supported as backward-compatible typedefs pointing to A2uiMcpPlayground.
  • Rename genuiCatalogItems parameter to a2uiCatalogItems.
0
likes
0
points
377
downloads

Publisher

verified publishertealkit.dev

Weekly Downloads

Dynamic Agent-to-User Interface (A2UI) widget for Flutter. Connect to LLMs, execute MCP tools, and render dynamic interactive generative A2UI widgets.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

a2ui_agent, a2ui_core, a2ui_flutter, dart_mcp_core, file_picker, flutter, flutter_markdown_plus, flutter_ui_mcp_core, json_schema_builder, material_ui, shared_preferences, uuid

More

Packages that depend on flutter_a2ui_mcp