(beta) Connectors API - manage your connectors
Create a new MCP connector. You can customize its visibility, url and auth type.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.create(name="<value>", description="unibody usually despite slushy wherever reward stingy from", server="https://royal-majority.net/")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
name | str | :heavy_check_mark: | The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes. |
description | str | :heavy_check_mark: | The description of the connector. |
server | str | :heavy_check_mark: | The url of the MCP server. |
title | OptionalNullable[str] | :heavy_minus_sign: | Optional human-readable title for the connector. |
icon_url | OptionalNullable[str] | :heavy_minus_sign: | The optional url of the icon you want to associate to the connector. |
visibility | Optional[models.ResourceVisibility] | :heavy_minus_sign: | N/A |
headers | Dict[str, Any] | :heavy_minus_sign: | Optional organization-level headers to be sent with the request to the mcp server. |
auth_data | OptionalNullable[models.AuthData] | :heavy_minus_sign: | Optional additional authentication data for the connector. |
oauth2_server_metadata | OptionalNullable[models.ExtendedOAuthServerMetadata] | :heavy_minus_sign: | Optional OAuth2 authorization server metadata (authorization_endpoint, token_endpoint, etc.). When provided, skips .well-known discovery and uses these endpoints directly. |
oauth2_server_metadata_url | OptionalNullable[str] | :heavy_minus_sign: | Optional URL to fetch OAuth2 authorization server metadata from (RFC 8414). When provided, the metadata is fetched from this URL and used instead of .well-known discovery. Mutually exclusive with oauth2_server_metadata. |
system_prompt | OptionalNullable[str] | :heavy_minus_sign: | Optional system prompt for the connector. |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.Connector
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List all your custom connectors with keyset pagination and filters.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.list(page_size=100)
# Handle response
print(res)
models.PaginatedConnectors
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get the OAuth2 authorization URL for a connector to initiate user authentication.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.get_auth_url(connector_id_or_name="<value>", github_installation_link=False)
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id_or_name | str | :heavy_check_mark: | N/A |
app_return_url | OptionalNullable[str] | :heavy_minus_sign: | N/A |
method_type | Optional[models.OutboundAuthenticationType] | :heavy_minus_sign: | Auth method type to use for the authorization URL. Required when the connector supports multiple interactive auth methods; otherwise the sole method is selected automatically. Use this to pick a specific method (e.g. 'oauth2' vs 'github_app'). |
credentials_name | OptionalNullable[str] | :heavy_minus_sign: | N/A |
github_installation_link | Optional[bool] | :heavy_minus_sign: | Only valid with method_type=oauth2. When true, returns a GitHub App installation URL (https://github.com/apps//installations/new) if the connector has the proper configuration The Github application needs to have 'Request user authorization (OAuth) during installation' enabled to perform the proper auth loop. |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.AuthURLResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Enable a connector at the organization level so all members can use it.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.activate_for_organization(connector_id="a91bb4ec-caab-4cf2-be03-84b8343f4643")
# Handle response
print(res)
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Disable a connector at the organization level.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.deactivate_for_organization(connector_id="8f4c1089-2a37-44b3-a3c4-830ca7a0e439")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Enable a connector at the workspace level so all members of the workspace can use it.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.activate_for_workspace(connector_id="2adfa8af-3618-41a9-8980-e5ea1486e58e")
# Handle response
print(res)
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Disable a connector at the workspace level.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.deactivate_for_workspace(connector_id="15b00e98-a9e7-4582-b0fc-87d28c3dac04")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Enable a connector for the calling user only.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.activate_for_user(connector_id="cd4fb4d2-de68-451f-8f2a-57fe39b33d96")
# Handle response
print(res)
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Disable a connector for the calling user only.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.deactivate_for_user(connector_id="99c6ed86-e6bb-40ed-b6ee-d22ba791a68f")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Call a tool on an MCP connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.call_tool(tool_name="<value>", connector_id_or_name="<value>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
tool_name | str | :heavy_check_mark: | N/A |
connector_id_or_name | str | :heavy_check_mark: | N/A |
credentials_name | OptionalNullable[str] | :heavy_minus_sign: | N/A |
arguments | Dict[str, Any] | :heavy_minus_sign: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.ConnectorToolCallResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List all tools available for an MCP connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.list_tools(connector_id_or_name="<value>", page=1, page_size=100, refresh=False, pretty=False)
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id_or_name | str | :heavy_check_mark: | N/A |
page | Optional[int] | :heavy_minus_sign: | N/A |
page_size | Optional[int] | :heavy_minus_sign: | N/A |
refresh | Optional[bool] | :heavy_minus_sign: | N/A |
pretty | Optional[bool] | :heavy_minus_sign: | Return a simplified payload with only name, description, annotations, and a compact inputSchema. |
credentials_name | OptionalNullable[str] | :heavy_minus_sign: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.ResponseConnectorListToolsV1
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get the authentication schema for a connector. Returns the list of supported authentication methods and their required headers.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.get_authentication_methods(connector_id_or_name="<value>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id_or_name | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
List[models.PublicAuthenticationMethod]
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List all credentials configured at the organization level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.list_organization_credentials(connector_id_or_name="<value>", fetch_default=False)
# Handle response
print(res)
models.CredentialsResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Create or update credentials at the organization level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.create_or_update_organization_credentials(connector_id_or_name="<value>", name="<value>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id_or_name | str | :heavy_check_mark: | N/A |
name | str | :heavy_check_mark: | Name of the credentials. Use this name to access or modify your credentials. |
is_default | OptionalNullable[bool] | :heavy_minus_sign: | Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. |
credentials | OptionalNullable[models.ConnectionCredentials] | :heavy_minus_sign: | The credential data (headers, bearer_token). |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List all credentials configured at the workspace level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.list_workspace_credentials(connector_id_or_name="<value>", fetch_default=False)
# Handle response
print(res)
models.CredentialsResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Create or update credentials at the workspace level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.create_or_update_workspace_credentials(connector_id_or_name="<value>", name="<value>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id_or_name | str | :heavy_check_mark: | N/A |
name | str | :heavy_check_mark: | Name of the credentials. Use this name to access or modify your credentials. |
is_default | OptionalNullable[bool] | :heavy_minus_sign: | Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. |
credentials | OptionalNullable[models.ConnectionCredentials] | :heavy_minus_sign: | The credential data (headers, bearer_token). |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List all credentials configured at the user level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.list_user_credentials(connector_id_or_name="<value>", fetch_default=False)
# Handle response
print(res)
models.CredentialsResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Create or update credentials at the user level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.create_or_update_user_credentials(connector_id_or_name="<value>", name="<value>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id_or_name | str | :heavy_check_mark: | N/A |
name | str | :heavy_check_mark: | Name of the credentials. Use this name to access or modify your credentials. |
is_default | OptionalNullable[bool] | :heavy_minus_sign: | Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. |
credentials | OptionalNullable[models.ConnectionCredentials] | :heavy_minus_sign: | The credential data (headers, bearer_token). |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete credentials at the organization level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.delete_organization_credentials(credentials_name="<value>", connector_id_or_name="<value>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
credentials_name | str | :heavy_check_mark: | N/A |
connector_id_or_name | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete credentials at the workspace level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.delete_workspace_credentials(credentials_name="<value>", connector_id_or_name="<value>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
credentials_name | str | :heavy_check_mark: | N/A |
connector_id_or_name | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete credentials at the user level for a given connector.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.delete_user_credentials(credentials_name="<value>", connector_id_or_name="<value>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
credentials_name | str | :heavy_check_mark: | N/A |
connector_id_or_name | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get a connector by its ID or name.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.get(connector_id_or_name="<value>", fetch_user_data=False, fetch_customer_data=False)
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id_or_name | str | :heavy_check_mark: | N/A |
fetch_user_data | Optional[bool] | :heavy_minus_sign: | Fetch the user-level data associated with the connector (e.g. connection credentials). |
fetch_customer_data | Optional[bool] | :heavy_minus_sign: | Fetch the customer data associated with the connector (e.g. customer secrets / config). |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.Connector
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Update a connector by its ID.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.update(connector_id="81d30634-113f-4dce-a89e-7786be2d8693")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id | str | :heavy_check_mark: | N/A |
title | OptionalNullable[str] | :heavy_minus_sign: | Optional human-readable title for the connector. |
name | OptionalNullable[str] | :heavy_minus_sign: | The name of the connector. |
description | OptionalNullable[str] | :heavy_minus_sign: | The description of the connector. |
icon_url | OptionalNullable[str] | :heavy_minus_sign: | The optional url of the icon you want to associate to the connector. |
system_prompt | OptionalNullable[str] | :heavy_minus_sign: | Optional system prompt for the connector. |
connection_config | Dict[str, Any] | :heavy_minus_sign: | Optional new connection config. |
connection_secrets | Dict[str, Any] | :heavy_minus_sign: | Optional new connection secrets |
server | OptionalNullable[str] | :heavy_minus_sign: | New server url for your mcp connector. |
headers | Dict[str, Any] | :heavy_minus_sign: | New headers for your mcp connector. |
auth_data | OptionalNullable[models.AuthData] | :heavy_minus_sign: | New authentication data for your mcp connector. |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.Connector
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete a connector by its ID.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.connectors.delete(connector_id="5c3269fe-6a18-4216-b1fb-b093005874cd")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
connector_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.MessageResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |