McpPlayground class

An interactive AI Agent Playground widget for Flutter.

Connects to various LLM providers, registers Dart-native tools, remote HTTP/S MCP servers, and local Node.js or Python subprocesses.

Inheritance

Constructors

McpPlayground({Key? key, PlaygroundController? controller, LlmConfig? initialLlmConfig, List<McpServerConfig>? initialServers, List<LocalMcpServerSetup>? initialLocalMcpServers, McpPlaygroundStorageDelegate? storageDelegate, List<McpLocalTool>? customLocalTools, bool disableConfigDialog = false, String? locale, Widget? messageContentBuilder(BuildContext context, ChatMessage? message)?, bool enableLogging = false, bool showAgentInspector = true, String? initialSystemPrompt, List<String>? initialEnabledTools, List<Widget>? customAppBarActions, bool showAppBar = true, bool showStatusBadges = true, bool showNewChatAction = true, bool showSettingsAction = true, bool showSkillsControls = true, bool showAssistantStatistics = true, bool showMemoryArchive = true, bool showToolsCatalog = true, bool showWorkflowActions = true, bool progressiveMcpDiscovery = false, List<SystemPromptTemplate>? systemPromptTemplates, bool showSystemPromptTemplates = true, McpTopBarBuilder? topBarBuilder, McpSettingsDialogBuilder? settingsDialogBuilder})
Creates a new McpPlayground widget instance.
const

Properties

controller → PlaygroundController?
Optional external PlaygroundController instance. If provided, the widget will use this controller instead of creating its own internal instance.
final
customAppBarActions → List<Widget>?
Optional custom action widgets to display in the AppBar.
final
customLocalTools → List<McpLocalTool>?
Custom list of internal, Dart-native tools to register.
final
disableConfigDialog → bool
Whether to disable opening the configuration dialog when LLM is not configured.
final
enableLogging → bool
Whether to print clean console logs for key events.
final
hashCode → int
The hash code for this object.
no setterinherited
initialEnabledTools → List<String>?
Optional list of tool names to pre-select as active on startup.
final
initialLlmConfig → LlmConfig?
Default LLM setup parameters.
final
initialLocalMcpServers → List<LocalMcpServerSetup>?
Optional list of local MCP servers to auto-initialize/install.
final
initialServers → List<McpServerConfig>?
Default list of HTTP/HTTPS MCP servers to connect to.
final
initialSystemPrompt → String?
Optional initial system prompt.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale → String?
Optional locale override ('en' or 'de').
final
messageContentBuilder → Widget? Function(BuildContext context, ChatMessage? message)?
Optional builder to customize rendering of chat bubble message contents dynamically.
final
progressiveMcpDiscovery → bool
Whether to use on-demand progressive tool discovery (McpListToolsTool & McpCallToolTool) instead of sending all MCP tool schemas in the initial prompt context.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
settingsDialogBuilder → McpSettingsDialogBuilder?
Optional builder to customize or completely replace the settings dialog.
final
showAgentInspector → bool
Whether to show the Agent Inspector side panel and toggle button. Defaults to true.
final
showAppBar → bool
Whether to display the top AppBar. Set to false when embedding within another view/scaffold.
final
showAssistantStatistics → bool
Whether to show Assistant statistics and Evaluations/Benchmark controls.
final
showMemoryArchive → bool
Whether to show Episodic Memory Archive controls.
final
showNewChatAction → bool
Whether to show the New Chat button in the AppBar actions.
final
showSettingsAction → bool
Whether to show the Agent & LLM Settings button in the AppBar actions.
final
showSkillsControls → bool
Whether to show Skills controls (Skills Manager and Skill Wizard).
final
showStatusBadges → bool
Whether to show interactive status badges (Model, Tools/Mode) in the AppBar title.
final
showSystemPromptTemplates → bool
Whether to display the Quick Persona Templates section in the Agent Settings tab. Defaults to true.
final
showToolsCatalog → bool
Whether to show Registered Tools Catalog.
final
showWorkflowActions → bool
Whether to show Save and Load Workflow actions.
final
storageDelegate → McpPlaygroundStorageDelegate?
Optional delegate to customize settings save/load operations. Falls back to SharedPreferences if null.
final
systemPromptTemplates → List<SystemPromptTemplate>?
Optional list of system prompt persona templates for quick selection in settings. If null, defaults to kDefaultSystemPromptTemplates.
final
topBarBuilder → McpTopBarBuilder?
Optional builder to customize or completely replace the top navigation bar.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<McpPlayground>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited