mcp-use TypeScript API
    Preparing search index...

    Interface ViewConnection

    Host operations and server metadata available to a live MCP App.

    interface ViewConnection {
        callTool: (
            name: string,
            args?: Record<string, unknown>,
            options?: { resetTimeoutOnProgress?: boolean; timeout?: number },
        ) => Promise<unknown>;
        readResource: (uri: string) => Promise<unknown>;
        resources?: readonly { _meta?: { ui?: unknown }; uri: string }[];
        tools?: readonly {
            _meta?: { ui?: { visibility?: readonly ("model" | "app")[] } };
            name: string;
        }[];
    }
    Index
    callTool: (
        name: string,
        args?: Record<string, unknown>,
        options?: { resetTimeoutOnProgress?: boolean; timeout?: number },
    ) => Promise<unknown>

    Calls an MCP server tool.

    readResource: (uri: string) => Promise<unknown>

    Reads an MCP resource by URI.

    resources?: readonly { _meta?: { ui?: unknown }; uri: string }[]

    Resources available to the host.

    tools?: readonly {
        _meta?: { ui?: { visibility?: readonly ("model" | "app")[] } };
        name: string;
    }[]

    Tools available to the host, including app visibility metadata.