McpPort class abstract

Port for Model Context Protocol operations.

Provides tool invocation, resource reading, subscription, and prompt retrieval against one or more MCP servers.

Constructors

McpPort()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

callTool(String name, Map<String, dynamic> arguments, {String? serverId}) Future<ToolResult>
Call a tool on the specified server (or the default server).
getPrompt(String name, {String? serverId, Map<String, dynamic>? arguments}) Future<PromptTemplate?>
Get a prompt template by name.
isConnected({String? serverId}) Future<bool>
Check whether the port is connected to a server.
listResources({String? serverId}) Future<List<ResourceInfo>>
List resources available on the specified server (or all servers).
listTools({String? serverId}) Future<List<ToolInfo>>
List tools available on the specified server (or all servers).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readResource(String uri, {String? serverId}) Future<ResourceContent>
Read a resource from the specified server.
subscribeResource(String uri, {String? serverId}) Stream<ResourceContent>?
Subscribe to resource changes.
toString() String
A string representation of this object.
inherited

Operators

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