Skip to content

Commit 6565038

Browse files
Prepare github-webhook-mcp for Anthropic local directory submission (#39)
* docs(mcpb): prepare local directory submission metadata README と manifest を Anthropic local MCP directory submission 向けに整理し、Node MCP ツールへ readOnlyHint/destructiveHint を追加しました。\n\n公式一覧提出で不足していた privacy policy 導線、working examples、公開メタデータを先に揃えるための中間整理です。\n\nRefs #38 * build(mcpb): align lockfile with submission-ready package Anthropic local MCP directory submission 向けの README、manifest、tool annotation 更新に合わせて、mcp-server の lockfile を 0.3.0 構成へ同期しました。\n\nMCPB 本体は現時点では CD の release asset として扱い、repo には含めません。\n\nRefs #38 * build(mcpb): ignore generated release bundle 生成される MCPB は現時点では CD の release asset として扱うため、作業 tree に残っても差分ノイズにならないよう .gitignore へ追加しました。\n\nRefs #38 * docs(mcpb): point privacy policy to public domain README と manifest の privacy policy URL を smgjp.com 上の公開ページへ切り替えました。\n\nAnthropic local MCP directory submission 向けに、拡張専用の公開 URL を source of truth として固定するための更新です。\n\nRefs #38 * build(release): bump package version to 0.3.1 Anthropic local directory submission 向けの整備を patch release に載せるため、mcp-server の version を 0.3.1 に更新し、manifest と lockfile を揃えた。\n\nRefs #38 --------- Co-authored-by: liplus-lin-lay <259586417+liplus-lin-lay@users.noreply.github.com>
1 parent d007fd7 commit 6565038

6 files changed

Lines changed: 190 additions & 83 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ codex-runs/
55
__pycache__/
66
*.pyc
77
mcp-server/node_modules/
8+
mcp-server/*.mcpb

README.md

Lines changed: 133 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,89 @@
11
# github-webhook-mcp
22

3-
GitHub webhook receiver as an MCP server.
3+
GitHub webhook receiver and local MCP extension for GitHub notification workflows.
44

5-
Receives GitHub webhook events and enables Lin and Lay to autonomously handle PR reviews and issue management.
6-
It supports two operating styles:
5+
## Description
76

8-
- MCP polling: store webhook events and let an AI poll lightweight summaries.
9-
- Channel push: push new events into a Claude Code session in real-time via `claude/channel`.
10-
- Direct trigger: run a command immediately for each stored event.
7+
`github-webhook-mcp` receives GitHub webhook events, persists them to a local `events.json`, and exposes them to AI agents through MCP tools.
8+
It is designed for notification-style workflows where an AI can poll lightweight summaries, inspect a single event in detail, and mark handled events as processed.
119

1210
Detailed behavior, event metadata, trigger semantics, and file responsibilities live in [docs/0-requirements.md](docs/0-requirements.md).
1311

14-
## Quick Start
12+
## Features
1513

16-
### 1. Install dependencies
14+
- Receives GitHub webhook events over HTTPS and persists them locally.
15+
- Exposes pending events to MCP clients through lightweight polling tools.
16+
- Supports real-time `claude/channel` notifications in Claude Code.
17+
- Supports direct trigger mode for immediate Codex reactions per event.
18+
- Ships as a Node-based `.mcpb` desktop extension and as an `npx` MCP server.
1719

18-
```bash
19-
pip install -r requirements.txt
20+
## Installation
21+
22+
### Claude Desktop — Desktop Extension (.mcpb)
23+
24+
Download `mcp-server.mcpb` from [Releases](https://github.com/Liplus-Project/github-webhook-mcp/releases), then:
25+
26+
1. Open Claude Desktop → **Settings****Extensions****Advanced settings****Install Extension...**
27+
2. Select the `.mcpb` file
28+
3. Enter the path to your `events.json` when prompted
29+
30+
### Claude Desktop / Claude Code — npx
31+
32+
Add to your Claude MCP config (`claude_desktop_config.json` or project settings):
33+
34+
```json
35+
{
36+
"mcpServers": {
37+
"github-webhook-mcp": {
38+
"command": "npx",
39+
"args": ["github-webhook-mcp"],
40+
"env": {
41+
"EVENTS_JSON_PATH": "/path/to/events.json"
42+
}
43+
}
44+
}
45+
}
2046
```
2147

22-
### 2. Start webhook receiver for MCP polling
48+
### Codex — config.toml
2349

24-
```bash
25-
WEBHOOK_SECRET=your_secret python main.py webhook --port 8080 --event-profile notifications
50+
```toml
51+
[mcp.github-webhook-mcp]
52+
command = "npx"
53+
args = ["github-webhook-mcp"]
54+
55+
[mcp.github-webhook-mcp.env]
56+
EVENTS_JSON_PATH = "/path/to/events.json"
2657
```
2758

28-
### 3. Optional: start webhook receiver with direct Codex reactions
59+
### Python (legacy)
2960

30-
Use the bundled Codex wrapper if you want the webhook to launch `codex exec` immediately.
31-
Put `--trigger-command` last when a service manager splits the remaining tokens for you.
61+
```json
62+
{
63+
"mcpServers": {
64+
"github-webhook-mcp": {
65+
"command": "python",
66+
"args": ["/path/to/github-webhook-mcp/main.py", "mcp"]
67+
}
68+
}
69+
}
70+
```
71+
72+
## Configuration
73+
74+
### 1. Install receiver dependencies
3275

3376
```bash
34-
python main.py webhook \
35-
--port 8080 \
36-
--event-profile notifications \
37-
--trigger-command "python codex_reaction.py --workspace /path/to/workspace --output-dir /path/to/github-webhook-mcp/codex-runs"
77+
pip install -r requirements.txt
3878
```
3979

40-
If you want Codex to resume an existing app thread instead of writing markdown output:
80+
### 2. Start the webhook receiver
4181

42-
```text
43-
python codex_reaction.py --workspace /path/to/workspace --resume-session <thread-or-session-id>
82+
```bash
83+
WEBHOOK_SECRET=your_secret python main.py webhook --port 8080 --event-profile notifications
4484
```
4585

46-
If you want webhook delivery to stay notification-only for a workspace, create a `.codex-webhook-notify-only`
47-
file in that workspace. The bundled wrapper will skip direct Codex execution and leave the event pending.
48-
49-
### 4. Set up Cloudflare Tunnel
86+
### 3. Set up Cloudflare Tunnel
5087

5188
```bash
5289
cloudflared tunnel login
@@ -56,12 +93,12 @@ cp cloudflared/config.yml.example ~/.cloudflared/config.yml
5693
cloudflared tunnel run
5794
```
5895

59-
### 5. Configure GitHub webhook
96+
### 4. Configure the GitHub webhook
6097

6198
- Payload URL: `https://webhook.yourdomain.com/webhook`
6299
- Content type: `application/json`
63100
- Secret: same value as `WEBHOOK_SECRET`
64-
- Recommended event profile: choose these events to stay close to GitHub Notifications
101+
- Recommended event profile:
65102
- Issues
66103
- Issue comments
67104
- Pull requests
@@ -74,73 +111,93 @@ cloudflared tunnel run
74111

75112
If your webhook is temporarily set to `Send me everything`, start the receiver with `--event-profile notifications` and it will ignore noisy events such as `workflow_job` or `check_suite`.
76113

77-
### 6. Enable channel push notifications (optional)
114+
### 5. Optional direct trigger mode
78115

79-
The Node.js MCP server supports Claude Code's `claude/channel` capability (research preview, v2.1.80+). When enabled, new webhook events are pushed into your session automatically — no polling needed.
116+
Use the bundled Codex wrapper if you want the webhook to launch `codex exec` immediately.
117+
118+
```bash
119+
python main.py webhook \
120+
--port 8080 \
121+
--event-profile notifications \
122+
--trigger-command "python codex_reaction.py --workspace /path/to/workspace --output-dir /path/to/github-webhook-mcp/codex-runs"
123+
```
124+
125+
If you want Codex to resume an existing app thread instead of writing markdown output:
126+
127+
```text
128+
python codex_reaction.py --workspace /path/to/workspace --resume-session <thread-or-session-id>
129+
```
130+
131+
If you want webhook delivery to stay notification-only for a workspace, create a `.codex-webhook-notify-only`
132+
file in that workspace. The bundled wrapper will skip direct Codex execution and leave the event pending.
133+
134+
### 6. Optional channel push notifications
135+
136+
The Node.js MCP server supports Claude Code's `claude/channel` capability (research preview, v2.1.80+). When enabled, new webhook events are pushed into your session automatically.
80137

81138
```bash
82139
claude --dangerously-load-development-channels server:github-webhook-mcp
83140
```
84141

85-
Channel notifications are enabled by default. To disable, set `WEBHOOK_CHANNEL=0` in the MCP server env.
142+
Channel notifications are enabled by default. To disable, set `WEBHOOK_CHANNEL=0` in the MCP server environment.
86143

87-
### 7. Configure MCP server
144+
## Examples
88145

89-
#### Option A: Claude Desktop — Desktop Extension (.mcpb)
146+
### Example 1: Check whether any GitHub notifications are pending
90147

91-
Download `mcp-server.mcpb` from [Releases](https://github.com/Liplus-Project/github-webhook-mcp/releases), then:
148+
**User prompt:** "Do I have any pending GitHub webhook notifications right now?"
92149

93-
1. Open Claude Desktop → **Settings****Extensions****Advanced settings****Install Extension...**
94-
2. Select the `.mcpb` file
95-
3. Enter the path to your `events.json` when prompted
150+
**Expected behavior:**
96151

97-
#### Option B: Claude Desktop / Claude Code — npx
152+
- Calls `get_pending_status`
153+
- Returns pending count, latest event time, and event types
154+
- Uses that summary to decide whether more detail is needed
98155

99-
Add to your Claude MCP config (`claude_desktop_config.json` or project settings):
156+
### Example 2: Review the latest pending PR-related event
100157

101-
```json
102-
{
103-
"mcpServers": {
104-
"github-webhook-mcp": {
105-
"command": "npx",
106-
"args": ["github-webhook-mcp"],
107-
"env": {
108-
"EVENTS_JSON_PATH": "/path/to/events.json"
109-
}
110-
}
111-
}
112-
}
113-
```
158+
**User prompt:** "Show me the latest pending pull request event and explain what changed."
114159

115-
#### Option C: Codex — config.toml
160+
**Expected behavior:**
116161

117-
```toml
118-
[mcp.github-webhook-mcp]
119-
command = "npx"
120-
args = ["github-webhook-mcp"]
162+
- Calls `list_pending_events` to find the newest relevant event
163+
- Calls `get_event` only for the selected event
164+
- Summarizes the PR metadata and payload without dumping every event
121165

122-
[mcp.github-webhook-mcp.env]
123-
EVENTS_JSON_PATH = "/path/to/events.json"
124-
```
166+
### Example 3: Mark an event as handled after triage
125167

126-
#### Option D: Python (legacy)
168+
**User prompt:** "I already handled event `EVENT_ID`. Mark it processed so it stops appearing."
127169

128-
```json
129-
{
130-
"mcpServers": {
131-
"github-webhook-mcp": {
132-
"command": "python",
133-
"args": ["/path/to/github-webhook-mcp/main.py", "mcp"]
134-
}
135-
}
136-
}
137-
```
170+
**Expected behavior:**
171+
172+
- Calls `mark_processed` with the event ID
173+
- Marks the event as processed in the local event store
174+
- Confirms success and, if applicable, reports how many processed events were purged
175+
176+
## Privacy Policy
177+
178+
This extension works with GitHub webhook event payloads that you choose to persist locally in `events.json`.
179+
It may include issue titles, pull request metadata, discussion text, sender identities, and repository URLs inside that local event store.
180+
181+
### Data Collection
182+
183+
- Reads the local `events.json` file configured by the user
184+
- Surfaces webhook metadata and payloads to the connected MCP client
185+
- Can mark events as processed in the same local event store
186+
- Does not send event contents to third-party services by itself beyond the webhook receiver and infrastructure you configure
187+
188+
### Submission Note
189+
190+
The extension-specific privacy policy is published at:
191+
192+
- https://smgjp.com/privacy-policy-github-webhook-mcp/
193+
194+
Keep the policy URL in `mcp-server/manifest.json` aligned with that public page before directory submission.
138195

139-
## Operator Notes
196+
## Support
140197

141-
- For the recommended polling flow, MCP tool contracts, event profiles, and trigger metadata, see [docs/0-requirements.md](docs/0-requirements.md).
142-
- For environment variable examples, see [.env.example](.env.example).
143-
- For direct trigger usage, `codex_reaction.py` is the bundled helper.
198+
- GitHub Issues: https://github.com/Liplus-Project/github-webhook-mcp/issues
199+
- Requirements/specification: [docs/0-requirements.md](docs/0-requirements.md)
200+
- Environment variable examples: [.env.example](.env.example)
144201

145202
## Related
146203

mcp-server/manifest.json

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
{
22
"manifest_version": "0.3",
33
"name": "github-webhook-mcp",
4-
"version": "0.3.0",
4+
"display_name": "GitHub Webhook MCP",
5+
"version": "0.3.1",
56
"description": "Browse pending GitHub webhook events. Pairs with a webhook receiver that writes events.json.",
7+
"long_description": "GitHub Webhook MCP helps Claude review and react to GitHub notifications from a local event store. It surfaces lightweight pending-event summaries, exposes full webhook payloads on demand, and lets users mark handled events as processed without exposing the event file directly.",
68
"author": {
7-
"name": "Liplus Project"
9+
"name": "Liplus Project",
10+
"url": "https://github.com/Liplus-Project"
811
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/Liplus-Project/github-webhook-mcp.git"
15+
},
16+
"homepage": "https://github.com/Liplus-Project/github-webhook-mcp",
17+
"documentation": "https://github.com/Liplus-Project/github-webhook-mcp#readme",
18+
"support": "https://github.com/Liplus-Project/github-webhook-mcp/issues",
919
"license": "MIT",
1020
"server": {
1121
"type": "node",
@@ -51,10 +61,24 @@
5161
}
5262
],
5363
"compatibility": {
64+
"claude_desktop": ">=0.11.0",
5465
"platforms": [
5566
"win32",
5667
"darwin",
5768
"linux"
58-
]
59-
}
69+
],
70+
"runtimes": {
71+
"node": ">=18.0.0"
72+
}
73+
},
74+
"keywords": [
75+
"github",
76+
"webhook",
77+
"notifications",
78+
"mcp",
79+
"claude"
80+
],
81+
"privacy_policies": [
82+
"https://smgjp.com/privacy-policy-github-webhook-mcp/"
83+
]
6084
}

mcp-server/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-webhook-mcp",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "MCP server for browsing GitHub webhook events",
55
"type": "module",
66
"bin": {

0 commit comments

Comments
 (0)