{"id":26590524,"url":"https://github.com/dynamike/mcp-server-snowflake","last_synced_at":"2025-03-23T13:52:36.067Z","repository":{"id":283519648,"uuid":"948510921","full_name":"dynamike/mcp-server-snowflake","owner":"dynamike","description":"MCP Server for connecting to Snowflake","archived":false,"fork":false,"pushed_at":"2025-03-20T16:35:25.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T17:33:58.074Z","etag":null,"topics":["modelcontextprotocol","snowflake"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dynamike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-14T13:17:25.000Z","updated_at":"2025-03-20T16:35:29.000Z","dependencies_parsed_at":"2025-03-20T17:44:18.129Z","dependency_job_id":null,"html_url":"https://github.com/dynamike/mcp-server-snowflake","commit_stats":null,"previous_names":["dynamike/mcp-server-snowflake"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynamike%2Fmcp-server-snowflake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynamike%2Fmcp-server-snowflake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynamike%2Fmcp-server-snowflake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynamike%2Fmcp-server-snowflake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dynamike","download_url":"https://codeload.github.com/dynamike/mcp-server-snowflake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245111930,"owners_count":20562511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["modelcontextprotocol","snowflake"],"created_at":"2025-03-23T13:52:35.513Z","updated_at":"2025-03-23T13:52:36.057Z","avatar_url":"https://github.com/dynamike.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MCP Server for Snowflake\n\nA Model Context Protocol (MCP) server for performing read-only operations against Snowflake databases. This tool enables Claude to securely query Snowflake data without modifying any information.\n\n## Features\n\n- Secure connection to Snowflake using service account authentication with private key\n- MCP-compatible handlers for querying Snowflake data\n- Read-only operations with security checks to prevent data modification\n- Support for Python 3.12+\n- Stdio-based MCP server for easy integration with Claude Desktop\n\n## Available Tools\n\nThe server provides the following tools for querying Snowflake:\n\n- **list_databases**: List all accessible Snowflake databases\n- **list_views**: List all views in a specified database and schema\n- **describe_view**: Get detailed information about a specific view including columns and SQL definition\n- **query_view**: Query data from a view with an optional row limit\n- **execute_query**: Execute custom read-only SQL queries (SELECT only) with results formatted as markdown tables\n\n## Installation\n\n### Prerequisites\n\n- Python 3.12 or higher\n- A Snowflake account with a configured service account (username + private key)\n- [uv](https://github.com/astral-sh/uv) package manager (recommended)\n\n### Steps\n\n1. Clone this repository:\n   ```\n   git clone https://github.com/yourusername/mcp-server-snowflake.git\n   cd mcp-server-snowflake\n   ```\n\n2. Install the package:\n   ```\n   uv pip install -e .\n   ```\n\n3. Create a `.env` file based on `.env.example` with your Snowflake credentials:\n   ```\n   SNOWFLAKE_ACCOUNT=youraccount.region\n   SNOWFLAKE_USER=your_service_account_username\n   SNOWFLAKE_PRIVATE_KEY_PATH=/absolute/path/to/your/rsa_key.p8\n   SNOWFLAKE_WAREHOUSE=your_warehouse\n   SNOWFLAKE_DATABASE=your_database\n   SNOWFLAKE_SCHEMA=your_schema\n   SNOWFLAKE_ROLE=your_role\n   ```\n\n## Usage\n\n### Running with uv\n\nAfter installing the package, you can run the server directly with:\n\n```\nuv run snowflake-mcp\n```\n\nThis will start the stdio-based MCP server, which can be connected to Claude Desktop or any MCP client that supports stdio communication.\n\n### Claude Desktop Integration\n\n1. In Claude Desktop, go to Settings → MCP Servers\n2. Add a new server with the full path to your uv executable:\n   ```yaml\n   \"snowflake-mcp-server\": {\n      \"command\": \"uv\",\n      \"args\": [\n         \"--directory\",\n         \"/\u003cpath-to-code\u003e/mcp-server-snowflake\",\n         \"run\",\n         \"snowflake-mcp\"\n      ]\n   }\n   ```\n3. You can find your uv path by running `which uv` in your terminal\n4. Save the server configuration\n\n### Example Queries\n\nWhen using with Claude, you can ask questions like:\n\n- \"Can you list all the databases in my Snowflake account?\"\n- \"List all views in the MARKETING database\"\n- \"Describe the structure of the CUSTOMER_ANALYTICS view in the SALES database\"\n- \"Show me sample data from the REVENUE_BY_REGION view in the FINANCE database\"\n- \"Run this SQL query: SELECT customer_id, SUM(order_total) as total_spend FROM SALES.ORDERS GROUP BY customer_id ORDER BY total_spend DESC LIMIT 10\"\n- \"Query the MARKETING database to find the top 5 performing campaigns by conversion rate\"\n\n## Security Considerations\n\nThis server:\n- Enforces read-only operations (only SELECT statements are allowed)\n- Automatically adds LIMIT clauses to prevent large result sets\n- Uses service account authentication for secure connections\n- Validates inputs to prevent SQL injection\n\n⚠️ **Important**: Keep your `.env` file secure and never commit it to version control. The `.gitignore` file is configured to exclude it.\n\n## Development\n\n### Static Type Checking\n\n```\nmypy mcp_server_snowflake/\n```\n\n### Linting\n\n```\nruff check .\n```\n\n### Formatting\n\n```\nruff format .\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Technical Details\n\nThis project uses:\n- [Snowflake Connector Python](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector) for connecting to Snowflake\n- [MCP (Model Context Protocol)](https://github.com/anthropics/anthropic-cookbook/tree/main/mcp) for interacting with Claude\n- [Pydantic](https://docs.pydantic.dev/) for data validation\n- [python-dotenv](https://github.com/theskumar/python-dotenv) for environment variable management\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynamike%2Fmcp-server-snowflake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdynamike%2Fmcp-server-snowflake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynamike%2Fmcp-server-snowflake/lists"}