File size: 1,687 Bytes
00f4bcb
add9f72
 
 
 
00f4bcb
add9f72
00f4bcb
 
 
add9f72
 
cfe9850
add9f72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
title: DataPass Server
emoji: 🎫
colorFrom: indigo
colorTo: purple
sdk: docker
app_file: Dockerfile
pinned: false
---

# DataPass MCP Server

**Your pass to private datasets.**

This is the MCP (Model Context Protocol) server that powers DataPass. It handles:

- Token validation for dataset access
- SQL and natural language query execution via DuckDB
- Stripe payment integration
- Subscription ledger management

## MCP Endpoint

Connect your MCP client (Claude Desktop, Cursor, etc.) to:

```
sse: https://your-space.hf.space/sse
```

## Available MCP Tools

### Public Tools
- `get_dataset_catalog` - Browse available datasets

### Authenticated Tools (require DataPass token)
- `get_my_datasets` - View your subscribed datasets
- `query_dataset` - Run SQL queries on datasets
- `query_dataset_natural_language` - Ask questions in plain English
- `get_dataset_sample` - Preview dataset structure

## Configuration

This Space requires the following **Secrets** (Settings → Variables and secrets):

| Secret | Description |
|--------|-------------|
| `HF_TOKEN` | HF token with write access to ledger dataset |
| `ADMIN_API_SECRET` | Shared secret for admin API authentication |
| `LEDGER_DATASET_ID` | Dataset ID for subscription ledger (e.g., `username/datapass-ledger`) |
| `STRIPE_SECRET_KEY` | Stripe API key for payments |
| `STRIPE_WEBHOOK_SECRET` | Stripe webhook signing secret |
| `FRONTEND_URL` | URL to DataPass frontend (for landing page redirect) |

## Security Model

- Dataset files never leave Hugging Face
- Every request validates the DataPass token
- Query results are capped (no `SELECT *` dumps)
- Access automatically expires after subscription period