(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 |
✔️ |
The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes. |
description |
str |
✔️ |
The description of the connector. |
server |
str |
✔️ |
The url of the MCP server. |
icon_url |
OptionalNullable[str] |
➖ |
The optional url of the icon you want to associate to the connector. |
visibility |
Optional[models.ResourceVisibility] |
➖ |
N/A |
headers |
Dict[str, Any] |
➖ |
Optional organization-level headers to be sent with the request to the mcp server. |
auth_data |
OptionalNullable[models.AuthData] |
➖ |
Optional additional authentication data for the connector. |
system_prompt |
OptionalNullable[str] |
➖ |
Optional system prompt for the connector. |
retries |
Optional[utils.RetryConfig] |
➖ |
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>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
connector_id_or_name |
str |
✔️ |
N/A |
app_return_url |
OptionalNullable[str] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
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 |
*/* |
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 |
✔️ |
N/A |
connector_id_or_name |
str |
✔️ |
N/A |
credentials_name |
OptionalNullable[str] |
➖ |
N/A |
arguments |
Dict[str, Any] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
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 |
✔️ |
N/A |
page |
Optional[int] |
➖ |
N/A |
page_size |
Optional[int] |
➖ |
N/A |
refresh |
Optional[bool] |
➖ |
N/A |
pretty |
Optional[bool] |
➖ |
Return a simplified payload with only name, description, annotations, and a compact inputSchema. |
retries |
Optional[utils.RetryConfig] |
➖ |
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 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_customer_data=False, fetch_connection_secrets=False)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
connector_id_or_name |
str |
✔️ |
N/A |
fetch_customer_data |
Optional[bool] |
➖ |
Fetch the customer data associated with the connector (e.g. customer secrets / config). |
fetch_connection_secrets |
Optional[bool] |
➖ |
Fetch the general connection secrets associated with the connector. |
retries |
Optional[utils.RetryConfig] |
➖ |
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 |
✔️ |
N/A |
name |
OptionalNullable[str] |
➖ |
The name of the connector. |
description |
OptionalNullable[str] |
➖ |
The description of the connector. |
icon_url |
OptionalNullable[str] |
➖ |
The optional url of the icon you want to associate to the connector. |
system_prompt |
OptionalNullable[str] |
➖ |
Optional system prompt for the connector. |
connection_config |
Dict[str, Any] |
➖ |
Optional new connection config. |
connection_secrets |
Dict[str, Any] |
➖ |
Optional new connection secrets |
server |
OptionalNullable[str] |
➖ |
New server url for your mcp connector. |
headers |
Dict[str, Any] |
➖ |
New headers for your mcp connector. |
auth_data |
OptionalNullable[models.AuthData] |
➖ |
New authentication data for your mcp connector. |
retries |
Optional[utils.RetryConfig] |
➖ |
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 |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
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 |
*/* |