You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/marketplace/platform-supported-content/modules/snowflake/snowflake-mcp-agent.md
+82-21Lines changed: 82 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -378,47 +378,108 @@ To configure your app for method 2, perform the following steps:
378
378
379
379
The `OAUTH_REFRESH_TOKEN_VALIDITY` value is set in seconds. The example value of `86400` equals 24 hours.
380
380
381
-
Step 3: Create the external MCP server
382
-
After creating the API integration, create the external MCP server in Snowflake. This makes the Mendix MCP endpoint available as a named connector that can be attached to a Cortex Agent.
383
-
381
+
3. After creating the API integration, create the external MCP server in Snowflake.
384
382
383
+
This makes the Mendix MCP endpoint available as a named connector that can be attached to a Cortex Agent.
To add the Mendix MCP server as a connector to a Cortex Agent, do the following:
391
+
```
392
+
393
+
4. Add the Mendix MCP server as a connector to a Cortex Agent, by performing the following steps:
394
+
395
+
1. In Snowflake, navigate to **AI & ML > Cortex Agents**.
396
+
2. Create a new agent or open an existing agent.
397
+
3. In the agent configuration page, locate the **MCP Connectors** section.
398
+
4. Click **Add MCP** server.
399
+
5. Select the Mendix MCP server from the list of available external MCP servers.
400
+
6. Save the agent configuration.
401
+
402
+
5. Connect and test the MCP connector.
403
+
404
+
When using the agent for the first time, you may be prompted to authorize the OAuth connection. To test the integration, perform the following steps:
405
+
406
+
1. Open the agent preview or runtime chat view.
407
+
2. In the **MCP Connectors** panel, click **Connect** next to Mendix MCP server.
408
+
3. Complete the OAuth authorization flow if prompted.
409
+
4. Ask a question that should trigger the Mendix tool, for example, *How many tickets are open?*
410
+
411
+
The agent should invoke the `RetrieveNumberOfTicketsInStatus` tool through the MCP connector and return the result.
412
+
413
+
## Security Considerations
414
+
415
+
The following sections outline some security considerations and best practices, depending on the method you use.
416
+
417
+
### Both Methods
418
+
419
+
* Do not include actual credentials, client secrets, or tenant-specific values in shared code or documentation.
420
+
* Apply the principle of least privilege when assigning roles to integrations and functions.
421
+
* Validate which microflows are exposed as MCP tools in your Mendix app and ensure only intended tools are accessible.
422
+
* Ensure that only the required Mendix Cloud endpoints are reachable from Snowflake.
423
+
424
+
### Method 1
425
+
426
+
* Store Basic Authentication credentials in a Snowflake secret and reference the secret in the function definition using the SECRETS clause.
427
+
* Restrict access to both the secret and the Python function using role-based access controls.
428
+
429
+
### Method 2
430
+
431
+
* Protect your OAuth 2.0 client secret and rotate it according to your organization's security policy.
432
+
* Verify that the token endpoint, authorization endpoint, and scope are correctly configured in both Snowflake and your identity provider.
433
+
* Ensure the OAuth application in your identity provider is configured to allow only the required grant flows.
434
+
435
+
## Troubleshooting
436
+
437
+
If you encounter any issues, use the following troubleshooting tips to help you solve them.
438
+
439
+
### Method 1
440
+
441
+
#### Python Function Cannot Reach Endpoint
442
+
443
+
If the Python function cannot reach the Mendix endpoint, verify that the external access integration is correctly configured and that the network rule allows outbound access to the Mendix Cloud host.
444
+
445
+
#### Basic Authentication Fails
446
+
447
+
Check the following:
448
+
449
+
The Snowflake secret exists and contains the correct username and password
450
+
451
+
The function definition references the correct secret name in the SECRETS clause
452
+
453
+
The Mendix MCP server is configured to accept Basic Authentication
393
454
394
-
In Snowflake, navigate to AI & ML > Cortex Agents.
455
+
The wrapper function returns an unexpected result
395
456
396
-
Create a new agent or open an existing agent.
457
+
Verify that the tool name RetrieveNumberOfTicketsInStatus and the argument name Status in the SQL wrapper function exactly match the tool definition in your Mendix app.
397
458
398
-
In the agent configuration page, locate the MCP Connectors section.
459
+
An unsupported status value causes an error
399
460
400
-
Click Add MCP server.
461
+
The Mendix microflow throws an exception for unsupported values. Ensure the Cortex Agent tool description clearly states the supported values (Open, Closed, In Progress) so the agent does not pass invalid input.
401
462
402
-
Select Mendix MCP server from the list of available external MCP servers.
463
+
Method 2
464
+
The external MCP server does not appear in the agent configuration
403
465
404
-
Save the agent configuration.
466
+
Verify that the external MCP server was created successfully and that your Snowflake role has the required permissions to view and use it.
405
467
406
-
Figure 3 – Cortex Agent overview page showing the MCP Connectors section with the Mendix MCP server configured.
468
+
OAuth authentication fails
407
469
408
-
Step 5: Connect and test the MCP connector
409
-
When using the agent for the first time, you may be prompted to authorize the OAuth connection. To test the integration, do the following:
470
+
Check the following:
410
471
411
-
Open the agent preview or runtime chat view.
472
+
The client ID and client secret are correct
412
473
413
-
In the MCP Connectors panel, click Connect next to Mendix MCP server.
474
+
The tenant ID matches your identity provider directory
414
475
415
-
Complete the OAuth authorization flow if prompted.
476
+
The token endpoint and authorization endpoint URLs are correct
416
477
417
-
Ask a question that should trigger the Mendix tool, for example:
478
+
The configured scope matches the API registration in your identity provider
418
479
419
-
How many tickets are open?
480
+
The identity provider allows the required OAuth grant flow for this client
420
481
421
-
The agent should invoke the RetrieveNumberOfTicketsInStatus tool through the MCP connector and return the result.
482
+
The agent does not invoke the expected tool
422
483
423
-
Figure 4 – Cortex Agent runtime view showing the Mendix MCP server connector with the Connect option.
484
+
Verify that the Mendix MCP server exposes the tool correctly and that the MCP connector is in a connected state in the agent session. If the connector shows as disconnected, click Connect and complete the authorization flow.
0 commit comments