Establishing a Connection
The CData MCP Server for Snowflake defines each connection to Snowflake as a named configuration that Claude can use when sending natural language queries.
You create and manage these configurations using the MCP Configuration Tool. The tool automatically handles formatting, storage, and registration with Claude Desktop.
Understanding Connection Configurations
Each connection configuration is stored in a .mcp file. This file includes the details needed to initialize the connector when Claude starts a session.
- On Windows, configuration files are stored in "~/AppData/Roaming/CData/Snowflake Data Provider/".
- On macOS, configuration files are stored in "~/Library/Application Support/CData/Snowflake Data Provider/".
The .mcp file is a text file that contains a list of connection properties and a timestamp. For example:
#Tue May 20 15:48:40 EDT 2025 AuthScheme=Basic User=myUser Password=myPassword Security Token=myToken
The configuration tool handles these settings automatically. Each saved configuration enables Claude to launch a dedicated MCP Server instance with the correct connector and options. Manual file editing is not required.
Connecting to Snowflake
Before authenticating, set the following properties to define your Snowflake connection:
- URL: Your Snowflake URL, such as https://orgname-myaccount.snowflakecomputing.com.
- If using a Legacy URL: https://myaccount.region.snowflakecomputing.com.
- To find your URL:
- Click on your name in the lower left-hand corner of your Snowflake UI.
- Hover over your Account ID.
- Click the Copy Account URL icon to copy your account URL.
- Database (optional): Restrict the tables and views exposed by the server to those from a specific Snowflake database.
- Schema (optional): Restrict the tables and views exposed by the server to those from a specific Snowflake database schema.
Authenticating to Snowflake
The server supports OAuth authentication by default and also provides several options for federated identity providers and key-based login.
To specify the authentication method you want to use, set the AuthScheme property.
OAuth
To authenticate with OAuth, set the AuthScheme to OAuth.
To complete OAuth authentication, see Creating a Custom OAuth App. Then configure the following connection properties:
- OAuthClientId: Set to the Client ID of your registered OAuth application.
- OAuthClientSecret: Set to the Client Secret for the registered application.
- CallbackURL: Set to the redirect URI configured in your OAuth app settings.
The server also supports additional OAuth-based authentication schemes for specific Identity Providers. These schemes extend the standard OAuth configuration and support either browser-based login or headless authentication. Depending on your identity provider, the following additional OAuth-based authentication schemes are supported. Set the AuthScheme to one of the following values and configure the required properties.
- AuthScheme=OAuthAzureAD: Performs non-browser OAuth authentication using Azure Active Directory. Snowflake's security integration type is external_oauth.
- OAuthClientId: Set to the Azure AD application's Client ID.
- OAuthClientSecret: Set to the Azure AD application's Client Secret.
- CallbackURL: Set to the Redirect URI configured in your Azure AD app.
- AzureTenant: Set to your Azure Active Directory Tenant ID.
- InitiateOAuth: Set to GETANDREFRESH to automatically retrieve and refresh the access token.
- AuthScheme=OAuthClientAzureAD: Uses the client credentials grant flow with Azure Active Directory. No browser required.
- OAuthClientId: Set to the Azure AD application's Client ID.
- OAuthClientSecret: Set to the Azure AD application's Client Secret.
- AzureTenant: Set to your Azure Active Directory Tenant ID.
- InitiateOAuth: Set to GETANDREFRESH to automatically retrieve and refresh the access token.
- AuthScheme=OAuthOkta: Performs OAuth authentication with Okta as the Identity Provider.
- OAuthClientId: Set to the Client ID of your Okta app.
- OAuthClientSecret: Set to the Client Secret for your Okta app.
- CallbackURL: Set to the Redirect URI configured in your Okta app.
- OAuthAuthorizationURL: Set to the authorization URL for the OAuth service.
- OAuthAccessTokenURL: Set to the URL to retrieve the OAuth access token from.
- InitiateOAuth: Set to GETANDREFRESH to automatically retrieve and refresh the access token.
- AuthScheme=OAuthClientOkta: Uses the client credentials grant flow with Okta. No browser required.
- OAuthClientId: Set to the Client ID of your Okta app.
- OAuthClientSecret: Set to the Client Secret for your Okta app.
- OAuthAuthorizationURL: Set to the authorization URL for the OAuth service.
- OAuthAccessTokenURL: Set to the URL to retrieve the OAuth access token from.
- InitiateOAuth: Set to GETANDREFRESH to automatically retrieve and refresh the access token.
- AuthScheme=OAuthOther: Performs OAuth authentication using a third-party Identity Provider, such as PingFederate.
- OAuthClientId: Set to the Client ID from your IdP.
- OAuthClientSecret: Set to the Client Secret from your IdP.
- CallbackURL: Set to the Redirect URI defined in your OAuth configuration.
- OAuthAuthorizationURL: Set to the authorization URL for the OAuth service.
- OAuthAccessTokenURL: Set to the URL to retrieve the OAuth access token from.
- InitiateOAuth: Set to GETANDREFRESH to automatically retrieve and refresh the access token.
- AuthScheme=OAuthClientOther: Uses the client credentials grant flow with a third-party Identity Provider such as PingFederate. No browser required.
- OAuthClientId: Set to the Client ID from your IdP.
- OAuthClientSecret: Set to the Client Secret from your IdP.
- OAuthAuthorizationURL: Set to the authorization URL for the OAuth service.
- OAuthAccessTokenURL: Set to the URL to retrieve the OAuth access token from.
- InitiateOAuth: Set to GETANDREFRESH to automatically retrieve and refresh the access token.
- AuthScheme=OAuthJWT: Performs OAuth authentication using a signed JWT and a certificate. This scheme is typically used with Azure Active Directory and other IdPs that support JWT-based assertion.
- OAuthJWTCert: Path to the certificate file (.pfx or .pem) used to sign the JWT.
- OAuthJWTCertType: The format of the certificate file (PEM, PFX).
- OAuthClientId: The Client ID for your OAuth application.
- OAuthClientSecret: (Optional) The Client Secret, if required by your IdP.
- AzureTenant: (If using Azure AD) Set this to your Azure Active Directory Tenant ID.
- InitiateOAuth: Set to GETANDREFRESH to automatically retrieve and refresh the access token.
- AuthScheme=AzureMSI: Performs OAuth authentication using Azure Managed Identity (MSI). This method is ideal for applications running in Azure-hosted environments such as Azure App Services and virtual machines.
- AzureResource: Set to the target resource ID as required by your Snowflake security integration.
- OAuthClientId: (optional) The Client ID of your user-assigned managed identity.
- InitiateOAuth: Set to GETANDREFRESH to automatically retrieve and refresh the access token.
Desktop Apps
This section describes desktop authentication using the credentials for your custom OAuth app. See Creating a Custom OAuth App for more information.Get an OAuth Access Token
After setting the following, you are ready to connect:
- OAuthClientId: Set to the Client ID in your OAuth Integration settings.
- OAuthClientSecret: Set to the Client Secret in OAuth your Integration settings.
- CallbackURL: Set to the Redirect URL in your OAuth Integration settings.
- InitiateOAuth: Set to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- Extracts the access token from the callback URL and authenticates requests.
- Obtains a new access token when the old one expires.
- Saves OAuth values in OAuthSettingsLocation to be persisted across connections.
Manually Get an OAuth Access Token
Set the following connection properties to obtain the OAuthAccessToken:
- InitiateOAuth: Set to OFF.
- OAuthClientId: Set to the Client ID in your OAuth Integration settings.
- OAuthClientSecret: Set to the Client Secret in your OAuth Integration settings.
You can then call stored procedures to complete the OAuth exchange:
- Call the GetOAuthAuthorizationUrl stored procedure. Set the CallbackURL input to the Redirect URI you specified in your app settings. The stored procedure returns the URL to the OAuth endpoint and the PKCEVerifier.
- Open the URL, log in, and authorize the application. You are redirected back to the callback URL.
- Call the GetOAuthAccessToken stored procedure. Set the CallbackURL input to the Redirect URI you specified in your app settings. Set the PKCEVerifier input to the value of the PKCEVerifier retrieved from the first step.
Headless Machines
To configure the driver to use OAuth with a user account on a headless machine, you need to authenticate on another device that has an internet browser.- Choose one of these two options:
- Option 1: Obtain the OAuthVerifier value as described in "Obtain and Exchange a Verifier Code" below.
- Option 2: Install the server on another machine and transfer the OAuth authentication values after you authenticate through the usual browser-based flow, as described in "Transfer OAuth Settings" below.
- Then configure the server to automatically refresh the access token from the headless machine.
Option 1: Obtain and Exchange a Verifier Code
To obtain a verifier code, you must authenticate at the OAuth authorization URL.
See Creating a Custom OAuth App for a procedure. This section describes the procedure to authenticate and connect to data.
To obtain the verifier code, set the following properties on the headless machine:
- InitiateOAuth: Set to OFF.
- OAuthClientId: Set to the Client ID in your OAuth Integration settings.
- OAuthClientSecret: Set to the Client Secret in your OAuth Integration settings.
Next, authenticate from another machine and obtain the OAuthVerifier connection property:
- Call the GetOAuthAuthorizationUrl stored procedure. Set the CallbackURL input to the Redirect URI you specified in your app settings. The stored procedure returns the URL to the OAuth endpoint and the PKCEVerifier.
- Open the returned URL in a browser. Log in and grant permissions to the server. You are then redirected to the callback URL, which contains the verifier code.
- Save the value of the Verifier and the value of the PKCEVerifier. You need to set the value of the Verifier in the OAuthVerifier connection property and set the value of the PKCEVerifier in the PKCEVerifier connection property.
Finally, on the headless machine, set the following connection properties to obtain the OAuth authentication values:
- OAuthClientId: Set to the Client ID in your OAuth Integration settings.
- OAuthClientSecret: Set to the Client Secret in your OAuth Integration settings.
- OAuthVerifier: Set to the verifier code.
- PKCEVerifier: Set to the PKCE verifier code.
- OAuthSettingsLocation: Set to persist the encrypted OAuth authentication values to the specified location.
- InitiateOAuth: Set to REFRESH.
Connect to Data
After the OAuth settings file is generated, set the following properties to connect to data:
- OAuthSettingsLocation: Set to the location containing the encrypted OAuth authentication values. Make sure this location gives read and write permissions to the provider to enable the automatic refreshing of the access token.
- InitiateOAuth: Set to REFRESH.
Option 2: Transfer OAuth Settings
To install the server on another machine, authenticate, and then transfer the resulting OAuth values:
- On a second machine, install the server and connect with the following properties set:
- OAuthSettingsLocation: Set to a writable location.
- InitiateOAuth: Set to GETANDREFRESH.
- OAuthClientId: Set to the Client ID in your app settings.
- OAuthClientSecret: Set to the Client Secret in your app settings.
- CallbackURL: Set to the Callback URL in your app settings.
- Test the connection to authenticate. The resulting authentication values are written, encrypted, to the location specified by OAuthSettingsLocation. Once you have successfully tested the connection, copy the OAuth settings file to your headless machine. On the headless machine, set the following connection properties to connect to data:
- InitiateOAuth: Set to REFRESH.
- OAuthSettingsLocation: Set to the location of your OAuth settings file. Make sure this location gives read and write permissions to the server to enable the automatic refreshing of the access token.
Passwords
Set User and Password to a Snowflake user and set AuthScheme to PASSWORD.
Note: Starting with accounts created using Snowflake's bundle 2024_08 (October 2024), password-based authentication is no longer supported due to security concerns. Instead, use alternative authentication methods such as OAuth or Private Key authentication.
Private Key
The server allows you to authenticate using key pair authentication by creating a secure token with the private key defined for your user account. To connect with this method, set AuthScheme to PrivateKey and set the following values:
- User: The user account to authenticate as.
- PrivateKey: The private key used for the user such as the path to the .pem file containing the private key.
- PrivateKeyType: The type of key store containing the private key such as PEMKEY_FILE, PFXFILE, etc.
- PrivateKeyPassword: The password for the specified private key.
Okta
Set the AuthScheme to OKTA. The following connection properties are used to connect to Okta:
- User: Set this to the Okta user.
- Password: Set this to Okta password for the user.
- MFAPasscode (optional): Set this to the OTP code that was sent to your device. This property should be used only when the MFA is required for OKTA sign on.
- Domain: Set this to the OKTA org domain name.
- MFAType (optional): Set this to the multi-factor type. This property should be used only when the MFA is required for OKTA sign on. This property accepts one of the following values:
- OKTAVerify
- SMS
- APIToken (optional): Set this to the API Token that the customer created from the Okta organization. You should specify this when authenticating a user via a trusted application or proxy that overrides OKTA client request context. In most contexts, it is not needed.
The following is an example connection string:
AuthScheme=OKTA;User=username;Password=password;Url='https://myaccount.region.snowflakecomputing.com';Warehouse=My_warehouse;SSO Properties='Domain=https://cdata-okta.okta.com';
The following is an example connection string for OKTA MFA:
AuthScheme=OKTA;User=username;Password=password;MFAPasscode=8111461;Url='https://myaccount.region.snowflakecomputing.com';Warehouse=My_warehouse;SSO Properties='Domain=https://cdata-okta.okta.com;MFAType=OktaVerify;';
AzureAD
Set the AuthScheme to AzureAD and set User to your AD user. When connecting, your browser opens, allowing you to login to Azure AD to complete the authentication. The following is an example connection string for AzureAD:AuthScheme=AzureAD;Url=https://myaccount.region.snowflakecomputing.com;[email protected];
PingFederate
Set the AuthScheme to PingFederate. Set the following connection properties to connect to PingFederate:- User: Set this to your PingFederate user. You must also add the user to PingFederate Data Stores. When connecting, your browser opens allowing you to login to PingFederate to complete the authentication.
- Password: Set this to the user password.
- ProofKey (optional): You must specify this if you want to connect without using a browser. In a browser setting, this value is autogenerated.
- ExternalToken (optional): Required if you want to connect without a browser. In a browser setting, this value is autogenerated.
AuthScheme=PingFederate;Url=https://myaccount.region.snowflakecomputing.com;User=myuser@mydomain;Account=myaccount;Warehouse=mywarehouse;
Using a Proof Key and External Token
Setting the AuthScheme to AzureAD or PingFederate involves the use of a Proof Key and an External Token. If you choose to complete authentication via an internet browser, these values are autogenerated and automatically included in the connection string that you use during the Snowflake log in process.If you choose to connect by means other than via a browser, you must specify values for ProofKey and ExternalToken. In this case, follow the steps below to authenticate:
- Create a local web server with a specified port, such as 8080.
- Call the GetSSOAuthorizationURL stored procedure using your specified port. This procedure returns a login SSO URL.
- Copy and paste the returned URL into a browser.
- In the page that opens, enter your username and password.
- After you log in, a callback URL is generated and sent to your local web server instance. This callback URL is in a specialized format. You need to write your own code to extract the External Token from the callback URL.
SAML Providers
The server has generic support for SAML-based identity providers, such as OneLogin.
Set the AuthScheme to ExternalBrowser.
OneLogin
Set User to the Snowflake user you want to authenticate.
When you attempt a connection, the SAML provider launches a login prompt in your default web browser.
Provide the credentials associated with your SAML provider to authenticate to Snowflake.
Configuring Access Control
If the authenticating user maps to a system-defined role, specify it in the RoleName property.