mcp-server-milan-datawarehouse
Provides read-only access to Snowflake data warehouses: discovers tables and columns, describes table schemas, runs guarded SELECT queries, returns TSV results, and pages truncated results via RESULT_SCAN.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-milan-datawarehouse Find tables about orders and show the 10 most recent orders."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-milan-datawarehouse
A read-only MCP server for Snowflake. It lets an
LLM explore your warehouse schema and run SELECT queries — and nothing else.
Built for two things: safety by default and low token cost.
Why another Snowflake MCP server
Most database MCP servers dump the whole schema into the tool descriptions. That schema is then re-sent to the model on every request, whether or not a tool is called. This one does the opposite:
Decision | Effect |
4 tools, not 30 | A few hundred tokens of tool definitions per request, not thousands |
Schema discovered on demand ( | No schema in the prompt at all |
TSV output instead of JSON | Keys are not repeated per row; typically 60–75% fewer output tokens |
100-row default, continue via | The query is not re-run to page; less compute and fewer tokens |
Static tool text | The prefix stays cacheable across turns |
Run python scripts/measure_tokens.py to see the current cost of tools/list on your
build. The budget is 1,200 tokens and tests/test_tools.py fails if it is exceeded.
Related MCP server: Snowflake MCP Server (Read-Only)
Install
uvx mcp-server-milan-datawarehouseor
pipx install mcp-server-milan-datawarehouseRequires Python 3.11+.
Configure
Everything comes from environment variables. Copy .env.example and fill it in.
Variable | Required | Purpose |
| yes |
|
| yes* | login name of the read-only service user |
| * | password, if not using key-pair |
| * | path to |
| no | passphrase for the key |
| * | reuse an entry from |
| recommended | the read-only role |
| recommended | warehouse to run on |
| recommended | default database |
| no | default schema |
| recommended |
|
| no | ceiling for |
| no | seconds, set on every session (default |
| no |
|
* exactly one auth method is required: key-pair, password, or connection name.
Key-pair is recommended: it survives MFA enforcement and cannot be replayed.
Client config (Claude Desktop / Cursor)
{
"mcpServers": {
"milan-dw": {
"command": "uvx",
"args": ["mcp-server-milan-datawarehouse"],
"env": {
"SNOWFLAKE_ACCOUNT": "myorg-myaccount",
"SNOWFLAKE_USER": "DW_MCP_READONLY",
"SNOWFLAKE_PRIVATE_KEY_PATH": "/Users/me/.snowflake/rsa_key.p8",
"SNOWFLAKE_ROLE": "DW_MCP_READONLY",
"SNOWFLAKE_WAREHOUSE": "COMPUTE_WH",
"SNOWFLAKE_DATABASE": "ANALYTICS",
"ALLOWED_SCHEMAS": "ANALYTICS.PUBLIC,ANALYTICS.MARTS"
}
}
}
}Tools
Tool | What it does |
| Finds tables/columns by name or comment. One line per table. |
| Columns as TSV: name, type, nullable, comment. Optional ≤5 sample rows. |
| Runs one read-only statement. Returns TSV. |
| Pages a truncated result via |
Output contract
One header line, then one row per line, tab-separated. NULL is an empty cell.
Dates are ISO-8601, decimals keep at most 6 places, cells over 200 characters are
truncated with …, columns that are entirely null are dropped. The executed SQL is
never echoed back. When a result is cut, the last line starts with # and carries
the cursor_id needed to continue.
order_id city amount
1001 Tehran 12500
1002 Karaj 8300.5
# truncated at 2 rows; fetch_more(cursor_id="01b2c3d4-...")Security model
Two layers, and only the second one is a real boundary.
Layer 1 — the SQL guard (guard.py). One statement only. Comments are stripped,
string literals and quoted identifiers are masked before keyword scanning, and the
statement must start with SELECT, WITH, EXPLAIN, SHOW, DESCRIBE or DESC.
Anything containing INSERT, UPDATE, DELETE, MERGE, CREATE, DROP, ALTER,
TRUNCATE, GRANT, REVOKE, COPY, PUT, GET, CALL, USE, COMMIT and
friends is rejected. Every session also sets STATEMENT_TIMEOUT_IN_SECONDS and a
QUERY_TAG so runaway queries and their origin are visible in QUERY_HISTORY.
Layer 2 — the role. This is what actually protects your warehouse. Use a role that cannot write:
CREATE ROLE DW_MCP_READONLY;
GRANT USAGE ON WAREHOUSE COMPUTE_WH TO ROLE DW_MCP_READONLY;
GRANT USAGE ON DATABASE ANALYTICS TO ROLE DW_MCP_READONLY;
GRANT USAGE ON SCHEMA ANALYTICS.PUBLIC TO ROLE DW_MCP_READONLY;
GRANT SELECT ON ALL TABLES IN SCHEMA ANALYTICS.PUBLIC TO ROLE DW_MCP_READONLY;
GRANT SELECT ON FUTURE TABLES IN SCHEMA ANALYTICS.PUBLIC TO ROLE DW_MCP_READONLY;
GRANT ROLE DW_MCP_READONLY TO USER DW_MCP_READONLY;The guard is a guard rail for mistakes, not a sandbox. If you run this server with an account that can write, nothing here will stop it. Do not do that.
For the strongest posture, point the server at secure views instead of base tables, and never at a schema containing PII.
Limits
Only objects created with unquoted (upper-case) identifiers are found; quoted lower-case identifiers are not supported.
INFORMATION_SCHEMAis read per database, soALLOWED_SCHEMASmust list every database you want to search.fetch_moreworks within Snowflake's result-retention window (24h by default).No write path, by design. There is no plan to add one.
Development
git clone https://github.com/Saideh-Heshmati/mcp-server-milan-datawarehouse
cd mcp-server-milan-datawarehouse
pip install -e ".[dev]"
pytest
python scripts/measure_tokens.pyTests need no Snowflake account — the connector is stubbed.
License
MIT
Available Tools
4 toolsdescribe_tableC
Columns of one table as TSV: name, type, nullable, comment.
Inputs: table (required), sample_rows. Returns: result
fetch_moreC
Continue a truncated result using its cursor_id.
Inputs: cursor_id (required), offset, max_rows. Returns: result
run_queryA
Run one read-only SELECT/WITH query. Returns TSV: header then rows.
Inputs: sql (required), max_rows. Returns: result
search_schemaB
Search table and column names in allowed schemas. One line per match.
Inputs: query (required), limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool occupies a distinct step in the read-only query lifecycle: discovery (search_schema), structure inspection (describe_table), execution (run_query), and pagination (fetch_more). The boundary between run_query and fetch_more is made explicit by the cursor_id reference, so misselection is unlikely.
All four tools follow a consistent snake_case verb_noun pattern (search_schema, describe_table, run_query, fetch_more). Verb choices are distinct and accurately describe the action.
Four tools is a tight, well-scoped surface for a read-only data warehouse inspector; each tool corresponds to a necessary stage of schema discovery and querying. No tool feels redundant or missing at this count.
The read-only lifecycle is fully covered: find tables/columns, inspect structure, execute SELECT/WITH, and paginate truncated results. Minor gaps remain—no way to enumerate schemas/tables directly or inspect keys, constraints, and indexes beyond column metadata.
Related MCP Connectors
List databases and tables, describe columns and run SQL statements in Snowflake.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Query BigQuery, Snowflake, Redshift & Azure Synapse with natural language
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables AI assistants to securely connect to Snowflake data warehouses and execute SQL queries through natural language interactions. Supports multiple authentication methods and provides formatted query results with built-in security controls.12MIT
- AlicenseNot gradedqualityDmaintenanceEnables read-only interaction with Snowflake databases through SQL queries, schema exploration, and data insight tracking. Provides tools to query data, list databases/schemas/tables, describe table structures, and maintain a memo of discovered insights.GPL 3.0
- AlicenseAqualityDmaintenanceEnables AI agents to execute SQL queries and explore Snowflake databases using natural language, with schema discovery, table inspection, and readonly mode.11145 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables read-only querying of Snowflake databases through Claude, supporting multiple authentication methods and SQL operations like SELECT, SHOW, DESCRIBE.14MIT