Skip to main content

ae-mcp

A small, fast MCP server for Snowflake. Four tools, one file, browser SSO auth.

Auth

Authenticates via externalbrowser SSO. The connector caches the SSO ID token locally (in the OS keyring, via the secure-local-storage extra), so the browser only opens when the cached token expires — not on every server restart. Caching requires this once on the account (ask an admin if it isn't already set):

ALTER ACCOUNT SET ALLOW_ID_TOKEN = TRUE;

While the server process is running, CLIENT_SESSION_KEEP_ALIVE holds the session open indefinitely — you won't be re-prompted mid-session.

Install

Windows and macOS (Python 3.11+):

python -m pip install --user ae-mcp

Or:

uv tool install ae-mcp

Configure (Cursor / Claude Desktop / Claude Code)

{
  "mcpServers": {
    "ae-mcp": {
      "command": "ae-mcp",
      "env": {
        "SNOWFLAKE_ACCOUNT": "myorg-myaccount",
        "SNOWFLAKE_USER": "me@example.com",
        "SNOWFLAKE_ROLE": "ANALYST_ROLE",
        "SNOWFLAKE_WAREHOUSE": "COMPUTE_WH",
        "SNOWFLAKE_MCP_ALLOW_WRITE": "false"
      }
    }
  }
}

SNOWFLAKE_MCP_ALLOW_WRITE is shown explicitly above as a reminder — it's false (read-only) by default even if omitted entirely.

Optional env: SNOWFLAKE_DATABASE, SNOWFLAKE_SCHEMA.

Tools

Tool Purpose
snowflake_query Run SQL; results capped (default 50 rows, max 1000), wide cells truncated
snowflake_list_objects SHOW TERSE databases/schemas/tables/views/warehouses/roles with LIKE filter
snowflake_describe_table Column definitions (metadata-only, no warehouse compute)
snowflake_session_info Current user/role/warehouse/db + connection age

Performance notes

  • One lazy connection, kept alive with CLIENT_SESSION_KEEP_ALIVE, reused across calls; auto-reconnects once on session expiry.
  • Blocking connector calls run in a worker thread — the MCP event loop never stalls.
  • SHOW TERSE / DESCRIBE are metadata operations: instant results, no warehouse credits.
  • STATEMENT_TIMEOUT_IN_SECONDS=300 guards against runaway queries.

Safety

Secure by default. snowflake_query is read-only out of the box — no env var needs to be set for that. Writes (INSERT/UPDATE/DELETE/MERGE/ CREATE/DROP/ALTER/TRUNCATE/GRANT/REVOKE/COPY/CALL/etc.) are blocked unless explicitly enabled.

Env var Default Effect
SNOWFLAKE_MCP_ALLOW_WRITE false Set true to allow non-read-only statements
SNOWFLAKE_MCP_READ_ONLY false Set true for a hard override: always read-only, ignoring ALLOW_WRITE entirely

The read-only guard, when active:

  • Allows only statements starting with SELECT/SHOW/DESCRIBE/DESC/ EXPLAIN/WITH/LIST/USE.
  • Also scans the whole statement (not just the first keyword) for write-capable keywords, so a CTE prefix can't smuggle a write past the first-token check (WITH x AS (...) INSERT INTO ... is blocked, not just a bare INSERT).
  • Rejects stacked statements — anything after a ; other than trailing whitespace (SELECT 1; DROP TABLE x;) is blocked outright.
  • Ignores keywords found inside string/identifier literals and comments, so a column named e.g. delete_flag or a literal containing the word "insert" doesn't trigger a false block.

Call snowflake_session_info any time to see the live gating state (which of the two env vars is active) alongside connection details. A blocked snowflake_query call returns an error explaining which env var to set — no SQL is ever sent to Snowflake for a blocked statement.

This is a keyword/pattern guard, not a full SQL parser — it's meant to stop accidental or casual writes from an LLM-driven client, not to withstand a determined adversary with control over the input. If you need real guarantees, use a read-only Snowflake role for this connection rather than relying on the guard alone.

Metadata

Release files for ae-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ae-mcp 0.2.0
File Size Uploaded Provenance
ae_mcp-0.2.0.tar.gz 12.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ae-mcp 0.2.0
File Interpreter ABI Platform
ae_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / ae_mcp-0.2.0.tar.gz

Download URL ae_mcp-0.2.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
415f8334f54f307acbe3b03010866822eeaa7a4bc4b102abef943c70ff849b97
BLAKE2b-256 checksum
How to use checksums
0819dd93f4fb8e46a8987ae8e08fcc7b9f6aaeba4404a2f7eb9fb41992cc13b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ae_mcp-0.2.0-py3-none-any.whl

Download URL ae_mcp-0.2.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
172c42b3f2e04432443454546b568d2e169b1529a99a80055c04073614f93577
BLAKE2b-256 checksum
How to use checksums
75a311c9e2c22babb9b1acc646294588d6acd4ab39d50553c20b938970379a5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ae-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page