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
+63-33Lines changed: 63 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,11 @@ You can integrate a Mendix application with a Snowflake Cortex Agent using the M
12
12
13
13
This article covers two integration methods:
14
14
15
-
* Method 1 - Snowflake functions as an intermediary layer.
15
+
*[Method 1 - Snowflake functions as an intermediary layer](#method-1)
16
16
17
17
The Cortex Agent uses a custom tool backed by a Snowflake SQL wrapper function, which delegates to a Python function that communicates with the Mendix MCP server using Basic Authentication.
18
18
19
-
* Method 2 - Direct MCP connector.
19
+
*[Method 2 - Direct MCP connector](#method-2)
20
20
21
21
The Cortex Agent connects directly to the Mendix MCP server through a Snowflake external MCP server and API integration using OAuth 2.0.
22
22
@@ -70,7 +70,7 @@ A user interacting with the Cortex Agent can ask a question such as, *How many t
70
70
71
71
The agent invokes the appropriate tool and returns the result.
72
72
73
-
## Method 1 - Using Snowflake Functions as an Intermediary Layer
73
+
## Method 1 - Using Snowflake Functions as an Intermediary Layer {#method-1}
74
74
75
75
In this method, the Cortex Agent does not connect directly to the Mendix MCP server. Instead, it uses a custom tool that is backed by a Snowflake SQL wrapper function. That wrapper function calls a Snowflake Python function, which handles all MCP communication with the Mendix app.
76
76
@@ -119,7 +119,9 @@ To configure your app for method 1, perform the following steps:
119
119
***Input parameter** - `Status` of type `String`
120
120
***Description** - A description that helps the AI agent understand when to call this tool
121
121
122
-
For more information on exposing microflows as MCP tools, see the MCP module documentation on the Mendix documentation site.
122
+
For more information on exposing microflows as MCP tools, see the [MCP module documentation](/agents/mcp/) on the Mendix documentation site.
123
+
124
+
{{< figure src="/attachments/appstore/platform-supported-content/modules/snowflake-mcp-agent/mcp-agent1.png" class="no-border" alt="Mendix microflow exposed as an MCP tool, implementing conditional logic to return ticket counts by status." >}}
123
125
124
126
2. Create a Snowflake secret for basic authentication.
125
127
@@ -285,6 +287,8 @@ To configure your app for method 1, perform the following steps:
285
287
* When the agent should use it
286
288
* Which values are supported for the Status argument: **Open**, **In Progress**, **Closed**
287
289
290
+
{{< figure src="/attachments/appstore/platform-supported-content/modules/snowflake-mcp-agent/mcp-agent2.png" class="no-border" alt="Snowflake Cortex Agent configured with a custom tool that invokes the SQL wrapper function." >}}
291
+
288
292
7. Test the integration.
289
293
290
294
You can test the wrapper function directly in Snowflake before using it through the agent.
@@ -297,7 +301,7 @@ To configure your app for method 1, perform the following steps:
297
301
298
302
A successful response returns a VARIANT value containing the JSON-RPC result from the Mendix MCP server.
299
303
300
-
## Method 2 - Connecting the Cortex Agent Directly to the Mendix MCP Server
304
+
## Method 2 - Connecting the Cortex Agent Directly to the Mendix MCP Server {#method-2}
301
305
302
306
In this method, the Cortex Agent connects to the Mendix MCP server through a Snowflake external MCP server and API integration. The Cortex Agent uses the MCP connector directly, without requiring custom Snowflake functions for request construction or authentication.
303
307
@@ -382,13 +386,13 @@ To configure your app for method 2, perform the following steps:
382
386
383
387
This makes the Mendix MCP endpoint available as a named connector that can be attached to a Cortex Agent.
4. Add the Mendix MCP server as a connector to a Cortex Agent, by performing the following steps:
394
398
@@ -399,6 +403,8 @@ CREATE EXTERNAL MCP SERVER mendix_mcp_server
399
403
5. Select the Mendix MCP server from the list of available external MCP servers.
400
404
6. Save the agent configuration.
401
405
406
+
{{< figure src="/attachments/appstore/platform-supported-content/modules/snowflake-mcp-agent/mcp-agent3.png" class="no-border" alt="Cortex Agent overview page showing the MCP Connectors section with the Mendix MCP server configured." >}}
407
+
402
408
5. Connect and test the MCP connector.
403
409
404
410
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:
@@ -410,6 +416,8 @@ CREATE EXTERNAL MCP SERVER mendix_mcp_server
410
416
411
417
The agent should invoke the `RetrieveNumberOfTicketsInStatus` tool through the MCP connector and return the result.
412
418
419
+
{{< figure src="/attachments/appstore/platform-supported-content/modules/snowflake-mcp-agent/mcp-agent4.png" class="no-border" alt="Cortex Agent runtime view showing the Mendix MCP server connector with the Connect option." >}}
420
+
413
421
## Security Considerations
414
422
415
423
The following sections outline some security considerations and best practices, depending on the method you use.
@@ -440,46 +448,68 @@ If you encounter any issues, use the following troubleshooting tips to help you
440
448
441
449
#### Python Function Cannot Reach Endpoint
442
450
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.
451
+
The Python function cannot reach the Mendix endpoint.
452
+
453
+
##### Solution
454
+
455
+
Verify that the external access integration is correctly configured and that the network rule allows outbound access to the Mendix Cloud host.
444
456
445
-
#### Basic Authentication Fails
457
+
#### Basic Authentication Failure
458
+
459
+
Basic authentication fails.
460
+
461
+
##### Solution
446
462
447
463
Check the following:
448
464
449
-
The Snowflake secret exists and contains the correct username and password
465
+
* The Snowflake secret exists and contains the correct username and password.
466
+
* The function definition references the correct secret name in the `SECRETS` clause.
467
+
* The Mendix MCP server is configured to accept basic authentication.
450
468
451
-
The function definition references the correct secret name in the SECRETS clause
469
+
#### Unexpected Wrapper Function Result
452
470
453
-
The Mendix MCP server is configured to accept Basic Authentication
471
+
The wrapper function returns an unexpected result.
454
472
455
-
The wrapper function returns an unexpected result
473
+
##### Solution
456
474
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.
475
+
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.
458
476
459
-
An unsupported status value causes an error
477
+
#### Unexpected Status Value Causes an Error
460
478
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.
479
+
The Mendix microflow throws an exception for unsupported values.
462
480
463
-
Method 2
464
-
The external MCP server does not appear in the agent configuration
481
+
##### Solution
465
482
466
-
Verify that the external MCP server was created successfully and that your Snowflake role has the required permissions to view and use it.
483
+
Ensure the Cortex Agent tool description clearly states the supported values (**Open**, **Closed**, **In Progress**) so the agent does not pass invalid input.
467
484
468
-
OAuth authentication fails
485
+
### Method 2
469
486
470
-
Check the following:
487
+
#### No MCP Server in Agent Configuration
471
488
472
-
The client ID and client secret are correct
489
+
The external MCP server does not appear in the agent configuration.
473
490
474
-
The tenant ID matches your identity provider directory
491
+
##### Solution
475
492
476
-
The token endpoint and authorization endpoint URLs are correct
493
+
Verify that the external MCP server was created successfully and that your Snowflake role has the required permissions to view and use it.
494
+
495
+
#### OAuth Authentication Failure
496
+
497
+
OAuth authentication fails.
498
+
499
+
##### Solution
500
+
501
+
Check the following:
477
502
478
-
The configured scope matches the API registration in your identity provider
503
+
* The client ID and client secret are correct.
504
+
* The tenant ID matches your identity provider directory.
505
+
* The token endpoint and authorization endpoint URLs are correct.
506
+
* The configured scope matches the API registration in your identity provider.
507
+
* The identity provider allows the required OAuth grant flow for this client.
479
508
480
-
The identity provider allows the required OAuth grant flow for this client
509
+
#### Tool Not Invoked
481
510
482
-
The agent does not invoke the expected tool
511
+
The agent does not invoke the expected tool.
483
512
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.
513
+
##### Solution
485
514
515
+
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