UNPKG

mcp-use

Version:

Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents, Clients and Servers with support for ChatGPT Apps, Code Mode, OAuth, Notifications, Sampling, Observability and more.

27 lines 1.04 kB
import type { MCPSession } from "../session.js"; export declare abstract class BaseAgent { protected session: MCPSession; /** * @param session MCP session used for tool invocation */ constructor(session: MCPSession); /** * Initialize the agent, including initializing the MCP session */ abstract initialize(): Promise<void>; /** * Run the agent on a query with a maximum number of steps * @param query The user query * @param maxSteps Maximum steps allowed (default: 10) * @returns Final result of agent execution */ abstract run(query: string, maxSteps?: number): Promise<Record<string, any>>; /** * Perform a single step given the query and previous steps * @param query The user query or intermediate input * @param previousSteps History of steps so far * @returns Result of this step */ abstract step(query: string, previousSteps?: Array<Record<string, any>>): Promise<Record<string, any>>; } //# sourceMappingURL=base.d.ts.map