Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Snowflake Cortex AI Model Context Protocol (MCP) Server
statement_type# Snowflake Cortex AI Model Context Protocol (MCP) Server

<a href="https://emerging-solutions-toolbox.streamlit.app/">
<img src="https://github.com/user-attachments/assets/aa206d11-1d86-4f32-8a6d-49fe9715b098" alt="image" width="150" align="right";">
Expand Down Expand Up @@ -86,6 +86,7 @@ sql_statement_permissions: # List SQL statements to explicitly allow (True) or d
- Merge: True
- Rollback: True
- Select: True
- Show: True
- Transaction: True
- TruncateTable: True
- Unknown: False # To allow unknown or unmapped statement types, set Unknown: True.
Expand Down
3 changes: 3 additions & 0 deletions mcp_server_snowflake/query_manager/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def get_statement_type(sql_string):

# The expression type is the class of the root node.
statement_type = type(expression_tree).__name__
# Treat SHOW ... command as a separate type, to allow SHOW [AGENT] as an example
if statement_type == "Command" and sql_string.strip().upper().startswith("SHOW"):
return "Show"

return statement_type
except (
Expand Down
2 changes: 2 additions & 0 deletions mcp_server_snowflake/tests/test_query_manager_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def test_parse_json_colon_path_with_cast(self):
def test_column_colon_path_with_cast(self):
assert get_statement_type("SELECT v:city::string FROM t") == "Select"

def test_show_agent(self):
assert get_statement_type("SHOW AGENTS IN SCHEMA ABC") == "Show"

class TestSnowflakeSpecificSyntax:
"""Additional Snowflake dialect coverage: COPY INTO, LATERAL FLATTEN, etc."""
Expand Down