Skip to content

feat: Prepare package for PyPI publishing as mcp_snowflake #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
28 changes: 28 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Example .env file - Choose your preferred authentication method
# This file shows available configuration options - do not use directly

# Authentication Type Options:
# - private_key: Use service account with private key authentication (non-interactive)
# - external_browser: Use browser-based authentication (interactive)
SNOWFLAKE_AUTH_TYPE=private_key

# Connection Parameters (required)
SNOWFLAKE_ACCOUNT=your_account_id.your_region
SNOWFLAKE_USER=your_username

# Private Key Authentication Parameters (required if using private_key auth)
SNOWFLAKE_PRIVATE_KEY_PATH=/absolute/path/to/your/private_key.p8

# Optional Parameters
SNOWFLAKE_WAREHOUSE=your_warehouse
SNOWFLAKE_DATABASE=your_database
SNOWFLAKE_SCHEMA=your_schema
SNOWFLAKE_ROLE=your_role

# Connection Pooling Settings
# Time interval in hours between automatic connection refreshes (default: 8)
SNOWFLAKE_CONN_REFRESH_HOURS=8

# For more detailed examples, see:
# .env.private_key.example - For service account with private key authentication
# .env.browser.example - For external browser authentication
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to PyPI

on:
release:
types: [created]

permissions:
contents: read
id-token: write # For trusted publishing

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install uv
uses: astral-sh/setup-uv-action@v0

- name: Install build dependencies
run: |
uv pip install build

- name: Build package
run: |
python -m build

- name: Publish to PyPI
uses: pypa/[email protected]
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
2 changes: 1 addition & 1 deletion mcp_server_snowflake/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""MCP server for performing read-only operations against Snowflake."""

__version__ = "0.1.0"
__version__ = "0.2.0"
26 changes: 23 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,25 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "mcp-server-snowflake"
name = "mcp_snowflake"
version = "0.2.0"
description = "MCP server for performing read-only operations against Snowflake"
readme = "README.md"
requires-python = ">=3.12"
license = { text = "MIT" }
authors = [
{name = "MCP Server Team"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Topic :: Database",
"Topic :: Software Development :: Libraries :: Python Modules"
]
keywords = ["snowflake", "mcp", "claude", "database", "sql"]
dependencies = [
"snowflake-connector-python>=3.8.0",
"pydantic>=2.4.2",
Expand All @@ -19,8 +32,12 @@ dependencies = [
"sqlglot>=11.5.5"
]

[project.urls]
Repository = "https://github.com/dynamike/mcp-server-snowflake"
Issues = "https://github.com/dynamike/mcp-server-snowflake/issues"

[project.scripts]
snowflake-mcp = "mcp_server_snowflake.main:run_stdio_server"
mcp-snowflake = "mcp_server_snowflake.main:run_stdio_server"

[project.optional-dependencies]
dev = [
Expand All @@ -45,4 +62,7 @@ disallow_untyped_defs = true
disallow_incomplete_defs = true

[tool.pytest.ini_options]
testpaths = ["tests"]
testpaths = ["tests"]

[tool.hatch.build.targets.wheel]
packages = ["mcp_server_snowflake"]
Loading