/** * MCP Server configuration classes * * Provides MCPServer for generic MCP servers and DatabricksMCPServer * for servers requiring Databricks OAuth authentication. */ import type { StreamableHTTPConnection } from "@langchain/mcp-adapters"; import type { BaseMCPServerConfig, MCPServerConfig, DatabricksMCPServerConfig, DatabricksConfigOptions } from "./types.js"; /** * Abstract base class for MCP server configurations. * * Provides common properties and the interface for connection config generation. * Subclasses implement `toConnectionConfig()` to provide transport-specific configuration. */ declare abstract class BaseMCPServer { readonly name: string; readonly headers?: Record; readonly timeout?: number; readonly sseReadTimeout?: number; constructor(config: BaseMCPServerConfig); /** * Convert to connection dictionary for MultiServerMCPClient. * Returns the format expected by @langchain/mcp-adapters. */ abstract toConnectionConfig(): Promise; /** * Build base connection config with common properties. */ protected buildBaseConfig(url: string): StreamableHTTPConnection; } /** * MCP server configuration for streamable HTTP transport. * * Use this for generic (non-Databricks) MCP servers where you have a full URL. * * @example * ```typescript * import { MCPServer, DatabricksMultiServerMCPClient } from "@databricks/langchainjs"; * * const server = new MCPServer({ * name: "my-mcp-server", * url: "https://my-mcp-server.com/mcp", * headers: { "X-API-Key": "secret" }, * timeout: 30, * }); * * const client = new DatabricksMultiServerMCPClient([server]); * const tools = await client.getTools(); * ``` */ export declare class MCPServer extends BaseMCPServer { readonly url: string; constructor(config: MCPServerConfig); toConnectionConfig(): Promise; } /** * MCP server with Databricks OAuth authentication. * * Automatically configures OAuth authentication using the Databricks SDK. * This handles all Databricks authentication methods (PAT, OAuth, Azure MSI, etc.) * transparently through the SDK's authentication chain. * * The host is resolved lazily from the Databricks SDK config (via DATABRICKS_HOST * environment variable, CLI config, or explicit auth config). * * @example * ```typescript * import { DatabricksMCPServer, DatabricksMultiServerMCPClient } from "@databricks/langchainjs"; * * // Host resolved from DATABRICKS_HOST env var or auth config * const server = new DatabricksMCPServer({ * name: "databricks-mcp", * path: "/api/2.0/mcp/sql", * }); * * // With explicit auth (host resolved from auth config) * const serverWithAuth = new DatabricksMCPServer({ * name: "databricks-mcp", * path: "/api/2.0/mcp/sql", * auth: { * host: "https://my-workspace.databricks.com", * token: "dapi...", * }, * }); * * const client = new DatabricksMultiServerMCPClient([server]); * const tools = await client.getTools(); * ``` */ export declare class DatabricksMCPServer extends BaseMCPServer { private readonly sdkConfig; private readonly authProvider; private readonly path; private resolvedUrl?; constructor(config: DatabricksMCPServerConfig); /** * Resolve the full URL by combining the host from SDK config with the path. */ private resolveUrl; /** * Convert to connection dictionary using headers-based authentication. * This resolves the URL and adds the Bearer token directly to headers. * Use this when connecting to servers that don't support OAuth discovery. */ toConnectionConfig(): Promise; /** * Factory method to create a DatabricksMCPServer for a Unity Catalog function. * * @param catalog - UC catalog name * @param schema - UC schema name * @param functionName - UC function name (optional, for specific function) * @param options - Additional server configuration options * @returns DatabricksMCPServer configured for the UC function * * @example * ```typescript * const server = DatabricksMCPServer.fromUCFunction( * "my_catalog", * "my_schema", * "my_function" * ); * ``` */ static fromUCFunction(catalog: string, schema: string, functionName?: string, options?: { auth?: DatabricksConfigOptions; timeout?: number; }): DatabricksMCPServer; /** * Factory method to create a DatabricksMCPServer for a Vector Search index. * * @param catalog - UC catalog name * @param schema - UC schema name * @param indexName - Vector Search index name (optional, for specific index) * @param options - Additional server configuration options * @returns DatabricksMCPServer configured for the Vector Search index * * @example * ```typescript * const server = DatabricksMCPServer.fromVectorSearch( * "my_catalog", * "my_schema", * "my_index" * ); * ``` */ static fromVectorSearch(catalog: string, schema: string, indexName?: string, options?: { auth?: DatabricksConfigOptions; timeout?: number; }): DatabricksMCPServer; /** * Factory method to create a DatabricksMCPServer for a Genie Space. * * @param spaceId - Genie Space ID * @param options - Additional server configuration options * @returns DatabricksMCPServer configured for the Genie Space * * @example * ```typescript * const server = DatabricksMCPServer.fromGenieSpace( * "01ef19c578b21dc6af6e10983fb1e3f9" * ); * ``` */ static fromGenieSpace(spaceId: string, options?: { auth?: DatabricksConfigOptions; timeout?: number; }): DatabricksMCPServer; } export {};