virnavi_ai_agent_mcp 0.0.3
virnavi_ai_agent_mcp: ^0.0.3 copied to clipboard
Expose Flutter app methods to AI agents via the Model Context Protocol (MCP). Register tools with annotations or code — AI agents call them over JSON-RPC 2.0.
0.0.3 #
New features #
McpModelDefinition.nestedDefinitions— list ofMcpModelDefinitionfor nested@McpModeltypes referenced by a model's fields.McpSummary.bind()now registers all nested definitions recursively, so callers never need to list them explicitly.McpModelDefinition.nestedExtractors— map ofmodelId → (parentJson) → nestedJson?functions. Used by the compose layer to automatically propagate nested model data intoMcpResultStorewhen a parent tool result arrives.McpSummary.bindViews()— default no-op stub added to the base class. The compose package overrides this via an extension; without compose, callingbindWithViews()no longer throws a compile error.
Bug fixes #
@McpParam.requiredchanged frombool(defaulttrue) tobool?(defaultnull). Whennull, the generator infers required status from the parameter's nullability and presence of a default value. Previously, every@McpParam(description: '...')without an explicitrequired: falseforced the parameter into the schema'srequiredlist regardless of its type.
0.0.1 #
Initial release.
AgentBridgesingleton — registers tools and resources, starts transports.HttpTransport— embedded JSON-RPC 2.0 HTTP server (POST /mcp), works in debug, profile, and release modes.VmServiceTransport— VM service extension transport for debug mode (zero config).ToolRegistry/Dispatcher— in-memory registry that routes AI agent calls to Flutter app handlers.- Typed JSON Schema builders:
StringSchema,IntegerSchema,NumberSchema,BooleanSchema,ArraySchema,ObjectSchema. ToolResultandResourceContentresult types.- MCP annotations:
@McpModel,@McpField,@McpService,@McpTool,@McpParam. - Supported MCP methods:
tools/list,tools/call,resources/list,resources/read. - CORS headers on all responses for local MCP clients.
- Default HTTP host
127.0.0.1(Android-safe).