solostack-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +213 -0
- package/dist/provisioner.mjs +24262 -0
- package/dist/worker.mjs +71220 -0
- package/llms.txt +80 -0
- package/package.json +57 -0
- package/src/db/schema.sql +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SoloStack Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# SoloStack
|
|
2
|
+
|
|
3
|
+
Email marketing that your AI agent deploys and runs. No sign-ups, no dashboards, no SaaS subscriptions.
|
|
4
|
+
|
|
5
|
+
You say: *"Set up email marketing for my site."*
|
|
6
|
+
Your AI agent provisions a Cloudflare Worker, creates a database, verifies your sending domain, and hands you a working email stack. Then it runs it — subscribing users, sending broadcasts, tracking delivery — all through conversation.
|
|
7
|
+
|
|
8
|
+
## The Demo
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
You: Set up email marketing on zeroheadcount.com
|
|
12
|
+
Claude: I'll provision your email stack now.
|
|
13
|
+
|
|
14
|
+
✅ Worker deployed: solostack-zeroheadcount.ivy-audit.workers.dev
|
|
15
|
+
✅ D1 database created with subscriber + email log tables
|
|
16
|
+
✅ Secrets configured (API keys, bearer token)
|
|
17
|
+
✅ Health check passing
|
|
18
|
+
|
|
19
|
+
Next: I need to verify your sending domain.
|
|
20
|
+
Add these DNS records to zeroheadcount.com:
|
|
21
|
+
CNAME bounce → bounce.resend.net
|
|
22
|
+
TXT ... → v=spf1 include:...
|
|
23
|
+
TXT ... → v=DKIM1; p=...
|
|
24
|
+
|
|
25
|
+
You: Done, added them.
|
|
26
|
+
Claude: Verifying... ✅ Domain verified. Webhook registered.
|
|
27
|
+
|
|
28
|
+
You: Send a welcome email to sarah@example.com
|
|
29
|
+
Claude: ✅ Sent "Welcome to Zero Headcount" to sarah@example.com
|
|
30
|
+
|
|
31
|
+
You: How many subscribers do I have?
|
|
32
|
+
Claude: 47 active subscribers. 3 unsubscribed this week.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
No CLI commands. No config files. No dashboard tabs. Just conversation.
|
|
36
|
+
|
|
37
|
+
## How It Works
|
|
38
|
+
|
|
39
|
+
SoloStack is two things:
|
|
40
|
+
|
|
41
|
+
1. **A provisioner** — a local MCP server that creates your email infrastructure via Cloudflare and Resend APIs
|
|
42
|
+
2. **An email engine** — a Cloudflare Worker that handles subscribers, sends emails, and tracks delivery
|
|
43
|
+
|
|
44
|
+
The provisioner runs locally (your AI agent connects via stdio). After setup, it acts as a gateway — proxying your email commands to the deployed worker.
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Your AI Agent (Claude, Cursor, etc.)
|
|
48
|
+
│
|
|
49
|
+
│ stdio
|
|
50
|
+
│
|
|
51
|
+
▼
|
|
52
|
+
Local Provisioner (12 MCP tools)
|
|
53
|
+
│
|
|
54
|
+
├── Provisioning tools → Cloudflare API + Resend API
|
|
55
|
+
│ (provision, upgrade, domain setup, migrate)
|
|
56
|
+
│
|
|
57
|
+
└── Gateway proxy → Deployed Worker /mcp
|
|
58
|
+
(subscribe, send_email, broadcast, etc.)
|
|
59
|
+
│
|
|
60
|
+
├── D1 database (subscribers, email log)
|
|
61
|
+
├── Resend API (email delivery)
|
|
62
|
+
└── Webhook endpoint (delivery tracking)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Tools
|
|
66
|
+
|
|
67
|
+
### Provisioning (runs locally)
|
|
68
|
+
|
|
69
|
+
| Tool | What it does |
|
|
70
|
+
|------|-------------|
|
|
71
|
+
| `provision_solostack` | Creates Worker + D1 database + schema + secrets. One call, full stack. |
|
|
72
|
+
| `check_status` | Health check — is the worker running, what version, subscriber count |
|
|
73
|
+
| `setup_email_domain` | Adds your domain to Resend, returns DNS records to add |
|
|
74
|
+
| `verify_email_domain` | Polls until domain is verified, then auto-registers webhook |
|
|
75
|
+
| `migrate_subscribers` | Import subscribers from CSV (any provider — just needs an `email` column) |
|
|
76
|
+
| `upgrade_solostack` | Upload new worker bundle with rollback on health failure |
|
|
77
|
+
|
|
78
|
+
### Email operations (proxied to deployed worker)
|
|
79
|
+
|
|
80
|
+
| Tool | What it does |
|
|
81
|
+
|------|-------------|
|
|
82
|
+
| `subscribe` | Add or re-activate a subscriber (idempotent) |
|
|
83
|
+
| `unsubscribe` | Mark subscriber as unsubscribed |
|
|
84
|
+
| `list_subscribers` | List subscribers with status/tag filtering + pagination |
|
|
85
|
+
| `get_subscriber_count` | Count subscribers by status or tag |
|
|
86
|
+
| `send_email` | Send a single email to one recipient |
|
|
87
|
+
| `send_broadcast` | Send to all active subscribers (max 100, filterable by tag) |
|
|
88
|
+
|
|
89
|
+
## Quick Start
|
|
90
|
+
|
|
91
|
+
### Prerequisites
|
|
92
|
+
|
|
93
|
+
- Node.js 18+
|
|
94
|
+
- A Cloudflare account ([free tier](https://dash.cloudflare.com) — 100K requests/day)
|
|
95
|
+
- A Resend account ([free tier](https://resend.com) — 3,000 emails/month)
|
|
96
|
+
|
|
97
|
+
### Let the AI do it
|
|
98
|
+
|
|
99
|
+
Add SoloStack as an MCP server in your AI client:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"mcpServers": {
|
|
104
|
+
"solostack": {
|
|
105
|
+
"command": "npx",
|
|
106
|
+
"args": ["-y", "solostack-mcp"]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Then tell your AI: *"Set up email marketing on mydomain.com"* and provide your Cloudflare API token, account ID, and Resend API key when asked.
|
|
113
|
+
|
|
114
|
+
The AI handles the rest — provisioning, domain verification, and all ongoing operations.
|
|
115
|
+
|
|
116
|
+
<details>
|
|
117
|
+
<summary>Running from source (development)</summary>
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"mcpServers": {
|
|
122
|
+
"solostack": {
|
|
123
|
+
"command": "npx",
|
|
124
|
+
"args": ["tsx", "src/provisioner/index.ts"],
|
|
125
|
+
"cwd": "/path/to/solostack"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
</details>
|
|
132
|
+
|
|
133
|
+
### Self-hosted (manual path)
|
|
134
|
+
|
|
135
|
+
<details>
|
|
136
|
+
<summary>Traditional setup with wrangler CLI</summary>
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npm install
|
|
140
|
+
|
|
141
|
+
# Create D1 database
|
|
142
|
+
npx wrangler d1 create solostack
|
|
143
|
+
# Copy database_id into wrangler.toml
|
|
144
|
+
|
|
145
|
+
# Set FROM_EMAIL in wrangler.toml [vars]
|
|
146
|
+
|
|
147
|
+
# Local development
|
|
148
|
+
cat > .dev.vars << 'EOF'
|
|
149
|
+
SOLOSTACK_API_KEY=your-local-dev-key
|
|
150
|
+
RESEND_API_KEY=re_your_resend_key
|
|
151
|
+
RESEND_WEBHOOK_SECRET=whsec_your_webhook_secret
|
|
152
|
+
EOF
|
|
153
|
+
|
|
154
|
+
npm run db:local
|
|
155
|
+
npm run dev
|
|
156
|
+
|
|
157
|
+
# Deploy to production
|
|
158
|
+
npx wrangler secret put SOLOSTACK_API_KEY
|
|
159
|
+
npx wrangler secret put RESEND_API_KEY
|
|
160
|
+
npm run db:remote
|
|
161
|
+
npm run deploy
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
After deploying, add a Resend webhook pointing to `https://your-worker.workers.dev/webhook/resend` for delivery tracking.
|
|
165
|
+
|
|
166
|
+
</details>
|
|
167
|
+
|
|
168
|
+
## Tech Stack
|
|
169
|
+
|
|
170
|
+
- **Runtime:** [Cloudflare Workers](https://workers.cloudflare.com) (serverless, free tier: 100K req/day)
|
|
171
|
+
- **Database:** [Cloudflare D1](https://developers.cloudflare.com/d1/) (SQLite, free tier: 5GB)
|
|
172
|
+
- **Email:** [Resend](https://resend.com) API (free tier: 3,000 emails/month)
|
|
173
|
+
- **Protocol:** [MCP](https://modelcontextprotocol.io) Streamable HTTP transport
|
|
174
|
+
- **Language:** TypeScript
|
|
175
|
+
|
|
176
|
+
## Architecture
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
src/
|
|
180
|
+
index.ts # Worker entry: routing, auth, MCP handler
|
|
181
|
+
tools/
|
|
182
|
+
subscribers.ts # subscribe, unsubscribe, list, count
|
|
183
|
+
email.ts # send_email, send_broadcast
|
|
184
|
+
webhooks/
|
|
185
|
+
resend.ts # Delivery tracking (Svix signature verification)
|
|
186
|
+
db/
|
|
187
|
+
schema.sql # D1 schema (subscribers + email_log)
|
|
188
|
+
lib/
|
|
189
|
+
types.ts # Env interface
|
|
190
|
+
resend.ts # Resend API client
|
|
191
|
+
provisioner/
|
|
192
|
+
index.ts # Local MCP server (stdio transport)
|
|
193
|
+
gateway.ts # Proxy pattern — forwards tool calls to worker
|
|
194
|
+
cf-api.ts # Cloudflare API client
|
|
195
|
+
resend-api.ts # Resend API client (domain setup)
|
|
196
|
+
config.ts # ~/.solostack/config.json storage
|
|
197
|
+
tools/ # Provisioning tool implementations
|
|
198
|
+
scripts/
|
|
199
|
+
build-bundle.ts # esbuild pipeline for worker bundle
|
|
200
|
+
e2e-test.ts # End-to-end provisioning test
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Current Limitations
|
|
204
|
+
|
|
205
|
+
- **Broadcast cap:** 100 recipients per call (Resend free tier: 100 emails/day)
|
|
206
|
+
- **No drip sequences yet** — subscribe + broadcast only (drip engine planned)
|
|
207
|
+
- **No analytics dashboard** — query `email_log` via D1 for delivery stats
|
|
208
|
+
- **Single sending domain** per worker instance
|
|
209
|
+
- **Cloudflare-only** — Workers + D1 (multi-platform planned)
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
MIT
|