Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

setup-snowflake

БесплатноБез исполняемых скриптовНе проверен

This skill should be used before any Snowflake command to verify MCP connectivity, guide users through access provisioning, and set the session context…

openshift-engот openshift-eng★ 123 звезды на GitHub

Об этом скилле

Setup Snowflake Connection

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.

When to Use This Skill

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.

Implementation Steps

Step 1: Check MCP Availability

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.

Step 2: Automated Setup

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.

2a: Ensure uvx Is Installed

Use 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 the uv Python 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

2b: Ask for Snowflake Username

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.

2c: Write Snowflake Connection Config

First check if ~/.snowflake/connections.toml already exists with a [rhprod] section containing the correct username. If it does, skip this step.

Otherwise:

  1. Create the directory if needed:
mkdir -p ~/.snowflake
  1. Use the Write tool to create ~/.snowflake/connections.toml (replacing THE_USERNAME with the username from Step 2b):
[rhprod]
account = "GDADCLC-RHPROD"
user = "THE_USERNAME"
authenticator = "EXTERNALBROWSER"
  1. Set secure permissions:
chmod 0600 ~/.snowflake/connections.toml

2d: Write Service Config

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

2e: Add MCP Server to Claude Code Config

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.

2f: Instruct User to Restart

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.

Step 3: Set Session Context

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 fa

Полный SKILL.md на GitHub

Установить setup-snowflake в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл setup-snowflake?

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.

Как установить скилл setup-snowflake?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл setup-snowflake запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить setup-snowflake с