<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Laszlo Schäffer</title>
    <description>The latest articles on DEV Community by Laszlo Schäffer (@laszlo_schffer_0f42fb9aa).</description>
    <link>https://dev.to/laszlo_schffer_0f42fb9aa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2436097%2Fa3a679d6-5acd-41cc-848c-955930927d6d.jpg</url>
      <title>DEV Community: Laszlo Schäffer</title>
      <link>https://dev.to/laszlo_schffer_0f42fb9aa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laszlo_schffer_0f42fb9aa"/>
    <language>en</language>
    <item>
      <title>Orchestrating a 5-Package Dart &amp; Flutter AI Agent Suite (MCP, A2UI 1.0 Express, On-Device LLMs) with Coding Agents</title>
      <dc:creator>Laszlo Schäffer</dc:creator>
      <pubDate>Thu, 26 Nov 2026 21:15:48 +0000</pubDate>
      <link>https://dev.to/laszlo_schffer_0f42fb9aa/orchestrating-a-5-package-dart-flutter-ai-agent-suite-mcp-a2ui-10-express-on-device-llms-mjp</link>
      <guid>https://dev.to/laszlo_schffer_0f42fb9aa/orchestrating-a-5-package-dart-flutter-ai-agent-suite-mcp-a2ui-10-express-on-device-llms-mjp</guid>
      <description>&lt;p&gt;I want to share my open-source &lt;strong&gt;Flutter MCP Suite&lt;/strong&gt; — a set of 5 Dart and Flutter packages for building AI agents with Model Context Protocol (MCP), generative UI (A2UI), and local on-device models.&lt;/p&gt;

&lt;p&gt;To be honest, I did not write all this code by hand. I designed the structure, guided the work, and maintain the packages using AI coding agents — mainly &lt;strong&gt;Antigravity&lt;/strong&gt;, and now also my own open-source tool &lt;strong&gt;TealKit Coder&lt;/strong&gt;, which is built on top of &lt;code&gt;dart_mcp_core&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Using the packages every day inside a real coding agent helped find many real bugs quickly — like context compression loops, local model template errors, and Android file-saving issues — so we could fix them and add tests right away.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Pure Dart Core (&lt;code&gt;dart_mcp_core&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;The base package is &lt;a href="https://pub.dev/packages/dart_mcp_core" rel="noopener noreferrer"&gt;&lt;code&gt;dart_mcp_core&lt;/code&gt;&lt;/a&gt;. It is pure Dart with no Flutter dependencies (160/160 pub.dev points, 99+ unit tests).&lt;/p&gt;

&lt;p&gt;Because it does not depend on Flutter, the same agent engine works everywhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pure Dart CLI tools and backend apps (like TealKit Coder)&lt;/li&gt;
&lt;li&gt;Flutter Desktop (Windows, macOS, Linux) with local &lt;code&gt;stdio&lt;/code&gt; MCP servers (&lt;code&gt;npx&lt;/code&gt;, &lt;code&gt;uvx&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Flutter Mobile (Android, iOS) and Web with remote HTTP/SSE MCP servers and local Dart tools&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Main Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;7 LLM Providers with one API&lt;/strong&gt;: OpenAI, Anthropic Claude, Google Gemini, Ollama, Mistral, OpenAI-compatible servers (like DeepInfra or vLLM), and local on-device models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Context Compression&lt;/strong&gt;: When a long chat or tool session gets too big, &lt;code&gt;ContextCompressor&lt;/code&gt; summarizes older messages and saves them in &lt;code&gt;EpisodicMemoryStore&lt;/code&gt;. The model can still look up old details with the &lt;code&gt;retrieve_memory&lt;/code&gt; tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On-Demand Tool Discovery&lt;/strong&gt;: Instead of sending all tool definitions on every message, &lt;code&gt;McpListToolsTool&lt;/code&gt; and &lt;code&gt;McpCallToolTool&lt;/code&gt; let the model search and call tools only when needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safety &amp;amp; Approvals&lt;/strong&gt;: &lt;code&gt;ToolLoopGuard&lt;/code&gt; stops repeated tool loops, and &lt;code&gt;AgentHook&lt;/code&gt; lets you ask the user before running a tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image Generation Tool&lt;/strong&gt;: Built-in &lt;code&gt;GenerateImageTool&lt;/code&gt; supporting OpenAI, Gemini, DeepInfra (FLUX), or a custom handler.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Dynamic Flutter UI with &lt;code&gt;flutter_a2ui_mcp&lt;/code&gt; and A2UI 1.0 Express
&lt;/h2&gt;

&lt;p&gt;With &lt;a href="https://pub.dev/packages/flutter_a2ui_mcp" rel="noopener noreferrer"&gt;&lt;code&gt;flutter_a2ui_mcp&lt;/code&gt;&lt;/a&gt; (using &lt;code&gt;a2ui_flutter ^0.5.0&lt;/code&gt; and &lt;code&gt;a2ui_core ^0.9.0&lt;/code&gt;), the AI can show interactive Flutter widgets directly inside the chat instead of only plain text.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;v1.2.1&lt;/code&gt;, it uses &lt;strong&gt;A2UI 1.0 Express&lt;/strong&gt; by default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;a2ui&amp;gt;
surface("weather_vienna")
root = WeatherCard(city="Vienna", temp=18)
&amp;lt;/a2ui&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Express uses about half as many tokens as raw JSON, checks the output against your widget catalog, and still falls back to normal JSON if a smaller model outputs JSON instead.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Offline Local Models with &lt;code&gt;flutter_ui_mcp_embedded&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;If you want to run models offline on Android, iOS, or Desktop, &lt;a href="https://pub.dev/packages/flutter_ui_mcp_embedded" rel="noopener noreferrer"&gt;&lt;code&gt;flutter_ui_mcp_embedded&lt;/code&gt;&lt;/a&gt; connects &lt;code&gt;llamadart&lt;/code&gt; (&lt;code&gt;^0.21.0&lt;/code&gt;) to &lt;code&gt;dart_mcp_core&lt;/code&gt;. It supports both &lt;strong&gt;GGUF (&lt;code&gt;llama.cpp&lt;/code&gt;)&lt;/strong&gt; and &lt;strong&gt;LiteRT-LM (&lt;code&gt;.litertlm&lt;/code&gt;)&lt;/strong&gt; models, and includes a HuggingFace model search dialog.&lt;/p&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub (with 20+ Flutter &amp;amp; A2UI examples + CI):&lt;/strong&gt; &lt;a href="https://github.com/lschaffer/flutter_mcp_suite" rel="noopener noreferrer"&gt;https://github.com/lschaffer/flutter_mcp_suite&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pure Dart core:&lt;/strong&gt; &lt;a href="https://pub.dev/packages/dart_mcp_core" rel="noopener noreferrer"&gt;https://pub.dev/packages/dart_mcp_core&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flutter chat UI:&lt;/strong&gt; &lt;a href="https://pub.dev/packages/flutter_ui_mcp" rel="noopener noreferrer"&gt;https://pub.dev/packages/flutter_ui_mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A2UI generative UI:&lt;/strong&gt; &lt;a href="https://pub.dev/packages/flutter_a2ui_mcp" rel="noopener noreferrer"&gt;https://pub.dev/packages/flutter_a2ui_mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On-device LLM plugin:&lt;/strong&gt; &lt;a href="https://pub.dev/packages/flutter_ui_mcp_embedded" rel="noopener noreferrer"&gt;https://pub.dev/packages/flutter_ui_mcp_embedded&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you try it out or have any feedback, feel free to leave a comment or open an issue on GitHub!&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>ai</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
