// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import * as CustomAPI from './custom'; import { Custom, CustomCreateParams, CustomCreateResponse } from './custom'; import * as GenerateAPI from './generate'; import { Generate, GenerateURLParams, GenerateURLResponse } from './generate'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; /** * MCP server management */ export class Mcp extends APIResource { custom: CustomAPI.Custom = new CustomAPI.Custom(this._client); generate: GenerateAPI.Generate = new GenerateAPI.Generate(this._client); /** * Creates a new Model Control Protocol (MCP) server instance for the authenticated * project. An MCP server provides a connection point for AI assistants to access * your applications and services. The server is configured with specific * authentication and tool permissions that determine what actions the connected * assistants can perform. * * @example * ```ts * const mcp = await client.mcp.create({ * auth_config_ids: ['ac_1a2b3c4d5e6f'], * name: 'GitHub Integration Server', * }); * ``` */ create(body: McpCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/api/v3.1/mcp/servers', { body, ...options }); } /** * Retrieves detailed configuration information for a specific Model Control * Protocol (MCP) server. The returned data includes connection details, associated * applications, enabled tools, and authentication configuration. * * @example * ```ts * const mcp = await client.mcp.retrieve( * '550e8400-e29b-41d4-a716-446655440000', * ); * ``` */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/api/v3.1/mcp/${id}`, options); } /** * Updates the configuration of an existing Model Control Protocol (MCP) server. * You can modify the server name, associated applications, and enabled tools. Only * the fields included in the request will be updated. * * @example * ```ts * const mcp = await client.mcp.update( * '550e8400-e29b-41d4-a716-446655440000', * { name: 'Updated GitHub Integration Server' }, * ); * ``` */ update( id: string, body: McpUpdateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/api/v3.1/mcp/${id}`, { body, ...options }); } /** * Retrieves a paginated list of MCP servers associated with the authenticated * project. Results can be filtered by name, toolkit, or authentication * configuration ID. MCP servers are used to provide Model Control Protocol * integration points for connecting AI assistants to your applications and * services. * * @example * ```ts * const mcps = await client.mcp.list(); * ``` */ list(query: McpListParams | null | undefined = {}, options?: RequestOptions): APIPromise { return this._client.get('/api/v3.1/mcp/servers', { query, ...options }); } /** * Performs a soft delete on a Model Control Protocol (MCP) server, making it * unavailable for future use. This operation is reversible in the database but * cannot be undone through the API. Any applications or services connected to this * server will lose access after deletion. * * @example * ```ts * const mcp = await client.mcp.delete( * '550e8400-e29b-41d4-a716-446655440000', * ); * ``` */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/api/v3.1/mcp/${id}`, options); } /** * Retrieves a paginated list of Model Control Protocol (MCP) servers that are * configured for a specific application or toolkit. This endpoint allows you to * find all MCP server instances that have access to a particular application, such * as GitHub, Slack, or Jira. * * @example * ```ts * const response = await client.mcp.retrieveApp('github'); * ``` */ retrieveApp( appKey: string, query: McpRetrieveAppParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/api/v3.1/mcp/app/${appKey}`, { query, ...options }); } } /** * MCP server configuration and connection details */ export interface McpCreateResponse { /** * UUID of the MCP server instance */ id: string; /** * Array of tool slugs that this MCP server is allowed to use */ allowed_tools: Array; /** * ID references to the auth configurations used by this server */ auth_config_ids: Array; /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ commands: McpCreateResponse.Commands; /** * Date and time when this server was initially created */ created_at: string; /** * Whether the MCP server is managed by Composio */ managed_auth_via_composio: boolean; /** * @deprecated [DEPRECATED] Please use the URL with user_id or connected_account_id * query param */ mcp_url: string; /** * User-defined descriptive name for this MCP server */ name: string; /** * Total count of active user instances connected to this server */ server_instance_count: number; /** * Object mapping each toolkit slug to its icon/logo URL for display purposes */ toolkit_icons: { [key: string]: string }; /** * Array of toolkit slugs that this MCP server is allowed to use */ toolkits: Array; /** * Date and time when this server configuration was last modified */ updated_at: string; } export namespace McpCreateResponse { /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ export interface Commands { /** * @deprecated Command line instruction for Claude client setup */ claude: string; /** * @deprecated Command line instruction for Cursor client setup */ cursor: string; /** * @deprecated Command line instruction for Windsurf client setup */ windsurf: string; } } /** * MCP server configuration and connection details */ export interface McpRetrieveResponse { /** * UUID of the MCP server instance */ id: string; /** * Array of tool slugs that this MCP server is allowed to use */ allowed_tools: Array; /** * ID references to the auth configurations used by this server */ auth_config_ids: Array; /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ commands: McpRetrieveResponse.Commands; /** * Date and time when this server was initially created */ created_at: string; /** * Whether the MCP server is deleted */ deleted: boolean; /** * Whether the MCP server is managed by Composio */ managed_auth_via_composio: boolean; /** * @deprecated [DEPRECATED] Please use the URL with user_id or connected_account_id * query param */ mcp_url: string; /** * User-defined descriptive name for this MCP server */ name: string; /** * Total count of active user instances connected to this server */ server_instance_count: number; /** * Object mapping each toolkit slug to its icon/logo URL for display purposes */ toolkit_icons: { [key: string]: string }; /** * Array of toolkit slugs that this MCP server is allowed to use */ toolkits: Array; /** * Date and time when this server configuration was last modified */ updated_at: string; } export namespace McpRetrieveResponse { /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ export interface Commands { /** * @deprecated Command line instruction for Claude client setup */ claude: string; /** * @deprecated Command line instruction for Cursor client setup */ cursor: string; /** * @deprecated Command line instruction for Windsurf client setup */ windsurf: string; } } /** * MCP server configuration and connection details */ export interface McpUpdateResponse { /** * UUID of the MCP server instance */ id: string; /** * Array of tool slugs that this MCP server is allowed to use */ allowed_tools: Array; /** * ID references to the auth configurations used by this server */ auth_config_ids: Array; /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ commands: McpUpdateResponse.Commands; /** * Date and time when this server was initially created */ created_at: string; /** * Whether the MCP server is deleted */ deleted: boolean; /** * Whether the MCP server is managed by Composio */ managed_auth_via_composio: boolean; /** * @deprecated [DEPRECATED] Please use the URL with user_id or connected_account_id * query param */ mcp_url: string; /** * User-defined descriptive name for this MCP server */ name: string; /** * Total count of active user instances connected to this server */ server_instance_count: number; /** * Object mapping each toolkit slug to its icon/logo URL for display purposes */ toolkit_icons: { [key: string]: string }; /** * Array of toolkit slugs that this MCP server is allowed to use */ toolkits: Array; /** * Date and time when this server configuration was last modified */ updated_at: string; } export namespace McpUpdateResponse { /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ export interface Commands { /** * @deprecated Command line instruction for Claude client setup */ claude: string; /** * @deprecated Command line instruction for Cursor client setup */ cursor: string; /** * @deprecated Command line instruction for Windsurf client setup */ windsurf: string; } } /** * Paginated response containing MCP servers */ export interface McpListResponse { /** * Current page number being returned */ current_page: number; /** * Array of MCP server configurations */ items: Array; /** * Total number of pages in the paginated response */ total_pages: number; } export namespace McpListResponse { /** * MCP server configuration and connection details */ export interface Item { /** * UUID of the MCP server instance */ id: string; /** * Array of tool slugs that this MCP server is allowed to use */ allowed_tools: Array; /** * ID references to the auth configurations used by this server */ auth_config_ids: Array; /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ commands: Item.Commands; /** * Date and time when this server was initially created */ created_at: string; /** * Whether the MCP server is managed by Composio */ managed_auth_via_composio: boolean; /** * @deprecated [DEPRECATED] Please use the URL with user_id or connected_account_id * query param */ mcp_url: string; /** * User-defined descriptive name for this MCP server */ name: string; /** * Total count of active user instances connected to this server */ server_instance_count: number; /** * Object mapping each toolkit slug to its icon/logo URL for display purposes */ toolkit_icons: { [key: string]: string }; /** * Array of toolkit slugs that this MCP server is allowed to use */ toolkits: Array; /** * Date and time when this server configuration was last modified */ updated_at: string; } export namespace Item { /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ export interface Commands { /** * @deprecated Command line instruction for Claude client setup */ claude: string; /** * @deprecated Command line instruction for Cursor client setup */ cursor: string; /** * @deprecated Command line instruction for Windsurf client setup */ windsurf: string; } } } /** * Response indicating the success of the delete operation */ export interface McpDeleteResponse { /** * Unique identifier of the MCP server to retrieve, update, or delete */ id: string; /** * Indicates whether the MCP server was successfully deleted */ deleted: boolean; } /** * Paginated response containing MCP servers */ export interface McpRetrieveAppResponse { /** * Current page number being returned */ current_page: number; /** * Array of MCP server configurations */ items: Array; /** * Total number of pages in the paginated response */ total_pages: number; } export namespace McpRetrieveAppResponse { /** * MCP server configuration and connection details */ export interface Item { /** * UUID of the MCP server instance */ id: string; /** * Array of tool slugs that this MCP server is allowed to use */ allowed_tools: Array; /** * ID references to the auth configurations used by this server */ auth_config_ids: Array; /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ commands: Item.Commands; /** * Date and time when this server was initially created */ created_at: string; /** * Whether the MCP server is managed by Composio */ managed_auth_via_composio: boolean; /** * @deprecated [DEPRECATED] Please use the URL with user_id or connected_account_id * query param */ mcp_url: string; /** * User-defined descriptive name for this MCP server */ name: string; /** * Total count of active user instances connected to this server */ server_instance_count: number; /** * Object mapping each toolkit slug to its icon/logo URL for display purposes */ toolkit_icons: { [key: string]: string }; /** * Array of toolkit slugs that this MCP server is allowed to use */ toolkits: Array; /** * Date and time when this server configuration was last modified */ updated_at: string; } export namespace Item { /** * @deprecated Set of command line instructions for connecting various clients to * this MCP server */ export interface Commands { /** * @deprecated Command line instruction for Claude client setup */ claude: string; /** * @deprecated Command line instruction for Cursor client setup */ cursor: string; /** * @deprecated Command line instruction for Windsurf client setup */ windsurf: string; } } } export interface McpCreateParams { /** * ID references to existing authentication configurations */ auth_config_ids: Array; /** * Human-readable name to identify this MCP server instance (4-30 characters, * alphanumeric, spaces, and hyphens only) */ name: string; /** * List of tool slugs that should be allowed for this server. If not provided, all * available tools for the authentication configuration will be enabled. */ allowed_tools?: Array; /** * Whether the MCP server is managed by Composio */ managed_auth_via_composio?: boolean; /** * List of NO_AUTH apps to enable for this MCP server */ no_auth_apps?: Array; } export interface McpUpdateParams { /** * List of action identifiers that should be enabled for this server */ allowed_tools?: Array; /** * List of auth config IDs to use for this MCP server. */ auth_config_ids?: Array; /** * Whether the MCP server is managed by Composio */ managed_auth_via_composio?: boolean; /** * Human-readable name to identify this MCP server instance (4-30 characters, * alphanumeric, spaces, and hyphens only) */ name?: string; /** * List of toolkit slugs this server should be configured to work with. */ toolkits?: Array; } export interface McpListParams { /** * Comma-separated list of auth config IDs to filter servers by */ auth_config_ids?: string; /** * Number of items per page (default: 10) */ limit?: number | null; /** * Filter MCP servers by name (case-insensitive partial match) */ name?: string; /** * Field to order results by */ order_by?: 'created_at' | 'updated_at'; /** * Direction of ordering */ order_direction?: 'asc' | 'desc'; /** * Page number for pagination (1-based) */ page_no?: number | null; /** * Comma-separated list of toolkit slugs to filter servers by */ toolkits?: string; } export interface McpRetrieveAppParams { /** * Comma-separated list of auth config IDs to filter servers by */ auth_config_ids?: string; /** * Number of items per page (default: 10) */ limit?: number | null; /** * Filter MCP servers by name (case-insensitive partial match) */ name?: string; /** * Field to order results by */ order_by?: 'created_at' | 'updated_at'; /** * Direction of ordering */ order_direction?: 'asc' | 'desc'; /** * Page number for pagination (1-based) */ page_no?: number | null; /** * Comma-separated list of toolkit slugs to filter servers by */ toolkits?: string; } Mcp.Custom = Custom; Mcp.Generate = Generate; export declare namespace Mcp { export { type McpCreateResponse as McpCreateResponse, type McpRetrieveResponse as McpRetrieveResponse, type McpUpdateResponse as McpUpdateResponse, type McpListResponse as McpListResponse, type McpDeleteResponse as McpDeleteResponse, type McpRetrieveAppResponse as McpRetrieveAppResponse, type McpCreateParams as McpCreateParams, type McpUpdateParams as McpUpdateParams, type McpListParams as McpListParams, type McpRetrieveAppParams as McpRetrieveAppParams, }; export { Custom as Custom, type CustomCreateResponse as CustomCreateResponse, type CustomCreateParams as CustomCreateParams, }; export { Generate as Generate, type GenerateURLResponse as GenerateURLResponse, type GenerateURLParams as GenerateURLParams, }; }