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/DESCRIBEare metadata operations: instant results, no warehouse credits.STATEMENT_TIMEOUT_IN_SECONDS=300guards 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 bareINSERT). - 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_flagor 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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ae_mcp-0.2.0.tar.gz.
File metadata
- Download URL: ae_mcp-0.2.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
415f8334f54f307acbe3b03010866822eeaa7a4bc4b102abef943c70ff849b97
|
|
| MD5 |
d70a9537279b76cef27d28281f35f396
|
|
| BLAKE2b-256 |
0819dd93f4fb8e46a8987ae8e08fcc7b9f6aaeba4404a2f7eb9fb41992cc13b2
|
File details
Details for the file ae_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ae_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
172c42b3f2e04432443454546b568d2e169b1529a99a80055c04073614f93577
|
|
| MD5 |
809ea4d3dac6686995d52f52b53a0394
|
|
| BLAKE2b-256 |
75a311c9e2c22babb9b1acc646294588d6acd4ab39d50553c20b938970379a5d
|