Connecting Mistral agents to Cloudera data

Add a custom MCP connector in Mistral Vibe so that Mistral agents can query data through the MCP server of a Cloudera data service, such as Cloudera Lakehouse Engine, as the signed-in user.

Mistral agents reach your data only through Model Context Protocol (MCP) servers. The suite does not discover Cloudera MCP servers automatically, so you add each server as a custom connector. This release supports the MCP servers of Cloudera Lakehouse Engine and Cloudera Data Engineering. These servers use OAuth 2.1 authentication with the identity provider of the Anywhere Cloud Console, so each user connects with their own Cloudera Anywhere Cloud identity.

The MCP server does not have to be managed by the same Anywhere Cloud Console as the suite. The suite can call an MCP server that another console manages. In that case, the server signs users in through the identity provider of its own console, not the identity provider of the suite. The sign-in to the suite does not apply to the MCP server, so each user connects the connector with OAuth 2.1. Steps 3, 4, and 8 describe the extra settings for a server that another console manages.

You need this procedure only if you want agents to use an MCP server. You connect a server after you deploy the suite, but you must configure some of its settings before you deploy the suite.

  • You know the domain of the suite, which is the Base Domain that you set in the deployment wizard or the domain of the cluster.
  • You have read access, with a kubeconfig file, to the workload cluster of the MCP server and to the cluster of the Anywhere Cloud Console. You use the kubeconfig files to find the URL of the MCP server and to export the CA certificates.
  • The kubectl, openssl, and curl command-line tools are installed.
  • You are a Cloudera Anywhere Cloud administrator who can sign in to the console.
  • For the steps after the deployment, the suite is deployed and passes the checks in Checking the Mistral AI Suite deployment.
Before you deploy the suite: find the URL and the CA certificates
  1. Find the URL of the MCP server.

    The console does not show the URL of an MCP server. The host of the server is on the HTTPRoute resource of its workload cluster whose name contains -mcp, and the URL is https://MCP-HOST/mcp. To list the HTTPRoute resources, run the following commands, where WORKLOAD-KUBECONFIG is the path to the kubeconfig file of the workload cluster:

    export KUBECONFIG=WORKLOAD-KUBECONFIG
    kubectl get httproute -A

    For example, the MCP server of Cloudera Lakehouse Engine, with External MCP client access enabled (the default), serves https://ENGINE-NAMESPACE-mcp.WORKLOAD-CLUSTER-DOMAIN/mcp.

    Use the external URL, not an address inside the cluster such as SERVICE.NAMESPACE.svc.cluster.local. Mistral Vibe is an OAuth client outside the cluster of the MCP server, and it signs in through the metadata that the server publishes on its external host.

  2. Export the CA certificate of the MCP server and the CA certificate of the console.

    The host of the MCP server and the Knox host of the console are signed by different CAs, on different clusters. Run the following commands, where CONSOLE-KUBECONFIG is the path to the kubeconfig file of the cluster of the console:

    export KUBECONFIG=WORKLOAD-KUBECONFIG
    kubectl -n istio-ingress get secret default-awc-tls -o jsonpath='{.data.ca\.crt}' | base64 -d > mcp-ca.crt
    
    export KUBECONFIG=CONSOLE-KUBECONFIG
    kubectl -n ccf-cert-manager get secret default-awc-ca -o jsonpath='{.data.ca\.crt}' | base64 -d > console-ca.crt
    
    openssl x509 -in mcp-ca.crt -noout -subject -ext subjectKeyIdentifier
    openssl x509 -in console-ca.crt -noout -subject -ext subjectKeyIdentifier
    • Take only ca.crt from the default-awc-tls secret. Its tls.crt is the certificate of the gateway and its tls.key is the private key of the gateway. Do not add either of them to a certificate profile.
    • The default-awc-ca secret of the workload cluster does not sign the host of the MCP server, so it is not the CA to add.
    • The console and every workload cluster each have a CA named Cloudera AWC Internal CA, with different keys. To distinguish them, compare the subject key identifiers that the openssl commands print, not the names.
  3. Check that the MCP server uses OAuth.
    cat mcp-ca.crt console-ca.crt > mcp-cas.crt
    curl -sSI --cacert mcp-cas.crt https://MCP-HOST/mcp
    curl -sS --cacert mcp-cas.crt https://MCP-HOST/.well-known/oauth-protected-resource/mcp
    • The first curl command returns 401, because it sends no token.
    • In the metadata that the second command returns, authorization_servers names https://knox.CONSOLE-DOMAIN/gateway/knox-knoxidf-auth-sso/knoxidf. If that Knox host is outside the parent domain of the suite, you list it in Allowed Outbound Domains in step 6. If it is the Knox host of another console, you also add the CA certificate of that console to the certificate profile in step 4.
Before you deploy the suite: trust the certificates and allow the hosts
  1. In Cloudera Cloud Factory, add the CA certificate of the MCP server, mcp-ca.crt, to the certificate profile of the project of the suite.

    The suite calls the MCP server over HTTPS and checks its certificate against the trust bundle that the platform builds from this profile. The suite also calls the Knox host of the console for tokens. The suite already trusts the CA of the console, so you do not add it to the profile. If the MCP server signs users in with the Knox host of another console, also add the CA certificate of that console to the profile. For more information, see Trust for outbound connections.

  2. When you deploy the suite, select that profile under Certificate and Trust.

    The services of the suite read the trust bundle when they start.

  3. If the host of the MCP server or the Knox host of the console, knox.CONSOLE-DOMAIN, is outside the parent domain of the suite, list it in the Allowed Outbound Domains field. Separate several hosts with spaces.

    The suite allows hosts under its parent domain, which is the domain of the suite without its first label, even if they have private addresses. For example, for a suite at mistral.eng.example.com, the parent domain is eng.example.com, so knox.console.eng.example.com needs no entry, but an MCP server at mcp.infra.example.com does. The MCP servers of Cloudera data services and the Knox host of the console are usually under the same parent domain as the suite, but not always, so check each host. The suite blocks other hosts with private addresses unless you list them. List exact hosts, because a parent domain with a leading dot matches every cluster under it. For the rules, see Outbound connections.

After you deploy the suite: register an OAuth client
  1. Sign in to the Anywhere Cloud Console in a browser, and copy the value of the hadoop-jwt cookie.

    The cookie is the token of your console session. Mistral Vibe cannot register itself with the console, so an administrator registers a client for the suite once and gives its client ID to the user who creates the connector.

  2. Register a client for the callback address of the suite.

    Register the client on the same console whose Knox host the metadata of the MCP server names. In the following command, HADOOP_JWT is the cookie value from the previous step, console-ca.crt is the CA certificate of the console that you exported in step 2, and SUITE-DOMAIN is the domain of the suite:

    curl -sS --cacert console-ca.crt -X POST \
      'https://knox.CONSOLE-DOMAIN/gateway/knox-knoxidf-auth-clientregistration/knoxidf/api/v1/client/register' \
      -H "Authorization: Bearer HADOOP_JWT" \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      --data-urlencode 'redirect_uris=https://callback.SUITE-DOMAIN/v1/integrations_auth/oauth2_callback' \
      --data-urlencode 'allowed_scopes=openid,profile,email,offline_access'
  3. In the response, copy the client_id and store the client_secret in a secure location.

    You enter the client ID in the connector. Mistral Vibe signs in with Proof Key for Code Exchange (PKCE), so it does not need the client secret. Do not enter the secret in the connector or share it. The console does not show the secret again.

    The redirect URI must match the callback address of the suite exactly. Register one client for each suite. You cannot edit a client in the console. To change the redirect URIs of a client, register a new client.

After you deploy the suite: create and connect the connector
  1. In Mistral Vibe, click Connectors, click the Add Connector button, and then click the Custom MCP Connector tab.
  2. In the Title field, enter a name for the connector, and in the Server field, enter the URL of the MCP server.
  3. Leave Authentication Method set to Auto-detect.

    If the suite can reach the server, it reads the metadata of the server and switches the method to OAuth2.1 automatically. If the list stays unavailable, the suite cannot reach the server. See the troubleshooting table.

  4. Open OAuth2 Advanced Settings. Check that the Redirect URI is the one that you registered, enter the client ID from the response in the Client ID field, and leave the Client Secret field empty.
  5. From the Visibility list, select Private to make the connector available only to you, or Workspace to share it with your workspace.
  6. Click the Connect button.

    Mistral Vibe creates the connector and redirects the browser to the sign-in page of the Anywhere Cloud Console.

  7. Sign in to Cloudera Anywhere Cloud, or use your existing console session.
  8. If the console prompts for consent on behalf of the client, click the Accept button, and confirm the prompt of the browser.

    The browser returns to Mistral Vibe, and the connector shows Connected. The Functions tab lists the tools of the server, each with an Always allow switch.

After you deploy the suite: use the connector
  1. On the connector, click New Chat, or turn on the connector from the tools button in the message box of a chat.
  2. Ask a question that the tools of the server can answer.

    Mistral Vibe calls the tools and answers with their results. For a quick check of the MCP server of Cloudera Lakehouse Engine, ask it to list the catalogs and the user that it ran as. The user is the Cloudera Anywhere Cloud user who connected.

Each user connects once, with their own Cloudera Anywhere Cloud identity. The MCP server runs every tool call as that user, under the permissions of the data service, and the suite refreshes the tokens of the user so that the user does not need to connect again.

If something does not work, use the following table.

Table 1. Troubleshooting MCP connectors
Symptom Cause and solution
Authentication Method stays unavailable after you enter the server. The suite cannot reach the server. If the host of the server is outside the parent domain of the suite, check that it is listed in Allowed Outbound Domains. Also check the certificate profile.
server_unreachable: could not connect to MCP server The suite blocks outbound connections to the host of the MCP server, because the host is outside the parent domain of the suite and is not listed in Allowed Outbound Domains. List the host in Allowed Outbound Domains.
The Protected Resource Metadata pointed to an authorization server, but fetching its /.well-known/oauth-authorization-server document failed. The suite reached the MCP server but not the Knox host that the server names. If that host is outside the parent domain of the suite, list it in Allowed Outbound Domains. If it is the Knox host of another console, also add the CA certificate of that console to the certificate profile.
There was a problem connecting The suite cannot reach the server or Knox, or it does not trust their certificates. Check that the hosts outside the parent domain of the suite are listed in Allowed Outbound Domains, and check the certificate profile.
Knox reports Invalid redirect_uri or Missing stored redirect_uris. The client was registered for another redirect URI, such as the one of another suite, or the client ID came from an API token, which has no redirect URI. Register a client as described in this topic.
Knox reports Unknown client_id. The client ID contains a stray space, or the client no longer exists. Register the client again and update the connector.
Clicking Connect opens the Mistral Vibe home page. You have no console session yet. Click Connect again.
The consent page does not continue after you click Accept. You dismissed the confirmation prompt of the browser. Click Accept again and confirm the prompt.
The browser stays on the sign-in page of Mistral Vibe and never returns to the connector. Sign in to the Anywhere Cloud Console instead.
Registering the client returns 415. The request body was in JSON format. Send form fields, as in the registration command.
Registering the client returns 401. The bearer token is missing, expired, or from another console. Copy the hadoop-jwt cookie of this console again.
The curl command exits with code 60. The --cacert file does not contain the CA of the host that you called.
The curl command exits with code 77. The --cacert file is not a PEM file, for example, a trust bundle that is saved in YAML format.