@kujirahand/discord-webhook-mcp 1.0.0 → 1.0.1
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/README.md +48 -13
- package/mcp_server.js +11 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,31 +1,68 @@
|
|
|
1
1
|
# discord-webhook-mcp
|
|
2
2
|
|
|
3
|
-
MCP
|
|
3
|
+
An MCP server to send notifications from AI agents to Discord via Discord webhooks.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- [日本語のマニュアル](https://github.com/kujirahand/discord-webhook-mcp/blob/main/README-ja.md)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
## How to Get Discord Webhook URL
|
|
8
|
+
|
|
9
|
+
Here are the steps to obtain a Discord Webhook URL:
|
|
10
|
+
|
|
11
|
+
* Open the target **server** in Discord.
|
|
12
|
+
* Choose the **text channel** where you want to send webhooks.
|
|
13
|
+
* Click the gear icon next to the channel name, or right-click the channel, to open **"Edit Channel"**.
|
|
14
|
+
* Select **"Integrations"** from the left menu.
|
|
15
|
+
* Open **"Webhooks"**.
|
|
16
|
+
* Click **"New Webhook"** or **"Create Webhook"**.
|
|
17
|
+
* Set a name for the Webhook.
|
|
18
|
+
* Example: `MCP Notification`
|
|
19
|
+
* Example: `Discord Webhook MCP`
|
|
20
|
+
* Verify that the posting channel is correct.
|
|
21
|
+
* Set an icon image if necessary.
|
|
22
|
+
* Click **"Copy Webhook URL"**.
|
|
23
|
+
* Click **"Save Changes"**.
|
|
24
|
+
|
|
25
|
+
> [!WARNING]
|
|
26
|
+
> Webhook URLs are sensitive secrets. Do not publish them or make them publicly accessible.
|
|
27
|
+
|
|
28
|
+
## AI Agent Installation
|
|
12
29
|
|
|
13
|
-
|
|
30
|
+
Use the following steps to install the server to your AI agent of choice.
|
|
31
|
+
|
|
32
|
+
### Install to Codex CLI
|
|
14
33
|
|
|
15
34
|
```sh
|
|
16
35
|
codex mcp add discord-webhook \
|
|
17
|
-
|
|
36
|
+
npx -y @kujirahand/discord-webhook-mcp \
|
|
18
37
|
--env DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/xxxxx
|
|
19
38
|
```
|
|
20
39
|
|
|
21
|
-
|
|
40
|
+
### Install to Claude Code
|
|
22
41
|
|
|
23
42
|
```sh
|
|
24
43
|
claude mcp add discord-webhook \
|
|
25
|
-
|
|
44
|
+
@kujirahand/discord-webhook-mcp \
|
|
26
45
|
--env DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/xxxxx
|
|
27
46
|
```
|
|
28
47
|
|
|
48
|
+
### Install to Antigravity CLI
|
|
49
|
+
|
|
50
|
+
Add the following configuration to your `~/.gemini/config/mcp_config.json` file:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"discord-webhook": {
|
|
56
|
+
"command": "npx",
|
|
57
|
+
"args": ["-y", "@kujirahand/discord-webhook-mcp"],
|
|
58
|
+
"env": {
|
|
59
|
+
"DISCORD_WEBHOOK_URL": "https://discord.com/api/webhooks/xxxxx"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
29
66
|
## Available Tools
|
|
30
67
|
|
|
31
68
|
### 1. `send_message`
|
|
@@ -42,5 +79,3 @@ Uploads an image file to the Discord channel.
|
|
|
42
79
|
- `message` (string, optional): Accompanying text message.
|
|
43
80
|
- `username` (string, optional): Override the webhook bot's username.
|
|
44
81
|
- `avatar_url` (string, optional): Override the webhook bot's avatar.
|
|
45
|
-
|
|
46
|
-
|
package/mcp_server.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
2
3
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
5
|
import {
|
|
@@ -235,10 +236,16 @@ async function main() {
|
|
|
235
236
|
console.error("Discord Webhook MCP Server running on stdio");
|
|
236
237
|
}
|
|
237
238
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
process.argv[1]
|
|
241
|
-
)
|
|
239
|
+
let realArgv1 = "";
|
|
240
|
+
try {
|
|
241
|
+
realArgv1 = process.argv[1] ? realpathSync(process.argv[1]) : "";
|
|
242
|
+
} catch (e) {
|
|
243
|
+
// Ignore errors if the file doesn't exist
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const isMain =
|
|
247
|
+
realArgv1 === fileURLToPath(import.meta.url) ||
|
|
248
|
+
(process.argv[1] && process.argv[1].endsWith("mcp_server.js"));
|
|
242
249
|
|
|
243
250
|
if (isMain) {
|
|
244
251
|
main().catch((error) => {
|