# Mcp Snowflake Server

> MCP Snowflake Server NSP - A Snowflake MCP server — SQL queries, schema exploration, and data insights for AI assistants

- **Type:** MCP server
- **Install:** `agentstack add mcp-nsphung-mcp-snowflake-server`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [nsphung](https://agentstack.voostack.com/s/nsphung)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [nsphung](https://github.com/nsphung)
- **Source:** https://github.com/nsphung/mcp-snowflake-server
- **Website:** https://pypi.org/project/mcp-snowflake-server-nsp/

## Install

```sh
agentstack add mcp-nsphung-mcp-snowflake-server
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

[](https://pypi.org/project/mcp-snowflake-server-nsp/) • [](https://codecov.io/gh/nsphung/mcp-snowflake-server) • [](https://pypi.org/project/mcp-snowflake-server-nsp/) • [](https://hub.docker.com/r/nsphung/mcp-snowflake-server-nsp) • [](https://opensource.org/licenses/MIT)

|                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Test           | [](https://github.com/nsphung/mcp-snowflake-server/actions/workflows/test.yml)  [](https://github.com/nsphung/mcp-snowflake-server/actions/workflows/docker-check.yml)                                                                                                                                                                                                                                                                                                                                                                          |
| Lint           | [](https://github.com/nsphung/mcp-snowflake-server/actions/workflows/lint.yml) [](https://github.com/astral-sh/ruff) [](http://mypy-lang.org/) [](https://github.com/j178/prek) [](https://oxc.rs/docs/guide/usage/formatter)                                                                                                                                                       |
| Meta           | [](./CODE_OF_CONDUCT.md) [](https://modelcontextprotocol.io/) [](https://www.python.org/) [](https://www.python.org/)                                                                                                                                                                                                                                                                                                                                                                                    |
| Security       |  [](https://github.com/nsphung/mcp-snowflake-server/actions/workflows/github-code-scanning/codeql) [](https://scorecard.dev/viewer/?uri=github.com/nsphung/mcp-snowflake-server) [](https://socket.dev/pypi/package/mcp-snowflake-server-nsp) |
| Best Practices | [](https://www.bestpractices.dev/projects/12747) [](https://www.bestpractices.dev/projects/12747)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Documentation  | [](https://deepwiki.com/nsphung/mcp-snowflake-server)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

---

# Snowflake MCP Server NSP

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server / MCP server that connects AI assistants to Snowflake — enabling SQL queries, schema exploration, and data insights directly from your LLM client.

**Highlights:**

- Multiple authentication methods: password, key-pair, external browser, OAuth 2.0 (client credentials & bearer token), TOML connection files
- TOML multi-connection config — manage `production`, `staging`, and `development` environments in one file
- Write-safety guard — write operations are disabled by default and must be explicitly enabled
- Exclusion patterns — filter out databases, schemas, or tables from discovery
- `--exclude-json-results` flag — reduces LLM context window usage
- Selective tool exclusion via `--exclude_tools`
- Prefetch mode — pre-load table schema as MCP resources
- Docker support with hardened image ([DHI](https://docs.docker.com/dhi/), nonroot user, no shell in runtime)

---

## Table of Contents

- [Snowflake MCP Server NSP](#snowflake-mcp-server-nsp)
  - [Table of Contents](#table-of-contents)
  - [Quick Start](#quick-start)
    - [Claude Code](#claude-code)
    - [Visual Studio Code (VSCode)](#visual-studio-code-vscode)
    - [OpenCode](#opencode)
  - [Components](#components)
    - [Resources](#resources)
    - [Tools](#tools)
      - [Query Tools](#query-tools)
      - [Schema Tools](#schema-tools)
      - [Analysis Tools](#analysis-tools)
  - [Authentication](#authentication)
    - [Password](#password)
    - [Key-Pair](#key-pair)
    - [External Browser](#external-browser)
    - [OAuth 2.0 Client Credentials](#oauth-20-client-credentials)
    - [OAuth Bearer Token](#oauth-bearer-token)
    - [TOML Connection File (Recommended)](#toml-connection-file-recommended)
  - [Installation](#installation)
    - [Via UVX](#via-uvx)
    - [Via Docker Hub](#via-docker-hub)
  - [Configuration Reference](#configuration-reference)
  - [Exclusion Patterns](#exclusion-patterns)
  - [License](#license)
  - [Fork and Attribution](#fork-and-attribution)

---

## Quick Start

The fastest way to try it — using `uvx` with a TOML connection file:

```bash
# 1. Create a connections file
cat > ~/snowflake_connections.toml  **Contributing or running from source?** See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for local development setup, test commands, formatting, and building the Docker image from source.

---

### Via UVX

TOML configuration (recommended)

```jsonc
"mcpServers": {
  "snowflake_production": {
    "command": "uvx",
    "args": [
      "--python=3.13",
      "--from", "mcp-snowflake-server-nsp",
      "mcp_snowflake_server",
      "--connections-file", "/path/to/snowflake_connections.toml",
      "--connection-name", "production"
      // Optional flags — see Configuration Reference
    ]
  },
  "snowflake_staging": {
    "command": "uvx",
    "args": [
      "--python=3.13",
      "--from", "mcp-snowflake-server-nsp",
      "mcp_snowflake_server",
      "--connections-file", "/path/to/snowflake_connections.toml",
      "--connection-name", "staging"
    ]
  }
}
```

Individual parameters

```jsonc
"mcpServers": {
  "snowflake": {
    "command": "uvx",
    "args": [
      "--python=3.13",
      "--from", "mcp-snowflake-server-nsp",
      "mcp_snowflake_server",
      "--account", "your_account",
      "--warehouse", "your_warehouse",
      "--user", "your_user",
      "--password", "your_password",
      "--role", "your_role",
      "--database", "your_database",
      "--schema", "your_schema"
      // Optional: "--private_key_file", "/absolute/path/key.p8"
      // Optional: "--private_key_file_pwd", "passphrase"
      // Optional flags — see Configuration Reference
    ]
  }
}
```

---

### Via Docker Hub

The image is published on [Docker Hub](https://hub.docker.com/r/nsphung/mcp-snowflake-server-nsp) — no build step required:

```bash
docker pull nsphung/mcp-snowflake-server-nsp
```

> **Note:** `-i` (`--interactive`) is required to keep stdin open for the MCP stdio transport. Do **not** use `-d` (detach).

Claude Desktop — claude_desktop_config.json

With `.env` file (see [Authentication](#authentication)):

```jsonc
"mcpServers": {
  "snowflake": {
    "command": "docker",
    "args": [
      "run", "--rm", "-i",
      "--env-file", "/absolute/path/to/.env",
      "nsphung/mcp-snowflake-server-nsp"
    ]
  }
}
```

With TOML connections file:

```jsonc
"mcpServers": {
  "snowflake": {
    "command": "docker",
    "args": [
      "run", "--rm", "-i",
      "-v", "/path/to/snowflake_connections.toml:/app/snowflake_connections.toml:ro",
      "nsphung/mcp-snowflake-server-nsp",
      "--connections-file", "/app/snowflake_connections.toml",
      "--connection-name", "production"
    ]
  }
}
```

VS Code — .vscode/mcp.json

With `.env` file:

```jsonc
"snowflake": {
  "type": "stdio",
  "command": "docker",
  "args": [
    "run", "--rm", "-i",
    "nsphung/mcp-snowflake-server-nsp"
  ],
  "envFile": "${workspaceFolder}/.env"
}
```

With TOML connections file:

```jsonc
"snowflake": {
  "type": "stdio",
  "command": "docker",
  "args": [
    "run", "--rm", "-i",
    "-v", "/path/to/snowflake_connections.toml:/app/snowflake_connections.toml:ro",
    "nsphung/mcp-snowflake-server-nsp",
    "--connections-file", "/app/snowflake_connections.toml",
    "--connection-name", "production"
  ]
}
```

OpenCode — opencode.jsonc

```jsonc
"snowflake": {
  "type": "local",
  "command": [
    "docker", "run", "--rm", "-i",
    "--env-file", "/absolute/path/to/.env",
    "nsphung/mcp-snowflake-server-nsp"
  ],
  "enabled": true,
  "timeout": 300000
}
```

---

## Configuration Reference

All connection parameters can also be set as environment variables (`SNOWFLAKE_`).

| Flag                           | Env var                          | Default      | Description                                                                                        |
| ------------------------------ | -------------------------------- | ------------ | -------------------------------------------------------------------------------------------------- |
| `--account`                    | `SNOWFLAKE_ACCOUNT`              | —            | Snowflake account identifier                                                                       |
| `--user`                       | `SNOWFLAKE_USER`                 | —            | Snowflake username                                                                                 |
| `--password`                   | `SNOWFLAKE_PASSWORD`             | —            | Password (not required for key-pair / SSO)                                                         |
| `--warehouse`                  | `SNOWFLAKE_WAREHOUSE`            | —            | Virtual warehouse to use                                                                           |
| `--database`                   | `SNOWFLAKE_DATABASE`             | _(required)_ | Default database                                                                                   |
| `--schema`                     | `SNOWFLAKE_SCHEMA`               | _(required)_ | Default schema                                                                                     |
| `--role`                       | `SNOWFLAKE_ROLE`                 | —            | Role to assume                                                                                     |
| `--private_key_file`           | `SNOWFLAKE_PRIVATE_KEY_FILE`     | —            | Absolute path to RSA or ECDSA (ES256/384/512) private key file (`.p8` / `.pem`)                    |
| `--private_key_file_pwd`       | `SNOWFLAKE_PRIVATE_KEY_FILE_PWD` | —            | Passphrase for encrypted private key                                                               |
| `--connections-file`           | —                                | —            | Path to TOML connections file                                                                      |
| `--connection-name`            | —                                | —            | Connection profile name in TOML file (required with `--connections-file`)                          |
| `--allow_write`                | —                                | `false`      | Enable `write_query` and `create_table` tools                                                      |
| `--prefetch` / `--no-prefetch` | —                                | `false`      | Pre-load table schema as `context://table/*` resources (disables `list_tables` / `describe_table`) |
| `--exclude_tools`              | —                                | `[]`         | Space-separated list of tool names to disable                                                      |
| `--exclude-json-results`       | —                                | `false`      | Omit embedded JSON resources from responses (reduces context window usage)                         |
| `--log_dir`                    | —                                | —            | Directory for log file output                                                                      |
| `--log_level`                  | —                                | `INFO`       | Log verbosity: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`                                     |

---

## Exclusion Patterns

Edit [`runtime_config.json`](https://github.com/nsphung/mcp-snowflake-server/blob/main/runtime_config.json) to exclude databases, schemas, or tables from all discovery tools. Patterns are matched case-insensitively as substrings.

```json
{
  "exclude_patterns": {
    "databases": ["temp"],
    "schemas": ["temp", "information_schema"],
    "tables": ["temp"]
  }
}
```

The server loads this file automatically at startup from the working directory.

---

## License

This project is licensed under the **MIT License**. See the [`LICENSE`](https://github.com/nsphung/mcp-snowflake-server/blob/main/LICENSE) file for the full text.

---

## Fork and Attribution

This repository is a fork of [`isaacwasserman/mcp-snowflake-server`](https://github.com/isaacwasserman/mcp-snowflake-server).

[](https://mseep.ai/app/isaacwasserman-mcp-snowflake-server)

- Upstream authors and contributors retain copyright for their contributions.
- Fork-specific changes are maintained by `nsphung`.
- A summary of notable modifications is tracked in [`NOTICE`](https://github.com/nsphung/mcp-snowflake-server/blob/main/NOTICE).

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [nsphung](https://github.com/nsphung)
- **Source:** [nsphung/mcp-snowflake-server](https://github.com/nsphung/mcp-snowflake-server)
- **License:** MIT
- **Homepage:** https://pypi.org/project/mcp-snowflake-server-nsp/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-nsphung-mcp-snowflake-server
- Seller: https://agentstack.voostack.com/s/nsphung
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
