Skip to content
Merged
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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ uvx snowflake-labs-mcp --service-config-file config.yaml --transport streamable-
```

## Transport Customizations
The below server customizations are available when running with `sse` and `streamable-http` transports.
Server customizations available for `sse` and `streamable-http` transports:

| Server Parameter | CLI Arguments | Environment Variable | Default |
| Parameter | CLI Argument | Environment Variable | Default |
|-----------|--------------|---------------------|------------------|
| Host | --server-host | SNOWFLAKE_MCP_HOST | "0.0.0.0"
| Port | --port | SNOWFLAKE_MCP_PORT | 9000
| Endpoint | --endpoint | SNOWFLAKE_MCP_ENDPOINT | /mcp
| Debug Logging | --verbose | SNOWFLAKE_MCP_VERBOSE | false

Example:
```bash
Expand Down Expand Up @@ -574,7 +575,8 @@ Once launched, the inspector will open a web interface where you can:
- View real-time logs as you interact with the MCP server

**Command Line Debugging:**
Add verbose logging to see detailed connection and execution information:

Enable debug logging with `--verbose` or set `SNOWFLAKE_MCP_VERBOSE=true`:
```bash
uvx snowflake-labs-mcp --service-config-file <path_to_file>/tools_config.yaml --connection-name "default" --verbose
```
Expand Down
20 changes: 20 additions & 0 deletions mcp_server_snowflake/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,13 @@ def parse_arguments():
help="Endpoint path for the MCP server (default: /mcp)",
default="/mcp",
)
parser.add_argument(
"--verbose",
action="store_true",
required=False,
help="Enable verbose/debug logging",
default=False,
)

return parser.parse_args()

Expand Down Expand Up @@ -598,6 +605,19 @@ def initialize_tools(snowflake_service: SnowflakeService, server: FastMCP):
def main():
args = parse_arguments()

# Configure logging level based on verbose flag or environment variable
if args.verbose or os.getenv("SNOWFLAKE_MCP_VERBOSE", "").lower() in (
"true",
"1",
"yes",
):
import logging

logging.getLogger().setLevel(logging.DEBUG)
logging.getLogger("fastmcp").setLevel(logging.DEBUG)
logging.getLogger(server_name).setLevel(logging.DEBUG)
logger.debug("Verbose/debug logging enabled")

warn_deprecated_params()

# Create server with lifespan that has access to args
Expand Down
Loading