Skip to content

Commit 1403ddd

Browse files
updates
1 parent ac32e7b commit 1403ddd

5 files changed

Lines changed: 63 additions & 33 deletions

File tree

content/en/docs/marketplace/platform-supported-content/modules/snowflake/snowflake-mcp-agent.md

Lines changed: 63 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ You can integrate a Mendix application with a Snowflake Cortex Agent using the M
1212

1313
This article covers two integration methods:
1414

15-
* Method 1 - Snowflake functions as an intermediary layer.
15+
* [Method 1 - Snowflake functions as an intermediary layer](#method-1)
1616

1717
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.
1818

19-
* Method 2 - Direct MCP connector.
19+
* [Method 2 - Direct MCP connector](#method-2)
2020

2121
The Cortex Agent connects directly to the Mendix MCP server through a Snowflake external MCP server and API integration using OAuth 2.0.
2222

@@ -70,7 +70,7 @@ A user interacting with the Cortex Agent can ask a question such as, *How many t
7070

7171
The agent invokes the appropriate tool and returns the result.
7272

73-
## Method 1 - Using Snowflake Functions as an Intermediary Layer
73+
## Method 1 - Using Snowflake Functions as an Intermediary Layer {#method-1}
7474

7575
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.
7676

@@ -119,7 +119,9 @@ To configure your app for method 1, perform the following steps:
119119
* **Input parameter** - `Status` of type `String`
120120
* **Description** - A description that helps the AI agent understand when to call this tool
121121

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." >}}
123125

124126
2. Create a Snowflake secret for basic authentication.
125127

@@ -285,6 +287,8 @@ To configure your app for method 1, perform the following steps:
285287
* When the agent should use it
286288
* Which values are supported for the Status argument: **Open**, **In Progress**, **Closed**
287289
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+
288292
7. Test the integration.
289293
290294
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:
297301
298302
A successful response returns a VARIANT value containing the JSON-RPC result from the Mendix MCP server.
299303
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}
301305
302306
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.
303307
@@ -382,13 +386,13 @@ To configure your app for method 2, perform the following steps:
382386
383387
This makes the Mendix MCP endpoint available as a named connector that can be attached to a Cortex Agent.
384388
385-
```text
386-
USE ROLE ACCOUNTADMIN;
387-
CREATE EXTERNAL MCP SERVER mendix_mcp_server
388-
WITH DISPLAY_NAME = 'Mendix MCP server'
389-
URL = 'https://<your-mendix-app>.apps.<region>.mendixcloud.com/MendixMCP/mcp'
390-
API_INTEGRATION = custom_mcp_api_integration;
391-
```
389+
```text
390+
USE ROLE ACCOUNTADMIN;
391+
CREATE EXTERNAL MCP SERVER mendix_mcp_server
392+
WITH DISPLAY_NAME = 'Mendix MCP server'
393+
URL = 'https://<your-mendix-app>.apps.<region>.mendixcloud.com/MendixMCP/mcp'
394+
API_INTEGRATION = custom_mcp_api_integration;
395+
```
392396
393397
4. Add the Mendix MCP server as a connector to a Cortex Agent, by performing the following steps:
394398
@@ -399,6 +403,8 @@ CREATE EXTERNAL MCP SERVER mendix_mcp_server
399403
5. Select the Mendix MCP server from the list of available external MCP servers.
400404
6. Save the agent configuration.
401405
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+
402408
5. Connect and test the MCP connector.
403409
404410
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
410416
411417
The agent should invoke the `RetrieveNumberOfTicketsInStatus` tool through the MCP connector and return the result.
412418
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+
413421
## Security Considerations
414422
415423
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
440448
441449
#### Python Function Cannot Reach Endpoint
442450
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.
444456
445-
#### Basic Authentication Fails
457+
#### Basic Authentication Failure
458+
459+
Basic authentication fails.
460+
461+
##### Solution
446462
447463
Check the following:
448464
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.
450468
451-
The function definition references the correct secret name in the SECRETS clause
469+
#### Unexpected Wrapper Function Result
452470
453-
The Mendix MCP server is configured to accept Basic Authentication
471+
The wrapper function returns an unexpected result.
454472
455-
The wrapper function returns an unexpected result
473+
##### Solution
456474
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.
458476
459-
An unsupported status value causes an error
477+
#### Unexpected Status Value Causes an Error
460478
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.
462480
463-
Method 2
464-
The external MCP server does not appear in the agent configuration
481+
##### Solution
465482
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.
467484
468-
OAuth authentication fails
485+
### Method 2
469486
470-
Check the following:
487+
#### No MCP Server in Agent Configuration
471488
472-
The client ID and client secret are correct
489+
The external MCP server does not appear in the agent configuration.
473490
474-
The tenant ID matches your identity provider directory
491+
##### Solution
475492
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:
477502
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.
479508
480-
The identity provider allows the required OAuth grant flow for this client
509+
#### Tool Not Invoked
481510
482-
The agent does not invoke the expected tool
511+
The agent does not invoke the expected tool.
483512
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
485514
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.
118 KB
Loading
111 KB
Loading
78.5 KB
Loading
110 KB
Loading

0 commit comments

Comments
 (0)