/** * MCP Provider Configuration and Factory */ import type { LanguageModelV2 } from "@ai-sdk/provider"; import type { Server } from "@modelcontextprotocol/sdk/server/index.js"; /** * Extract the modelPreferences type from MCP SDK's createMessage method */ type CreateMessageParams = Parameters[0]; export type ModelPreferences = CreateMessageParams["modelPreferences"]; /** * Configuration for MCP provider */ export interface MCPSamplingProviderConfig { /** * MCP server instance with sampling capability */ server: Server; /** * Default max tokens when not specified in call options * @default 128_000 */ maxTokens?: number; } /** * Options for creating an MCP language model */ export interface MCPSamplingProviderOptions { /** * Override model preferences for this specific model * See: https://modelcontextprotocol.io/specification/2025-06-18/client/sampling#model-preferences */ modelPreferences?: ModelPreferences; } /** * MCP Provider - implements AI SDK provider pattern * * This provider wraps MCP's createMessage capability to work with AI SDK's * standard interface, allowing you to use MCP servers and agents * through the AI SDK. */ export declare class MCPSamplingProvider { private config: any; constructor(config: MCPSamplingProviderConfig); /** * Create a language model instance for a specific MCP tool/agent * * @param options - Optional configuration overrides * @returns A LanguageModelV2 instance */ languageModel(options?: MCPSamplingProviderOptions): LanguageModelV2; /** * Shorthand for creating a language model */ call(options?: MCPSamplingProviderOptions): LanguageModelV2; } /** * Create an MCP sampling provider instance * * @example * ```typescript * import { createMCPSamplingProvider } from "@mcpc/mcp-sampling-ai-provider"; * import { Server } from "@modelcontextprotocol/sdk/server/index.js"; * * const server = new Server( * { name: "my-agent", version: "1.0.0" }, * { capabilities: { tools: {} } } * ); * * const provider = createMCPSamplingProvider({ server }); * * // Use with AI SDK * const model = provider.languageModel({ * modelPreferences: { hints: [{ name: "copilot/gpt-5-mini" }] } * }); * ``` */ export declare function createMCPSamplingProvider(config: MCPSamplingProviderConfig): MCPSamplingProvider; //# sourceMappingURL=provider.d.ts.map