flutter_ui_mcp 1.0.2 copy "flutter_ui_mcp: ^1.0.2" to clipboard
flutter_ui_mcp: ^1.0.2 copied to clipboard

Interactive AI Agent widget for Flutter. Connect to any LLM provider, register Dart-native tools, remote HTTP MCP servers, and local Node.js or Python subprocesses.

flutter_ui_mcp #

An interactive AI Agent chat and execution widget for Flutter — connect to any LLM provider, register local Dart-native tools and remote HTTP MCP servers, and run agentic workflows in a conversational UI.

Tip

A full working multiplatform app Tealkit based on the features of this suite is available in Play Store, App Store, and Windows Store. See github.com/lschaffer/tealkit.


✨ Features #

  • Multi-LLM support – OpenAI, Anthropic Claude, Google Gemini, Ollama (local), Mistral AI, and any OpenAI-compatible endpoint.
  • Embedded on-device models – Run local GGUF models via llamadart without external network dependencies.
  • HTTP MCP Server registry – Browse PulseMCP and Smithery catalogs or add custom remote MCP servers.
  • Local MCP subprocesses – Install, configure, and launch local stdio MCP servers (Node.js, Python) directly within the application (supported in desktop mode).
  • Dart-native local tools – Extend with custom Dart-native tools (e.g., Weather, SSH, Chart-generation tools; see the example implementation).
  • Agentic tool loop – Automatic iterative tool calling with duplicate-call detection, iteration limits, and safety guards.
  • Save/Load configurations – Persist LLM settings, tool selections, system prompts, and server lists via SharedPreferences or a custom McpPlaygroundStorageDelegate.
  • Agent Inspector – Side-by-side conversation + internal state inspector for debugging agent behavior (can be toggled or disabled via showAgentInspector).
  • Cross-platform – Works on Android, iOS, Web, macOS, Windows, and Linux.

Note

For dynamic generative UI rendering via Google's GenUI (A2UI) protocol, see the dedicated flutter_genui_mcp package.


🎥 Demo #

Watch the AI Agent widget in action using an embedded model to call local dart tools:

Flutter UI MCP Demo


🚀 Installation #

Add to your pubspec.yaml:

dependencies:
  flutter_ui_mcp: ^1.0.2

Then import:

import 'package:flutter_ui_mcp/flutter_ui_mcp.dart';

📦 Widget API #

FlutterUiMcp (or McpPlayground) #

The main widget. Drop it into your app to get a full AI agent interface.

Parameter Type Default Description
initialLlmConfig LlmConfig? null Default LLM provider, model, API key, and hyperparameters. Falls back to persisted settings.
initialServers List<McpServerConfig>? null Pre-configured list of HTTP MCP servers to connect to on startup.
initialLocalMcpServers List<LocalMcpServerSetup>? null Pre-configured list of local Node.js or Python MCP servers to auto-initialize/install.
storageDelegate McpPlaygroundStorageDelegate? null Custom persistence layer for settings. Uses SharedPreferences if omitted.
customLocalTools List<McpLocalTool>? null Custom Dart-native tool implementations.
showAgentInspector bool true Show/hide the Agent Inspector panel and toolbar toggle button.
disableConfigDialog bool false Disable opening the settings dialog when LLM is not configured.
messageContentBuilder Widget? Function(BuildContext, ChatMessage)? null Optional builder callback to intercept message layouts and render custom widgets (e.g., interactive charts).
locale String? null Optional explicit locale override ('en' or 'de'). Defaults to system language.

Basic usage

FlutterUiMcp()

With Pre-configured LLM

FlutterUiMcp(
  initialLlmConfig: const LlmConfig(
    provider: LlmProvider.openai,
    model: 'gpt-4o',
    apiKey: 'sk-...',
  ),
)

📂 Example Projects #

Explore the runnable showcases in this repository:

0
likes
150
points
0
downloads

Documentation

API reference

Publisher

verified publishertealkit.dev

Weekly Downloads

Interactive AI Agent widget for Flutter. Connect to any LLM provider, register Dart-native tools, remote HTTP MCP servers, and local Node.js or Python subprocesses.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

anthropic_sdk_dart, archive, dart_mcp_core, file_picker, flutter, flutter_markdown_plus, flutter_ui_mcp_core, flutter_widget_from_html, googleai_dart, http, llamadart, material_ui, ollama_dart, openai_dart, path, shared_preferences, url_launcher, uuid

More

Packages that depend on flutter_ui_mcp