plugins/snowflake/skills/setup-snowflake/SKILL.md
This skill should be used before any Snowflake command to verify MCP connectivity, guide users through access provisioning, and set the session context. Invoke this skill proactively whenever a command needs Snowflake data access.
npx skillsauth add openshift-eng/ai-helpers setup-snowflakeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill verifies that the Snowflake MCP server is available and can execute queries. If it is not, it performs automated setup -- the user only needs to provide their Snowflake username. This skill should be invoked at the start of every command that needs Snowflake data.
Use this skill automatically at the beginning of any Snowflake-dependent command (e.g., /snowflake:activity-type-report). Do not skip this step -- it ensures the user has a working connection before any queries are attempted.
Attempt to call the Snowflake MCP tool to verify it exists:
mcp__snowflake__execute_sql(query="SELECT CURRENT_USER()")
If the tool is available and succeeds, proceed to Step 3.
If the tool is not available (MCP server not configured) or the call fails because the server cannot start, proceed to Step 2.
When the Snowflake MCP server is not available, perform the following sub-steps. Each sub-step is idempotent -- skip it if the expected state already exists.
uvx Is InstalledUse the Bash tool to check if uvx is available:
which uvx
If uvx is not found, tell the user:
The Snowflake MCP server requires
uvx(part of theuvPython package manager). I need to install it.
Then install it (after the user grants permission). Use the appropriate method for the platform:
# Fedora/RHEL
dnf install -y uv
# macOS
brew install uv
# Other
curl -LsSf https://astral.sh/uv/install.sh | sh
Ask the user for their Snowflake username. It must be in ALL CAPS (e.g., BLEANHAR). Say:
What is your Snowflake username? It should be in ALL CAPS (e.g.,
BLEANHAR).If you don't have Snowflake access yet, follow the instructions at: https://dataverse.pages.redhat.com/data-docs/data-users/
Once you have access, come back and re-run this command.
Wait for the user to provide the username before proceeding. If they indicate they don't have access, stop setup and inform them to re-run the command after obtaining access.
First check if ~/.snowflake/connections.toml already exists with a [rhprod] section containing the correct username. If it does, skip this step.
Otherwise:
mkdir -p ~/.snowflake
~/.snowflake/connections.toml (replacing THE_USERNAME with the username from Step 2b):[rhprod]
account = "GDADCLC-RHPROD"
user = "THE_USERNAME"
authenticator = "EXTERNALBROWSER"
chmod 0600 ~/.snowflake/connections.toml
Check if ~/.snowflake/service_config.yaml already exists. If it does with the correct content, skip this step.
Otherwise, use the Write tool to create ~/.snowflake/service_config.yaml:
other_services:
object_manager: true
query_manager: true
sql_statement_permissions:
- all: true
Read ~/.claude.json and check whether mcpServers.snowflake already exists with the correct configuration (including --service-config-file). If it already matches, skip this step.
Otherwise, use the Edit tool to add or update the mcpServers.snowflake entry in ~/.claude.json. The entry should be:
{
"type": "stdio",
"command": "uvx",
"args": [
"--from", "git+https://github.com/Snowflake-Labs/mcp",
"mcp-server-snowflake",
"--connection-name", "rhprod",
"--service-config-file", "~/.snowflake/service_config.yaml"
],
"env": {}
}
If mcpServers does not exist as a top-level key in ~/.claude.json, create it. If it exists but does not contain snowflake, add the snowflake key. If snowflake exists but has incorrect or outdated configuration (e.g., missing --service-config-file), update it.
Important: Preserve all other existing content in ~/.claude.json. Only add or modify the mcpServers.snowflake key.
After completing steps 2a-2e, tell the user:
Snowflake MCP server has been configured. You need to restart Claude Code for the new MCP server to be loaded.
After restarting, re-run your command and setup will complete automatically (browser-based SSO will open for authentication on first connect).
Then stop the current command and inform the user why. Do not attempt to proceed to Step 3 -- the MCP server will not be available until Claude Code restarts.
Once the MCP tool is confirmed available, set the database, schema, and role for the session:
mcp__snowflake__execute_sql(query="USE ROLE PUBLIC")
mcp__snowflake__execute_sql(query="USE DATABASE JIRA_DB")
mcp__snowflake__execute_sql(query="USE SCHEMA CLOUDRHAI_MARTS")
If any of these fail (e.g., role not granted), inform the user:
Your Snowflake account does not have the
PUBLICrole. Please request access through the access provisioning process at:https://dataverse.pages.redhat.com/data-docs/data-users/
Run a quick verification query to confirm the user can read from the expected views:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA = 'CLOUDRHAI_MARTS'
ORDER BY TABLE_NAME
LIMIT 5
If this returns results, the connection is verified. Report success and return the list of available views for diagnostic purposes.
If this returns an error or zero rows, warn the user that the schema may not be accessible with their current role.
Note: CLOUDRHAI_MARTS exposes views, not base tables. SHOW TABLES will return nothing — use SHOW VIEWS or query INFORMATION_SCHEMA.VIEWS as above.
snowsql -a GDADCLC-RHPROD -u YOUR_USERNAME --authenticator externalbrowser to refresh browser-based auth, then retryuvx install failure: Suggest manual installation via curl -LsSf https://astral.sh/uv/install.sh | sh~/.claude.json parse error: If the file contains invalid JSON, warn the user and do not attempt to modify it. Ask them to fix it manually.EXTERNALBROWSER authenticator triggers a browser-based SSO flow. This works in local development environments but may not work in headless CI containers.--service-config-file argument is required for the Snowflake MCP server to enable the query manager and object manager services. Without it, the server fails to start.connections.toml file must have 0600 permissions or the Snowflake connector will emit warnings.tools
Analyze a JIRA issue and create a pull request to solve it. Use when the user wants to implement a fix or feature described in a Jira issue, push a branch, and open a draft PR.
development
Use when a deeper level of code review is requested. Multi-agent panel code review with specialist reviewers and forced runtime reproducers for all BLOCKING bug findings. Optionally posts to GitHub/GitLab as a PENDING review.
development
Review agentic documentation — verify claims locally against source code first, then use chai-bot for cross-repo and cross-functional verification
development
Use this skill when debugging a failed Prow CI job.