Error:
The role ALL requested has been explicitly blocked for use with this application by an administrator.
Cause:
The MCP connection is using OAuth and Cortex Code requested
scope=session:role:all from Snowflake-managed MCP metadata instead of using a
role-restricted PAT.
Fix:
-
Remove the existing Cortex MCP registration.
cortex mcp remove metatate
-
Ask your Snowflake administrator for a PAT restricted to the Metatate Cortex Code role.
-
Export the PAT.
export METATATE_CORTEX_PAT='<snowflake-pat-secret>'
-
Register again with PAT mode, which is the default.
./bin/metatate-cortex-mcp-add \ --account-url https://<account-url> \ --snowflake-role <snowflake-role> \ --write
Users should not need to change their default Snowflake role or secondary roles to fix this.
This only applies if you are intentionally testing OAuth mode.
For normal Cortex Code setup, remove the OAuth registration and use PAT mode:
cortex mcp remove metatate
./bin/metatate-cortex-mcp-add \
--account-url https://<account-url> \
--snowflake-role <snowflake-role> \
--writeFor OAuth mode, check:
- The redirect URI in Snowflake matches the loopback URI used by Cortex Code.
- The helper's
--redirect-portvalue matches the port in the Snowflake security integration. - No other local process is occupying the redirect port during authentication.
The default examples use:
http://127.0.0.1:8585/
If your Cortex Code build emits a different loopback redirect URI, ask your
administrator to alter OAUTH_REDIRECT_URI on the security integration to the
exact value used by Cortex Code.
Check the MCP registration:
cortex mcp get metatateThe URL should look like:
https://<account-url>/api/v2/databases/METATATE_APP/schemas/CORE/mcp-servers/METATATE_MCP
Ask your administrator to confirm:
SHOW MCP SERVERS IN SCHEMA METATATE_APP.CORE;Expected tools:
discover-contextget-decision-contextinspect-data-meaninginspect-governance-rulesauthorize-usevalidate-query-contextexplain-why
If cortex mcp start reports an authentication failure, verify that
METATATE_CORTEX_PAT is exported in the same shell and that the PAT is
restricted to the role configured in X-Snowflake-Role.
Check:
cortex plugin listConfirm metatate is installed and active.
Validate the plugin:
cortex plugin validate metatateThen restart Cortex Code or run:
/plugin reload
Plugin-declared MCP servers are skipped when an administrator disables user MCP servers. This plugin does not declare a hardcoded MCP server because the Snowflake account URL, PAT environment variable, app object names, and role are customer-specific.
Ask your administrator whether user MCP servers are allowed for your Cortex
Code environment. If they are disabled, the MCP server should be provided by a
managed Cortex Code profile instead of user-level mcp.json.
Metatate is the source of truth for governance decisions. Capture:
- User Snowflake role.
- Table or asset name.
- Operation and intended use.
- Decision ID or validation ID returned by Metatate.
- Cortex Code prompt used.
Then review the decision with:
/metatate:explain-decision