/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Klavis from "../../../index.js"; export declare namespace McpServer { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; apiKey?: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Additional headers to include in the request. */ headers?: Record | undefined>; } } export declare class McpServer { protected readonly _options: McpServer.Options; constructor(_options?: McpServer.Options); /** * Calls a tool on a specific remote MCP server, used for function calling. Eliminates the need for manual MCP code implementation. * Under the hood, Klavis will instantiates an MCP client and establishes a connection with the remote MCP server to call the tool. * * @param {Klavis.CallToolRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.callTools({ * serverUrl: "serverUrl", * toolName: "toolName" * }) */ callTools(request: Klavis.CallToolRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __callTools; /** * Lists all tools available for a specific remote MCP server in various AI model formats. * * This eliminates the need for manual MCP code implementation and format conversion. * Under the hood, Klavis instantiates an MCP client and establishes a connection * with the remote MCP server to retrieve available tools. * * @param {Klavis.ListToolsRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.listTools({ * serverUrl: "serverUrl" * }) */ listTools(request: Klavis.ListToolsRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __listTools; /** * Create a Strata MCP server. * * Parameters: * - servers: Can be 'ALL' to add all available Klavis integration, a list of specific server names, or null to add no servers * - externalServers: Optional list of external MCP servers to validate and add * * @param {Klavis.StrataCreateRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.createStrataServer({ * userId: "userId" * }) */ createStrataServer(request: Klavis.StrataCreateRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __createStrataServer; /** * Add servers to an existing Strata MCP server. * * Note: After adding servers, you need to reconnect the MCP server so that list_tool can be updated with the new servers. * * Parameters: * - servers: Can be 'ALL' to add all available servers, a list of specific server names, or null to add no servers * - externalServers: Optional list of external MCP servers to validate and add * * @param {Klavis.StrataAddServersRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.addServersToStrata({ * strataId: "strataId" * }) */ addServersToStrata(request: Klavis.StrataAddServersRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __addServersToStrata; /** * Delete servers from an existing Strata MCP server. * * Note: After deleting servers, you need to reconnect the MCP server so that list_tool can be updated to reflect the removed servers. * * Parameters: * - strataId: The strata server ID (path parameter) * - servers: Can be 'ALL' to delete all available Klavis integration, a list of specific server names, or null to delete no servers * - externalServers: Query parameter - comma-separated list of external server names to delete * * Returns separate lists for deleted Klavis servers and deleted external servers. * * @param {string} strataId * @param {Klavis.DeleteServersFromStrataMcpServerStrataStrataIdServersDeleteRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.deleteServersFromStrata("strataId", { * externalServers: "externalServers" * }) */ deleteServersFromStrata(strataId: string, request?: Klavis.DeleteServersFromStrataMcpServerStrataStrataIdServersDeleteRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __deleteServersFromStrata; /** * Get information about an existing Strata MCP server instance. * * Returns the strata URL, connected klavis servers, connected external servers (with URLs), * and authentication URLs for klavis servers. * * @param {string} strataId * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.getStrataServer("strataId") */ getStrataServer(strataId: string, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __getStrataServer; /** * Fetch raw actions (all underlying actions) for a specific integration within a Strata MCP instance. * * @param {string} strataId - The strata server ID * @param {Klavis.ListStrataRawActionsMcpServerStrataStrataIdRawActionsGetRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.listStrataRawActions("strataId", { * server: "Affinity" * }) */ listStrataRawActions(strataId: string, request: Klavis.ListStrataRawActionsMcpServerStrataStrataIdRawActionsGetRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __listStrataRawActions; /** * Retrieves authentication data for a specific integration within a Strata MCP server. * * Returns the authentication data if available, along with authentication status. * * @param {string} strataId - The strata server ID * @param {Klavis.McpServerName} serverName - The name of the Klavis MCP server to get authentication for (e.g., 'GitHub', 'Jira') * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.getStrataAuth("strataId", "Affinity") */ getStrataAuth(strataId: string, serverName: Klavis.McpServerName, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __getStrataAuth; /** * Deletes authentication data for a specific integration within a Strata MCP server. * * This will clear the stored authentication credentials, effectively unauthenticating the server. * * @param {string} strataId - The strata server ID * @param {Klavis.McpServerName} serverName - The name of the Klavis MCP server to delete authentication for (e.g., 'github', 'jira') * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.deleteStrataAuth("strataId", "Affinity") */ deleteStrataAuth(strataId: string, serverName: Klavis.McpServerName, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __deleteStrataAuth; /** * Sets authentication data for a specific integration within a Strata MCP server. * * Accepts either API key authentication or general authentication data. * * @param {Klavis.StrataSetAuthRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.setStrataAuth({ * strataId: "strataId", * serverName: "Affinity", * authData: {} * }) */ setStrataAuth(request: Klavis.StrataSetAuthRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __setStrataAuth; /** * Creates a URL for a specified MCP server, * validating the request with an API key and user details. * Returns the existing server URL if it already exists for the user. * If OAuth is configured for the server, also returns the base OAuth authorization URL. * Note that some servers have hundreds of tools and therefore only expose the Strata tools. * * @param {Klavis.CreateServerRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.createServerInstance({ * serverName: "Affinity", * userId: "userId" * }) */ createServerInstance(request: Klavis.CreateServerRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __createServerInstance; /** * Creates an instance id for a self-hosted MCP server, * validating the request with an API key and user details. * The main purpose of this endpoint is to create an instance id for a self-hosted MCP server. * The instance id is used to identify and store the auth metadata in the database. * Returns the existing instance id if it already exists for the user. * * @param {Klavis.CreateSelfHostedServerRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.createSelfHostedServerInstance({ * serverName: "Affinity", * userId: "userId" * }) */ createSelfHostedServerInstance(request: Klavis.CreateSelfHostedServerRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __createSelfHostedServerInstance; /** * Checks the details of a specific server connection instance using its unique ID and API key, * returning server details like authentication status and associated server/platform info. * * @param {string} instanceId - The ID of the connection integration instance whose status is being checked. This is returned by the Create API. * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.getServerInstance("instanceId") */ getServerInstance(instanceId: string, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __getServerInstance; /** * Completely removes a server connection instance using its unique ID, * deleting all associated data from the system. * * @param {string} instanceId - The ID of the connection instance to delete. * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.deleteServerInstance("instanceId") */ deleteServerInstance(instanceId: string, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __deleteServerInstance; /** * Retrieves the auth data for a specific integration instance that the API key owner controls. * Includes access token, refresh token, and other authentication data. * * This endpoint includes proper ownership verification to ensure users can only access * authentication data for integration instances they own. It also handles token refresh if needed. * * @param {string} instanceId - The ID of the connection integration instance to get auth data for. * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.getInstanceAuthData("instanceId") */ getInstanceAuthData(instanceId: string, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __getInstanceAuthData; /** * Deletes authentication data for a specific server connection instance. * * @param {string} instanceId - The ID of the connection instance to delete auth for. * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.deleteInstanceAuth("instanceId") */ deleteInstanceAuth(instanceId: string, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __deleteInstanceAuth; /** * Get tools information for any MCP server. * * @param {Klavis.McpServerName} serverName - The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid). * @param {Klavis.McpServerGetToolsRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.getTools("Affinity", { * format: "openai", * legacy: true * }) */ getTools(serverName: Klavis.McpServerName, request?: Klavis.McpServerGetToolsRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __getTools; /** * Get all MCP servers with their basic information including id, name, description, and tools. * * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.mcpServer.getAllMcpServers() */ getAllMcpServers(requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __getAllMcpServers; /** * Sets authentication data for a specific integration instance. * Accepts either API key authentication or general authentication data. * This updates the auth_metadata for the specified integration instance. * * @param {Klavis.SetAuthRequest} request * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.setInstanceAuth({ * instanceId: "instanceId", * authData: {} * }) */ setInstanceAuth(request: Klavis.SetAuthRequest, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __setInstanceAuth; /** * Fetch raw actions (all underlying actions) for a specific integration instance. * * This endpoint takes an instance ID, and then fetches the raw actions with categories. * * @param {string} instanceId - The instance ID for the server connection * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.mcpServer.listRawActions("instanceId") */ listRawActions(instanceId: string, requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __listRawActions; /** * @param {McpServer.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.mcpServer.getOauthUrl() */ getOauthUrl(requestOptions?: McpServer.RequestOptions): core.HttpResponsePromise; private __getOauthUrl; protected _getAuthorizationHeader(): Promise; }