openui_mcp 0.0.1-dev.2 copy "openui_mcp: ^0.0.1-dev.2" to clipboard
openui_mcp: ^0.0.1-dev.2 copied to clipboard

MCP `ToolProvider` for OpenUI Flutter. Wraps `mcp_dart`'s `McpClient` with the JS-reference-compatible `extractToolResult` envelope unwrap.

openui_mcp #

Pub License: MIT style: very_good_analysis

MCP ToolProvider for OpenUI Flutter.

Wraps mcp_dart's McpClient and exposes a ToolProvider to the OpenUI Lang runtime. The extractToolResult envelope unwrap from openui_core mirrors the JS reference:

  1. result.isError → throw McpToolError(messageJoinedFromTextContent)
  2. result.structuredContent != null → return it
  3. otherwise join TextContent.text, attempt jsonDecode, fall back to the raw string

Status #

v0.1, Phase 4 complete.

Install #

dependencies:
  openui_mcp: ^0.1.0

Quick start #

import 'package:mcp_dart/mcp_dart.dart';
import 'package:openui/openui.dart';
import 'package:openui_components/openui_components.dart';
import 'package:openui_mcp/openui_mcp.dart';

final client = McpClient(...);                  // connect your transport
await client.connect();
final provider = McpToolProvider.from(client);

Renderer(
  response: response,
  library: openuiLibrary(),
  toolProvider: provider,                       // → Query / Mutation calls
);

The renderer routes Query(name: "...", args: {...}) statements through provider.callTool, which forwards to mcp.McpClient.callTool and runs the result through extractToolResult before caching the value under the statement id.

License #

MIT — see LICENSE.

0
likes
150
points
9
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

MCP `ToolProvider` for OpenUI Flutter. Wraps `mcp_dart`'s `McpClient` with the JS-reference-compatible `extractToolResult` envelope unwrap.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

mcp_dart, meta, openui_core

More

Packages that depend on openui_mcp