mcp-http-webhook 1.0.28 โ 1.0.30
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/dist/server.d.ts.map +1 -1
- package/dist/server.js +15 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -5
- package/src/server.ts +16 -1
- package/ARCHITECTURE.md +0 -269
- package/BLOG_POST.md +0 -738
- package/COMPLETION_IMPLEMENTATION.md +0 -280
- package/CONTRIBUTING.md +0 -136
- package/GETTING_STARTED.md +0 -310
- package/IMPLEMENTATION.md +0 -294
- package/MIGRATION_TO_SDK.md +0 -263
- package/PAGINATION_IMPLEMENTATION.md +0 -221
- package/SDK_INTEGRATION_COMPLETE.md +0 -300
- package/STANDARD_SUBSCRIPTIONS.md +0 -268
- package/STANDARD_SUBSCRIPTIONS_COMPLETE.md +0 -309
- package/SUMMARY.md +0 -272
- package/examples/GITHUB_LIVE_EXAMPLE.md +0 -308
- package/examples/GITHUB_LIVE_SETUP.md +0 -253
- package/examples/QUICKSTART.md +0 -130
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
# GitHub Live Integration Setup Guide
|
|
2
|
-
|
|
3
|
-
This guide will help you set up the GitHub MCP server with real webhooks.
|
|
4
|
-
|
|
5
|
-
## ๐ฏ Quick Start Checklist
|
|
6
|
-
|
|
7
|
-
- [ ] GitHub Personal Access Token
|
|
8
|
-
- [ ] Test GitHub Repository
|
|
9
|
-
- [ ] ngrok Account (free)
|
|
10
|
-
- [ ] Run the example
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## ๐ Step-by-Step Setup
|
|
15
|
-
|
|
16
|
-
### 1. Create GitHub Personal Access Token
|
|
17
|
-
|
|
18
|
-
1. Go to: https://github.com/settings/tokens/new
|
|
19
|
-
2. **Token Name**: `MCP GitHub Test`
|
|
20
|
-
3. **Expiration**: 30 days (for testing)
|
|
21
|
-
4. **Select Scopes**:
|
|
22
|
-
- โ
`repo` - Full control of private repositories
|
|
23
|
-
- โ
`admin:repo_hook` - Full control of repository hooks
|
|
24
|
-
5. Click **Generate token**
|
|
25
|
-
6. **Copy the token** - you won't see it again!
|
|
26
|
-
|
|
27
|
-
Example token format: `ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
|
28
|
-
|
|
29
|
-
### 2. Prepare a Test Repository
|
|
30
|
-
|
|
31
|
-
You need a GitHub repository you own for testing webhooks.
|
|
32
|
-
|
|
33
|
-
**Option A: Use Existing Repo**
|
|
34
|
-
- Any repository you own
|
|
35
|
-
- Example: `your-username/test-repo`
|
|
36
|
-
|
|
37
|
-
**Option B: Create New Test Repo**
|
|
38
|
-
```bash
|
|
39
|
-
# Via GitHub CLI
|
|
40
|
-
gh repo create mcp-webhook-test --public
|
|
41
|
-
|
|
42
|
-
# Or manually at:
|
|
43
|
-
# https://github.com/new
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### 3. Get ngrok Auth Token (FREE)
|
|
47
|
-
|
|
48
|
-
ngrok is required to expose your localhost to GitHub's webhooks.
|
|
49
|
-
|
|
50
|
-
1. **Sign up** (free): https://dashboard.ngrok.com/signup
|
|
51
|
-
2. **Get your auth token**: https://dashboard.ngrok.com/get-started/your-authtoken
|
|
52
|
-
3. **Copy the token**
|
|
53
|
-
|
|
54
|
-
Example token format: `2abc123def456ghi789jkl_0MnOpQrStUvWxYz`
|
|
55
|
-
|
|
56
|
-
**Set as environment variable** (optional):
|
|
57
|
-
```bash
|
|
58
|
-
export NGROK_AUTH_TOKEN="your_ngrok_token_here"
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### 4. Run the Example
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
cd packages/plugins/mcp-proxy
|
|
65
|
-
npx tsx examples/github-server-live.ts
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
You'll be prompted for:
|
|
69
|
-
|
|
70
|
-
1. **GitHub Personal Access Token**: `ghp_...` (from step 1)
|
|
71
|
-
2. **Repository owner**: Your GitHub username
|
|
72
|
-
3. **Repository name**: Your test repo name
|
|
73
|
-
4. **ngrok auth token**: Your ngrok token (or press Enter if set in env)
|
|
74
|
-
5. **Webhook secret**: Press Enter for auto-generated
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## ๐งช Testing the Integration
|
|
79
|
-
|
|
80
|
-
### Step 1: Server Starts
|
|
81
|
-
|
|
82
|
-
You should see:
|
|
83
|
-
```
|
|
84
|
-
โ
Authenticated as: your-username
|
|
85
|
-
โ
Repository found: your-username/test-repo
|
|
86
|
-
โ
Public URL: https://abc123.ngrok.io
|
|
87
|
-
๐ MCP Server started on port 3000
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Step 2: Test with MCP Inspector
|
|
91
|
-
|
|
92
|
-
Open in browser:
|
|
93
|
-
```
|
|
94
|
-
http://localhost:3000/mcp
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Or use MCP Inspector:
|
|
98
|
-
```bash
|
|
99
|
-
npx @modelcontextprotocol/inspector http://localhost:3000/mcp
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Step 3: Subscribe to Issues
|
|
103
|
-
|
|
104
|
-
In MCP Inspector or via curl:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
curl -X POST http://localhost:3000/mcp/resources/subscribe \
|
|
108
|
-
-H "Content-Type: application/json" \
|
|
109
|
-
-H "Authorization: Bearer test-token" \
|
|
110
|
-
-d '{
|
|
111
|
-
"uri": "github://repo/your-username/test-repo/issues",
|
|
112
|
-
"callbackUrl": "https://your-client.com/webhook",
|
|
113
|
-
"callbackSecret": "client-secret-123"
|
|
114
|
-
}'
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
This will:
|
|
118
|
-
1. Create a real GitHub webhook in your repository
|
|
119
|
-
2. Subscribe to issue events
|
|
120
|
-
3. Return a subscription ID
|
|
121
|
-
|
|
122
|
-
### Step 4: Create a Test Issue
|
|
123
|
-
|
|
124
|
-
Create an issue in your GitHub repo:
|
|
125
|
-
|
|
126
|
-
1. Go to: `https://github.com/your-username/test-repo/issues/new`
|
|
127
|
-
2. Title: "Test MCP Webhook"
|
|
128
|
-
3. Click **Submit new issue**
|
|
129
|
-
|
|
130
|
-
### Step 5: Verify Webhook Received
|
|
131
|
-
|
|
132
|
-
Check the server logs - you should see:
|
|
133
|
-
```
|
|
134
|
-
๐ฅ Received GitHub webhook for subscription: sub_abc123
|
|
135
|
-
๐ค Notifying client at: https://your-client.com/webhook
|
|
136
|
-
โ
Successfully notified client
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## ๐ Troubleshooting
|
|
142
|
-
|
|
143
|
-
### ngrok Error: "failed to start tunnel"
|
|
144
|
-
|
|
145
|
-
**Problem**: ngrok requires authentication
|
|
146
|
-
|
|
147
|
-
**Solution**:
|
|
148
|
-
1. Sign up at https://dashboard.ngrok.com/signup
|
|
149
|
-
2. Get auth token from https://dashboard.ngrok.com/get-started/your-authtoken
|
|
150
|
-
3. Provide it when prompted, or set environment variable:
|
|
151
|
-
```bash
|
|
152
|
-
export NGROK_AUTH_TOKEN="your_token"
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### GitHub API Error: "Bad credentials"
|
|
156
|
-
|
|
157
|
-
**Problem**: Invalid or expired token
|
|
158
|
-
|
|
159
|
-
**Solution**:
|
|
160
|
-
1. Verify token hasn't expired
|
|
161
|
-
2. Regenerate token with correct scopes: `repo`, `admin:repo_hook`
|
|
162
|
-
3. Copy the full token including `ghp_` prefix
|
|
163
|
-
|
|
164
|
-
### GitHub API Error: "Not Found"
|
|
165
|
-
|
|
166
|
-
**Problem**: Repository doesn't exist or token doesn't have access
|
|
167
|
-
|
|
168
|
-
**Solution**:
|
|
169
|
-
1. Verify repository exists: `https://github.com/owner/repo`
|
|
170
|
-
2. Ensure you own the repository
|
|
171
|
-
3. Check token has `repo` scope
|
|
172
|
-
|
|
173
|
-
### Webhook Not Received
|
|
174
|
-
|
|
175
|
-
**Problem**: GitHub can't reach your localhost
|
|
176
|
-
|
|
177
|
-
**Checks**:
|
|
178
|
-
1. โ
ngrok tunnel is running
|
|
179
|
-
2. โ
Server is running on port 3000
|
|
180
|
-
3. โ
GitHub webhook was created (check repo settings)
|
|
181
|
-
4. โ
Check GitHub webhook deliveries
|
|
182
|
-
|
|
183
|
-
**View webhook deliveries**:
|
|
184
|
-
1. Go to: `https://github.com/owner/repo/settings/hooks`
|
|
185
|
-
2. Click on the webhook
|
|
186
|
-
3. Check **Recent Deliveries** tab
|
|
187
|
-
4. Look for errors
|
|
188
|
-
|
|
189
|
-
---
|
|
190
|
-
|
|
191
|
-
## ๐ Advanced Usage
|
|
192
|
-
|
|
193
|
-
### Using Multiple Repositories
|
|
194
|
-
|
|
195
|
-
Subscribe to multiple repos:
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
// Subscribe to repo 1
|
|
199
|
-
POST /mcp/resources/subscribe
|
|
200
|
-
{
|
|
201
|
-
"uri": "github://repo/owner1/repo1/issues",
|
|
202
|
-
"callbackUrl": "https://client.com/webhook",
|
|
203
|
-
"callbackSecret": "secret1"
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// Subscribe to repo 2
|
|
207
|
-
POST /mcp/resources/subscribe
|
|
208
|
-
{
|
|
209
|
-
"uri": "github://repo/owner2/repo2/issues",
|
|
210
|
-
"callbackUrl": "https://client.com/webhook",
|
|
211
|
-
"callbackSecret": "secret2"
|
|
212
|
-
}
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Custom Webhook Events
|
|
216
|
-
|
|
217
|
-
Modify the example to subscribe to different events:
|
|
218
|
-
|
|
219
|
-
```typescript
|
|
220
|
-
events: ['issues', 'pull_request', 'push', 'release']
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Production Deployment
|
|
224
|
-
|
|
225
|
-
For production, replace ngrok with:
|
|
226
|
-
|
|
227
|
-
1. **Deploy to cloud** (AWS, GCP, Azure)
|
|
228
|
-
2. **Use real domain** with SSL
|
|
229
|
-
3. **Store webhook IDs** in database (not in-memory)
|
|
230
|
-
4. **Add rate limiting**
|
|
231
|
-
5. **Add monitoring**
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
## ๐ Resources
|
|
236
|
-
|
|
237
|
-
- **MCP Specification**: https://spec.modelcontextprotocol.io/
|
|
238
|
-
- **GitHub Webhooks**: https://docs.github.com/en/webhooks
|
|
239
|
-
- **Octokit REST API**: https://octokit.github.io/rest.js/
|
|
240
|
-
- **ngrok Documentation**: https://ngrok.com/docs
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
## โ Need Help?
|
|
245
|
-
|
|
246
|
-
If you encounter issues:
|
|
247
|
-
|
|
248
|
-
1. Check the server logs for errors
|
|
249
|
-
2. Verify all prerequisites are met
|
|
250
|
-
3. Check GitHub webhook deliveries for errors
|
|
251
|
-
4. Review this troubleshooting guide
|
|
252
|
-
|
|
253
|
-
Happy testing! ๐
|
package/examples/QUICKSTART.md
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# ๐ Quick Start - GitHub MCP Live Integration
|
|
2
|
-
|
|
3
|
-
## What You Need (5 minutes setup)
|
|
4
|
-
|
|
5
|
-
### 1๏ธโฃ GitHub Personal Access Token
|
|
6
|
-
```
|
|
7
|
-
๐ Create at: https://github.com/settings/tokens/new
|
|
8
|
-
|
|
9
|
-
โ
Scopes to select:
|
|
10
|
-
- repo
|
|
11
|
-
- admin:repo_hook
|
|
12
|
-
|
|
13
|
-
๐ Format: ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### 2๏ธโฃ ngrok Auth Token (FREE)
|
|
17
|
-
```
|
|
18
|
-
๐ Sign up: https://dashboard.ngrok.com/signup
|
|
19
|
-
๐ Get token: https://dashboard.ngrok.com/get-started/your-authtoken
|
|
20
|
-
|
|
21
|
-
๐ Format: 2abc123def456ghi789jkl_0MnOpQrStUvWxYz
|
|
22
|
-
|
|
23
|
-
๐ก Set as env variable (optional):
|
|
24
|
-
export NGROK_AUTH_TOKEN="your_token"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### 3๏ธโฃ Test Repository
|
|
28
|
-
```
|
|
29
|
-
Use any GitHub repo you own, or create one:
|
|
30
|
-
|
|
31
|
-
gh repo create mcp-webhook-test --public
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Run the Example
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
cd packages/plugins/mcp-proxy
|
|
40
|
-
npx tsx examples/github-server-live.ts
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### You'll be prompted for:
|
|
44
|
-
1. **GitHub Token**: Paste your `ghp_...` token
|
|
45
|
-
2. **Repo Owner**: Your GitHub username
|
|
46
|
-
3. **Repo Name**: Your test repo name
|
|
47
|
-
4. **ngrok Token**: Your ngrok token (or Enter if in env)
|
|
48
|
-
5. **Webhook Secret**: Just press Enter (auto-generated)
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## What Happens
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
โ
Connects to GitHub API
|
|
56
|
-
โ
Verifies repo access
|
|
57
|
-
โ
Starts ngrok tunnel (gets public URL)
|
|
58
|
-
โ
Starts MCP server on port 3000
|
|
59
|
-
โ
Ready to create webhooks!
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Test It
|
|
65
|
-
|
|
66
|
-
### Option 1: Use MCP Inspector
|
|
67
|
-
```bash
|
|
68
|
-
# In browser, open:
|
|
69
|
-
http://localhost:3000/mcp
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Option 2: Subscribe to Issues
|
|
73
|
-
```bash
|
|
74
|
-
curl -X POST http://localhost:3000/mcp/resources/subscribe \
|
|
75
|
-
-H "Content-Type: application/json" \
|
|
76
|
-
-d '{
|
|
77
|
-
"uri": "github://repo/YOUR_USERNAME/YOUR_REPO/issues",
|
|
78
|
-
"callbackUrl": "https://webhook.site/unique-url",
|
|
79
|
-
"callbackSecret": "test123"
|
|
80
|
-
}'
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
This creates a REAL GitHub webhook!
|
|
84
|
-
|
|
85
|
-
### Option 3: Create Test Issue
|
|
86
|
-
```
|
|
87
|
-
1. Go to: https://github.com/YOUR_USERNAME/YOUR_REPO/issues/new
|
|
88
|
-
2. Create a new issue
|
|
89
|
-
3. Watch the server logs - you'll see the webhook arrive! ๐
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Expected Output
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
98
|
-
โ GitHub MCP Server - Live Integration with Webhooks โ
|
|
99
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
100
|
-
|
|
101
|
-
โ
Authenticated as: your-username
|
|
102
|
-
โ
Repository found: your-username/test-repo
|
|
103
|
-
โ
Public URL: https://abc123.ngrok.io
|
|
104
|
-
๐ MCP Server started on port 3000
|
|
105
|
-
|
|
106
|
-
๐ก Ready to receive webhooks!
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Troubleshooting
|
|
112
|
-
|
|
113
|
-
**ngrok Error "failed to start tunnel"**
|
|
114
|
-
โ You need an ngrok auth token. Sign up at ngrok.com (it's free!)
|
|
115
|
-
|
|
116
|
-
**GitHub "Bad credentials"**
|
|
117
|
-
โ Check your token hasn't expired and has the right scopes
|
|
118
|
-
|
|
119
|
-
**GitHub "Not Found"**
|
|
120
|
-
โ Verify repo exists and you own it
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## ๐ Learn More
|
|
125
|
-
|
|
126
|
-
Full setup guide: `examples/GITHUB_LIVE_SETUP.md`
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
**Ready? Let's do this! ๐**
|