File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 16
16
SNOWFLAKE_DATABASE = os .environ .get ("SNOWFLAKE_DATABASE" )
17
17
SNOWFLAKE_SCHEMA = os .environ .get ("SNOWFLAKE_SCHEMA" )
18
18
SNOWFLAKE_WAREHOUSE = os .environ .get ("SNOWFLAKE_WAREHOUSE" , "DEFAULT" )
19
+ INTERNAL_GATEWAY = os .environ .get ("INTERNAL_GATEWAY" , "false" )
19
20
20
21
# Snowflake token handling - for stdio transport, get from environment
21
22
# For other transports, it will be retrieved from request context in tools layer
Original file line number Diff line number Diff line change 3
3
4
4
from mcp .server .fastmcp import FastMCP
5
5
6
- from config import MCP_TRANSPORT , SNOWFLAKE_TOKEN
6
+ from config import MCP_TRANSPORT , SNOWFLAKE_TOKEN , INTERNAL_GATEWAY
7
7
from database import (
8
8
execute_snowflake_query ,
9
9
format_snowflake_row ,
18
18
19
19
def get_snowflake_token (mcp : FastMCP ) -> Optional [str ]:
20
20
"""Get Snowflake token from either config (stdio) or request headers (non-stdio)"""
21
- if MCP_TRANSPORT == "stdio" :
21
+ if MCP_TRANSPORT == "stdio" or INTERNAL_GATEWAY . lower () == "true" :
22
22
return SNOWFLAKE_TOKEN
23
23
else :
24
24
try :
You can’t perform that action at this time.
0 commit comments