Metadata-Version: 2.4
Name: snowsyncmd-mcp
Version: 1.1.0
Summary: MCP server for the SnowSyncMD Snowflake Native App — exposes schema docs, structured object search, column inspection, and real-time annotations as Claude tools
Project-URL: Homepage, https://github.com/your-org/snowsyncmd
Project-URL: PyPI, https://pypi.org/project/snowsyncmd-mcp
License: MIT
Keywords: claude,documentation,mcp,schema,snowflake
Requires-Python: >=3.11
Requires-Dist: mcp>=1.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: snowflake-connector-python>=3.0.0
Description-Content-Type: text/markdown

# SnowSyncMD MCP Server

Connects Claude Code directly to your SnowSyncMD app so Claude can read
Snowflake schema documentation automatically — no copy-pasting, no manual downloads.

## How it works

```
You ask Claude: "Write a query joining ORDERS to CUSTOMERS"
       ↓
Claude calls MCP tool: snowflake_get_schema("MY_DB", "SALES", "ORDERS")
Claude calls MCP tool: snowflake_get_schema("MY_DB", "SALES", "CUSTOMERS")
       ↓
Claude gets the column list from SnowSyncMD
       ↓
Claude writes the correct query with real column names
```

No live Snowflake queries. No manual schema exports. Claude reads the
pre-built Markdown files that SnowSyncMD keeps up to date every 10 minutes.

---

## Installation

```bash
pip install mcp snowflake-connector-python python-dotenv
```

---

## Configuration

Add to your Claude Code settings (`~/.claude/settings.json`):

```json
{
  "mcpServers": {
    "snowsyncmd": {
      "command": "python3",
      "args": ["/path/to/snowsyncmd_mcp.py"],
      "env": {
        "SNOWFLAKE_ACCOUNT":  "your-account-identifier",
        "SNOWFLAKE_USER":     "your_username",
        "SNOWFLAKE_PASSWORD": "your_password",
        "SNOWFLAKE_ROLE":     "ACCOUNTADMIN",
        "SNOWFLAKE_WAREHOUSE": "COMPUTE_WH",
        "SNOWSYNCMD_APP":     "snowsyncmd"
      }
    }
  }
}
```

> **Tip:** Set credentials via a `.env` file in the same directory instead
> of hardcoding them in settings.json.

---

## Available tools

Claude sees these tools and calls them automatically:

| Tool | What it does |
|---|---|
| `snowflake_get_schema` | Returns the full MD doc for one object (table, view, function…) |
| `snowflake_search_schema` | Searches by keyword across all schema docs |
| `snowflake_list_objects` | Lists every tracked object with DB/schema/type |
| `snowflake_get_status` | Shows sync health, registered databases, last sync time |
| `snowflake_sync` | Triggers an immediate sync (all DBs or one) |

---

## Example conversations

```
You:    "What columns does the FACT_ORDERS table have?"
Claude: [calls snowflake_get_schema] → returns column list with types
Claude: "FACT_ORDERS has 14 columns: ORDER_SK (NUMBER), ORDER_ID (NUMBER), ..."

You:    "Write a query to show monthly revenue by channel"
Claude: [calls snowflake_search_schema "revenue"] → finds FACT_ORDERS, V_DAILY_SALES
Claude: [calls snowflake_get_schema for V_DAILY_SALES]
Claude: "Here's a query using V_DAILY_SALES which already aggregates by channel: ..."

You:    "Is the schema documentation up to date?"
Claude: [calls snowflake_get_status]
Claude: "Last synced 3 minutes ago. 180 objects tracked across 2 databases."

You:    "I just added a new table — refresh the docs"
Claude: [calls snowflake_sync]
Claude: "Sync complete. 1 new object found and documented."
```

---

## Using with Claude Code hooks (optional)

Add a `UserPromptSubmit` hook to auto-check sync status before each session:

`~/.claude/settings.json`:
```json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Bash",
      "hooks": [{
        "type": "command",
        "command": "echo 'Snowflake schema docs available via snowsyncmd MCP tools'"
      }]
    }]
  }
}
```

---

## Requirements

- SnowSyncMD installed from Snowflake Marketplace
- ACCOUNTADMIN or app_admin role on the SnowSyncMD app
- Python 3.11+
- `mcp`, `snowflake-connector-python`, `python-dotenv`
