discord-selfbot-mcp 1.0.0 → 1.0.2
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 +211 -95
- package/index.js +87 -0
- package/package.json +19 -29
- package/scripts/postinstall.js +49 -0
- package/setup-wizard.js +106 -0
- package/dist/core/config.d.ts +0 -39
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/config.js +0 -29
- package/dist/core/config.js.map +0 -1
- package/dist/core/errors/discord-errors.d.ts +0 -3
- package/dist/core/errors/discord-errors.d.ts.map +0 -1
- package/dist/core/errors/discord-errors.js +0 -49
- package/dist/core/errors/discord-errors.js.map +0 -1
- package/dist/core/errors/index.d.ts +0 -3
- package/dist/core/errors/index.d.ts.map +0 -1
- package/dist/core/errors/index.js +0 -3
- package/dist/core/errors/index.js.map +0 -1
- package/dist/core/errors/mcp-errors.d.ts +0 -17
- package/dist/core/errors/mcp-errors.d.ts.map +0 -1
- package/dist/core/errors/mcp-errors.js +0 -28
- package/dist/core/errors/mcp-errors.js.map +0 -1
- package/dist/core/formatting/index.d.ts +0 -2
- package/dist/core/formatting/index.d.ts.map +0 -1
- package/dist/core/formatting/index.js +0 -2
- package/dist/core/formatting/index.js.map +0 -1
- package/dist/core/formatting/output.d.ts +0 -108
- package/dist/core/formatting/output.d.ts.map +0 -1
- package/dist/core/formatting/output.js +0 -129
- package/dist/core/formatting/output.js.map +0 -1
- package/dist/core/logger.d.ts +0 -13
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js +0 -48
- package/dist/core/logger.js.map +0 -1
- package/dist/core/rateLimit/index.d.ts +0 -2
- package/dist/core/rateLimit/index.d.ts.map +0 -1
- package/dist/core/rateLimit/index.js +0 -2
- package/dist/core/rateLimit/index.js.map +0 -1
- package/dist/core/rateLimit/limiter.d.ts +0 -17
- package/dist/core/rateLimit/limiter.d.ts.map +0 -1
- package/dist/core/rateLimit/limiter.js +0 -56
- package/dist/core/rateLimit/limiter.js.map +0 -1
- package/dist/core/resolvers/ids.d.ts +0 -24
- package/dist/core/resolvers/ids.d.ts.map +0 -1
- package/dist/core/resolvers/ids.js +0 -90
- package/dist/core/resolvers/ids.js.map +0 -1
- package/dist/core/resolvers/index.d.ts +0 -2
- package/dist/core/resolvers/index.d.ts.map +0 -1
- package/dist/core/resolvers/index.js +0 -2
- package/dist/core/resolvers/index.js.map +0 -1
- package/dist/discord/client.d.ts +0 -16
- package/dist/discord/client.d.ts.map +0 -1
- package/dist/discord/client.js +0 -65
- package/dist/discord/client.js.map +0 -1
- package/dist/discord/index.d.ts +0 -2
- package/dist/discord/index.d.ts.map +0 -1
- package/dist/discord/index.js +0 -2
- package/dist/discord/index.js.map +0 -1
- package/dist/index.d.ts +0 -19
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -47
- package/dist/index.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -3
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -3
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/registry.d.ts +0 -28
- package/dist/mcp/registry.d.ts.map +0 -1
- package/dist/mcp/registry.js +0 -28
- package/dist/mcp/registry.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -4
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -99
- package/dist/mcp/server.js.map +0 -1
- package/dist/setup.d.ts +0 -3
- package/dist/setup.d.ts.map +0 -1
- package/dist/setup.js +0 -252
- package/dist/setup.js.map +0 -1
- package/dist/tools/channels/index.d.ts +0 -5
- package/dist/tools/channels/index.d.ts.map +0 -1
- package/dist/tools/channels/index.js +0 -157
- package/dist/tools/channels/index.js.map +0 -1
- package/dist/tools/dms/index.d.ts +0 -5
- package/dist/tools/dms/index.d.ts.map +0 -1
- package/dist/tools/dms/index.js +0 -121
- package/dist/tools/dms/index.js.map +0 -1
- package/dist/tools/events/index.d.ts +0 -5
- package/dist/tools/events/index.d.ts.map +0 -1
- package/dist/tools/events/index.js +0 -143
- package/dist/tools/events/index.js.map +0 -1
- package/dist/tools/files/index.d.ts +0 -5
- package/dist/tools/files/index.d.ts.map +0 -1
- package/dist/tools/files/index.js +0 -109
- package/dist/tools/files/index.js.map +0 -1
- package/dist/tools/guilds/index.d.ts +0 -5
- package/dist/tools/guilds/index.d.ts.map +0 -1
- package/dist/tools/guilds/index.js +0 -171
- package/dist/tools/guilds/index.js.map +0 -1
- package/dist/tools/interactions/index.d.ts +0 -5
- package/dist/tools/interactions/index.d.ts.map +0 -1
- package/dist/tools/interactions/index.js +0 -24
- package/dist/tools/interactions/index.js.map +0 -1
- package/dist/tools/invites/index.d.ts +0 -5
- package/dist/tools/invites/index.d.ts.map +0 -1
- package/dist/tools/invites/index.js +0 -30
- package/dist/tools/invites/index.js.map +0 -1
- package/dist/tools/messages/index.d.ts +0 -5
- package/dist/tools/messages/index.d.ts.map +0 -1
- package/dist/tools/messages/index.js +0 -238
- package/dist/tools/messages/index.js.map +0 -1
- package/dist/tools/messages/pins.d.ts +0 -5
- package/dist/tools/messages/pins.d.ts.map +0 -1
- package/dist/tools/messages/pins.js +0 -74
- package/dist/tools/messages/pins.js.map +0 -1
- package/dist/tools/messages/reactions.d.ts +0 -5
- package/dist/tools/messages/reactions.d.ts.map +0 -1
- package/dist/tools/messages/reactions.js +0 -124
- package/dist/tools/messages/reactions.js.map +0 -1
- package/dist/tools/notifications/index.d.ts +0 -5
- package/dist/tools/notifications/index.d.ts.map +0 -1
- package/dist/tools/notifications/index.js +0 -144
- package/dist/tools/notifications/index.js.map +0 -1
- package/dist/tools/presence/index.d.ts +0 -5
- package/dist/tools/presence/index.d.ts.map +0 -1
- package/dist/tools/presence/index.js +0 -121
- package/dist/tools/presence/index.js.map +0 -1
- package/dist/tools/profile/index.d.ts +0 -5
- package/dist/tools/profile/index.d.ts.map +0 -1
- package/dist/tools/profile/index.js +0 -37
- package/dist/tools/profile/index.js.map +0 -1
- package/dist/tools/relationships/index.d.ts +0 -5
- package/dist/tools/relationships/index.d.ts.map +0 -1
- package/dist/tools/relationships/index.js +0 -146
- package/dist/tools/relationships/index.js.map +0 -1
- package/dist/tools/system/index.d.ts +0 -5
- package/dist/tools/system/index.d.ts.map +0 -1
- package/dist/tools/system/index.js +0 -40
- package/dist/tools/system/index.js.map +0 -1
- package/dist/tools/threads/index.d.ts +0 -5
- package/dist/tools/threads/index.d.ts.map +0 -1
- package/dist/tools/threads/index.js +0 -180
- package/dist/tools/threads/index.js.map +0 -1
- package/dist/tools/voice/index.d.ts +0 -5
- package/dist/tools/voice/index.d.ts.map +0 -1
- package/dist/tools/voice/index.js +0 -145
- package/dist/tools/voice/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,139 +1,255 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="./logo.png" alt="discord-
|
|
2
|
+
<img src="./logo.png" alt="discord-py-self-mcp" width="100">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h1 align="center">discord-
|
|
5
|
+
<h1 align="center">discord-py-self-mcp</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
comprehensive discord selfbot mcp server
|
|
8
|
+
comprehensive discord selfbot mcp server for full user autonomy.
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<img src="https://img.shields.io/badge/license-MIT-green" alt="license">
|
|
13
|
-
<img src="https://img.shields.io/badge/language-
|
|
13
|
+
<img src="https://img.shields.io/badge/language-python-blue" alt="language">
|
|
14
14
|
<img src="https://img.shields.io/badge/mcp-sdk-orange" alt="mcp">
|
|
15
|
+
<a href="https://github.com/Microck/opencode-studio"><img src="https://img.shields.io/badge/opencode-studio-brown?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAABiElEQVR4nF2Sv0tWcRTGPyeVIpCWwmyJGqQagsqCsL2hhobsD3BvdWhoj/6CiIKaoqXBdMjKRWwQgqZ%2BokSvkIhg9BOT9xPn9Vx79cD3cu6953zP8zznCQB1V0S01d3AKeAKcBVYA94DjyJioru2k9SHE%2Bqc%2Bkd9rL7yf7TUm%2BpQ05yPUM%2Bo626Pp%2BqE2q7GGfWrOpjNnWnAOPAGeAK8Bb4U5D3AJ%2BAQsAAMAHfVvl7gIrAf2Kjiz8BZYB3YC/wFpoGDwHfgEnA0oU7tgHiheEShyXxY/Vn/n6ljye8DcBiYAloRcV3tAdrV1xMRG%2Bo94DywCAwmx33AJHASWK7iiAjzNFOBl7WapPYtYdyo8RlLqVpOVPvq9KoH1NUuOneycaRefqnP1ftdUyiOt5KS%2BqLWdDpVzTXMl5It4Jr6u%2BQ/nhyBc8C7jpowGxGvmxuPqT9qyYuFIKdP71B8WT3SOKexXLrntvqxq3BefaiuFMQ0wqZftxl3M78MjBasfiDN/SAi0kFbtf8ACtKBWZBDoJEAAAAASUVORK5CYII%3D" alt="Add with OpenCode Studio" /></a>
|
|
15
16
|
</p>
|
|
16
17
|
|
|
18
|
+
|
|
17
19
|
---
|
|
20
|
+
### overview
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
discord-py-self-mcp acts as a bridge between your AI assistant (Claude Code, Opencode, Codex, etc) and your personal Discord account. unlike standard bots, this "selfbot" runs as you; allowing your AI to read your DMs, reply to friends, manage your servers, and interact with buttons/menus just like a human user.
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
built on the <a href="https://github.com/dolfies/discord.py-self">discord.py-self</a> library by dolfies. it offers a safe, stable, and feature-rich interface for automating your daily discord life.
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
> **note**: automating user accounts is against the Discord ToS. use this at your own risk.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### quick installation
|
|
31
|
+
|
|
32
|
+
**codex**
|
|
33
|
+
tell codex:
|
|
25
34
|
```
|
|
35
|
+
Fetch and follow instructions from https://raw.githubusercontent.com/Microck/discord.py-self-mcp/refs/heads/master/.codex/INSTALL.md
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**opencode**
|
|
39
|
+
tell opencode:
|
|
40
|
+
```
|
|
41
|
+
Fetch and follow instructions from https://raw.githubusercontent.com/Microck/discord.py-self-mcp/refs/heads/master/.opencode/INSTALL.md
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### manual installation
|
|
47
|
+
|
|
48
|
+
**prerequisites**:
|
|
49
|
+
- python 3.10+
|
|
50
|
+
- `uv` (recommended) or `pip`
|
|
51
|
+
- **voice support (linux only)**: `libffi-dev` (or `libffi-devel`), `python-dev` (e.g. `python3-dev`)
|
|
26
52
|
|
|
27
|
-
|
|
53
|
+
**install**:
|
|
28
54
|
|
|
29
55
|
```bash
|
|
30
|
-
|
|
56
|
+
uv tool install git+https://github.com/Microck/discord.py-self-mcp.git
|
|
57
|
+
# or
|
|
58
|
+
pip install git+https://github.com/Microck/discord.py-self-mcp.git
|
|
31
59
|
```
|
|
32
60
|
|
|
61
|
+
> **note**: voice dependencies (PyNaCl) are included by default. on linux, ensure system packages are installed first.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### npm installation (node.js wrapper)
|
|
66
|
+
|
|
67
|
+
**prerequisites**:
|
|
68
|
+
- node.js 18+
|
|
69
|
+
- python 3.10+
|
|
70
|
+
- the npm wrapper automatically detects if python package is installed
|
|
71
|
+
|
|
72
|
+
**install**:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm install -g discord-selfbot-mcp
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
the npm package is a wrapper that uses the underlying python implementation. if python package is not installed, npm will guide you through installation.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### how it works (setup wizard)
|
|
83
|
+
|
|
84
|
+
run the interactive setup script to generate your config:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# if using npm
|
|
88
|
+
discord-selfbot-mcp-setup
|
|
89
|
+
|
|
90
|
+
# if using uv
|
|
91
|
+
uv tool run discord-py-self-mcp-setup
|
|
92
|
+
|
|
93
|
+
# or running the script directly from the repo
|
|
94
|
+
python3 discord_py_self_mcp/setup.py
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
1. **extract token**: automatically grabs your token from an open browser session (playwright)
|
|
98
|
+
2. **generate config**: outputs the mcp configuration json for you
|
|
99
|
+
3. **configure**: paste the config into your mcp client settings
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### manual configuration
|
|
104
|
+
|
|
105
|
+
**using npm**:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"mcpServers": {
|
|
110
|
+
"discord-py-self": {
|
|
111
|
+
"command": "discord-selfbot-mcp",
|
|
112
|
+
"env": {
|
|
113
|
+
"DISCORD_TOKEN": "your_token_here"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**using python (pip/uv)**:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"mcpServers": {
|
|
125
|
+
"discord-py-self": {
|
|
126
|
+
"command": "uv",
|
|
127
|
+
"args": ["tool", "run", "discord-py-self-mcp"],
|
|
128
|
+
"env": {
|
|
129
|
+
"DISCORD_TOKEN": "your_token_here"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
if installed via pip/venv, adjust the command to point to your python executable or script location.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
33
140
|
### features
|
|
34
141
|
|
|
35
|
-
|
|
142
|
+
powered by the robust `discord.py-self` library.
|
|
36
143
|
|
|
37
144
|
| category | tools | description |
|
|
38
145
|
|----------|-------|-------------|
|
|
39
|
-
| **system** |
|
|
40
|
-
| **
|
|
41
|
-
| **channels** |
|
|
42
|
-
| **
|
|
43
|
-
| **
|
|
44
|
-
| **
|
|
45
|
-
| **
|
|
46
|
-
| **threads** |
|
|
47
|
-
| **
|
|
48
|
-
| **
|
|
49
|
-
| **
|
|
50
|
-
| **
|
|
51
|
-
| **files** | 3 | upload, download, list |
|
|
52
|
-
| **events** | 4 | list, get, rsvp, create |
|
|
53
|
-
| **profile** | 1 | edit_profile (avatar, bio, username) |
|
|
54
|
-
| **interactions** | 1 | trigger_typing |
|
|
55
|
-
| **invites** | 1 | accept_invite |
|
|
146
|
+
| **system** | 2 | get_user_info, list_guilds |
|
|
147
|
+
| **messages** | 5 | send_message, read_messages, search_messages, edit_message, delete_message, pin/unpin |
|
|
148
|
+
| **channels** | 3 | create_channel, delete_channel, list_channels |
|
|
149
|
+
| **voice** | 2 | join_voice_channel, leave_voice_channel |
|
|
150
|
+
| **relationships** | 4 | list_friends, add_friend, remove_friend, send_friend_request |
|
|
151
|
+
| **presence** | 2 | set_status, set_activity |
|
|
152
|
+
| **interactions** | 3 | send_slash_command, click_button, select_menu |
|
|
153
|
+
| **threads** | 2 | create_thread, archive_thread |
|
|
154
|
+
| **members** | 4 | kick_member, ban_member, unban_member, add_role, remove_role |
|
|
155
|
+
| **invites** | 3 | create_invite, list_invites, delete_invite |
|
|
156
|
+
| **profile** | 1 | edit_profile (bio, accent) |
|
|
157
|
+
| **reactions** | 2 | add_reaction, remove_reaction |
|
|
56
158
|
|
|
57
159
|
### comparison
|
|
58
160
|
|
|
59
|
-
| feature | discord-
|
|
60
|
-
|
|
61
|
-
| read messages | ✅ | ✅ | ✅ | ✅ |
|
|
62
|
-
| send messages | ✅ | ✅ | ✅ | ✅ |
|
|
63
|
-
| list guilds | ✅ | ✅ | ✅ | ✅ |
|
|
64
|
-
| list channels | ✅ | ✅ | ✅ | ✅ |
|
|
65
|
-
| get user info | ✅ | ✅ | ✅ | ❌ |
|
|
66
|
-
| search messages | ✅ | ❌ | ❌ | ❌ |
|
|
67
|
-
| create channels | ✅ | ❌ | ✅ | ❌ |
|
|
68
|
-
| delete channels | ✅ | ❌ | ✅ | ❌ |
|
|
69
|
-
| edit messages | ✅ | ❌ | ❌ | ❌ |
|
|
70
|
-
| delete messages | ✅ | ❌ | ❌ | ❌ |
|
|
71
|
-
| join voice | ✅ | ❌ | ❌ | ❌ |
|
|
72
|
-
| manage friends | ✅ | ❌ | ❌ | ❌ |
|
|
73
|
-
| manage threads | ✅ | ❌ | ❌ | ❌ |
|
|
74
|
-
|
|
|
75
|
-
| **
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
161
|
+
| feature | discord-py-self-mcp | discord.py-self (Lib) | Maol-1997 | codebyyassine | elyxlz |
|
|
162
|
+
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
163
|
+
| **read messages** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
164
|
+
| **send messages** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
165
|
+
| **list guilds** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
166
|
+
| **list channels** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
167
|
+
| **get user info** | ✅ | ✅ | ✅ | ✅ | ❌ |
|
|
168
|
+
| **search messages** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
169
|
+
| **create channels** | ✅ | ✅ | ❌ | ✅ | ❌ |
|
|
170
|
+
| **delete channels** | ✅ | ✅ | ❌ | ✅ | ❌ |
|
|
171
|
+
| **edit messages** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
172
|
+
| **delete messages** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
173
|
+
| **join voice** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
174
|
+
| **manage friends** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
175
|
+
| **manage threads** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
176
|
+
| **slash commands** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
177
|
+
| **click buttons** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
178
|
+
| **select menus** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
179
|
+
| **kick/ban** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
180
|
+
| **invites** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
181
|
+
| **profile edit** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
182
|
+
| **setup wizard** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
183
|
+
| **captcha solver** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
80
184
|
|
|
81
|
-
|
|
82
|
-
export DISCORD_TOKEN='your_token'
|
|
83
|
-
npx discord-selfbot-mcp
|
|
84
|
-
```
|
|
185
|
+
✅ = supported
|
|
85
186
|
|
|
86
|
-
|
|
187
|
+
❌ = not supported
|
|
87
188
|
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
"mcpServers": {
|
|
91
|
-
"discord-selfbot": {
|
|
92
|
-
"command": "npx",
|
|
93
|
-
"args": ["discord-selfbot-mcp"],
|
|
94
|
-
"env": {
|
|
95
|
-
"DISCORD_TOKEN": "your_token"
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
```
|
|
189
|
+
🚧 = planned / in progress
|
|
101
190
|
|
|
102
|
-
### project structure
|
|
103
191
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
├── index.ts # entry point
|
|
126
|
-
└── setup.ts # setup wizard
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### captcha solving (experimental)
|
|
195
|
+
|
|
196
|
+
automatically solves hCaptchas when encountered (e.g., joining servers, DMs).
|
|
197
|
+
built upon [ScremerMemer/hCaptcha-Solver](https://github.com/ScremerMemer/hCaptcha-Solver).
|
|
198
|
+
|
|
199
|
+
> **warning**: this feature is experimental. use at your own risk.
|
|
200
|
+
|
|
201
|
+
**requirements:**
|
|
202
|
+
1. **Groq API Key**: required for AI vision. set `GROQ_API_KEY` in environment.
|
|
203
|
+
2. **Camoufox**: required for browser fingerprinting.
|
|
204
|
+
```bash
|
|
205
|
+
pip install camoufox[geoip]
|
|
206
|
+
python -m camoufox fetch
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**configuration:**
|
|
210
|
+
add to your environment variables:
|
|
211
|
+
```json
|
|
212
|
+
"GROQ_API_KEY": "gsk_..."
|
|
127
213
|
```
|
|
128
214
|
|
|
215
|
+
---
|
|
216
|
+
|
|
129
217
|
### troubleshooting
|
|
130
218
|
|
|
131
219
|
| problem | solution |
|
|
132
220
|
|---------|----------|
|
|
133
|
-
| **token invalid** | run
|
|
134
|
-
| **
|
|
135
|
-
| **
|
|
136
|
-
| **
|
|
221
|
+
| **token invalid** | run the setup script again to extract a fresh one |
|
|
222
|
+
| **missing dependencies** | ensure `uv` or `pip` installed all requirements (`discord.py-self`, `mcp`, `playwright`) |
|
|
223
|
+
| **playwright error** | run `playwright install chromium` |
|
|
224
|
+
| **audioop error** | ensure `audioop-lts` is installed if using python 3.13+ |
|
|
225
|
+
| **voice error** | install `libffi-dev` (linux) or ensure PyNaCl built correctly |
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### project structure
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
discord_py_self_mcp/
|
|
233
|
+
├── bot.py # discord.py-self client instance
|
|
234
|
+
├── main.py # mcp server entry point
|
|
235
|
+
├── setup.py # setup wizard (token extraction)
|
|
236
|
+
└── tools/ # tool implementations
|
|
237
|
+
├── channels.py
|
|
238
|
+
├── guilds.py
|
|
239
|
+
├── interactions.py
|
|
240
|
+
├── invites.py
|
|
241
|
+
├── members.py
|
|
242
|
+
├── messages.py
|
|
243
|
+
├── presence.py
|
|
244
|
+
├── profile.py
|
|
245
|
+
├── reactions.py
|
|
246
|
+
├── registry.py
|
|
247
|
+
├── relationships.py
|
|
248
|
+
├── threads.py
|
|
249
|
+
└── voice.py
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
137
253
|
|
|
138
254
|
### license
|
|
139
255
|
|
package/index.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
function findPython() {
|
|
7
|
+
const possibleCommands = ['python3', 'python', 'python3.10', 'python3.11', 'python3.12'];
|
|
8
|
+
for (const cmd of possibleCommands) {
|
|
9
|
+
try {
|
|
10
|
+
const result = spawn.sync(cmd, ['--version'], { stdio: 'ignore' });
|
|
11
|
+
if (result.status === 0) {
|
|
12
|
+
return cmd;
|
|
13
|
+
}
|
|
14
|
+
} catch (e) {
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function checkPythonPackage(pythonCmd) {
|
|
21
|
+
try {
|
|
22
|
+
const result = spawn.sync(
|
|
23
|
+
pythonCmd,
|
|
24
|
+
['-c', 'import discord_py_self_mcp'],
|
|
25
|
+
{ stdio: 'ignore' }
|
|
26
|
+
);
|
|
27
|
+
return result.status === 0;
|
|
28
|
+
} catch (e) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function main() {
|
|
34
|
+
const pythonCmd = findPython();
|
|
35
|
+
|
|
36
|
+
if (!pythonCmd) {
|
|
37
|
+
console.error('Error: Python 3.10+ not found. Please install Python 3.10 or higher.');
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!checkPythonPackage(pythonCmd)) {
|
|
42
|
+
console.error('Error: discord-py-self-mcp Python package not installed.');
|
|
43
|
+
console.error('Run: pip install git+https://github.com/Microck/discord.py-self-mcp.git');
|
|
44
|
+
console.error('Or: uv tool install git+https://github.com/Microck/discord.py-self-mcp.git');
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const pythonScript = spawn.sync(
|
|
49
|
+
pythonCmd,
|
|
50
|
+
['-c', 'import discord_py_self_mcp.main as m; print(m.__file__)'],
|
|
51
|
+
{ encoding: 'utf-8' }
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
if (pythonScript.stderr && pythonScript.stderr.includes('ModuleNotFoundError')) {
|
|
55
|
+
console.error('Error: discord-py-self-mcp not found. Install it first.');
|
|
56
|
+
console.error('pip install git+https://github.com/Microck/discord.py-self-mcp.git');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const mainPath = pythonScript.stdout.trim();
|
|
61
|
+
const mainDir = path.dirname(mainPath);
|
|
62
|
+
|
|
63
|
+
const proc = spawn(pythonCmd, ['-m', 'discord_py_self_mcp.main'], {
|
|
64
|
+
stdio: 'inherit',
|
|
65
|
+
env: {
|
|
66
|
+
...process.env,
|
|
67
|
+
PATH: process.env.PATH
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
proc.on('error', (err) => {
|
|
72
|
+
console.error('Failed to start Python MCP server:', err.message);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
proc.on('exit', (code) => {
|
|
77
|
+
process.exit(code ?? 0);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
process.on('SIGTERM', () => proc.kill('SIGTERM'));
|
|
81
|
+
process.on('SIGINT', () => proc.kill('SIGINT'));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
main().catch(err => {
|
|
85
|
+
console.error('Fatal error:', err);
|
|
86
|
+
process.exit(1);
|
|
87
|
+
});
|
package/package.json
CHANGED
|
@@ -1,48 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "discord-selfbot-mcp",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"main": "dist/index.js",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Discord Selfbot MCP server - Node.js wrapper for Python implementation",
|
|
5
|
+
"main": "index.js",
|
|
7
6
|
"bin": {
|
|
8
|
-
"discord-selfbot-mcp": "
|
|
9
|
-
"discord-selfbot-mcp-setup": "
|
|
7
|
+
"discord-selfbot-mcp": "index.js",
|
|
8
|
+
"discord-selfbot-mcp-setup": "setup-wizard.js"
|
|
10
9
|
},
|
|
11
10
|
"scripts": {
|
|
12
|
-
"
|
|
13
|
-
"dev": "tsx src/index.ts",
|
|
14
|
-
"start": "node dist/index.js",
|
|
15
|
-
"setup": "tsx src/setup.ts",
|
|
16
|
-
"lint": "eslint src/",
|
|
17
|
-
"typecheck": "tsc --noEmit"
|
|
11
|
+
"postinstall": "node scripts/postinstall.js"
|
|
18
12
|
},
|
|
13
|
+
"files": [
|
|
14
|
+
"index.js",
|
|
15
|
+
"setup-wizard.js",
|
|
16
|
+
"scripts/postinstall.js"
|
|
17
|
+
],
|
|
19
18
|
"keywords": [
|
|
19
|
+
"mcp",
|
|
20
20
|
"discord",
|
|
21
21
|
"selfbot",
|
|
22
|
-
"mcp",
|
|
23
22
|
"model-context-protocol",
|
|
24
23
|
"ai",
|
|
25
24
|
"automation"
|
|
26
25
|
],
|
|
27
|
-
"author": "",
|
|
26
|
+
"author": "Microck",
|
|
28
27
|
"license": "MIT",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"playwright": "^1.57.0",
|
|
33
|
-
"zod": "^3.24.1",
|
|
34
|
-
"zod-to-json-schema": "^3.25.1"
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/Microck/discord.py-self-mcp.git"
|
|
35
31
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"tsx": "^4.19.2",
|
|
39
|
-
"typescript": "^5.7.2"
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"playwright": "^1.40.0"
|
|
40
34
|
},
|
|
41
35
|
"engines": {
|
|
42
36
|
"node": ">=18.0.0"
|
|
43
|
-
}
|
|
44
|
-
"files": [
|
|
45
|
-
"dist",
|
|
46
|
-
"README.md"
|
|
47
|
-
]
|
|
37
|
+
}
|
|
48
38
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require('child_process');
|
|
4
|
+
|
|
5
|
+
function findPython() {
|
|
6
|
+
const possibleCommands = ['python3', 'python', 'python3.10', 'python3.11', 'python3.12'];
|
|
7
|
+
for (const cmd of possibleCommands) {
|
|
8
|
+
const result = spawnSync(cmd, ['--version'], { stdio: 'ignore' });
|
|
9
|
+
if (result.status === 0) {
|
|
10
|
+
return cmd;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const pythonCmd = findPython();
|
|
17
|
+
|
|
18
|
+
if (!pythonCmd) {
|
|
19
|
+
console.warn('⚠️ Warning: Python 3.10+ not found.');
|
|
20
|
+
console.warn(' Please install Python 3.10 or higher to use this package.');
|
|
21
|
+
console.warn(' https://www.python.org/downloads/');
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const packageCheck = spawnSync(
|
|
26
|
+
pythonCmd,
|
|
27
|
+
['-c', 'import discord_py_self_mcp'],
|
|
28
|
+
{ stdio: 'pipe' }
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
if (packageCheck.status !== 0) {
|
|
32
|
+
console.warn('⚠️ Warning: discord-py-self-mcp Python package not installed.');
|
|
33
|
+
console.warn('');
|
|
34
|
+
console.warn(' To install, run one of the following:');
|
|
35
|
+
console.warn('');
|
|
36
|
+
console.warn(' Using pip:');
|
|
37
|
+
console.warn(' pip install git+https://github.com/Microck/discord.py-self-mcp.git');
|
|
38
|
+
console.warn('');
|
|
39
|
+
console.warn(' Using uv (recommended):');
|
|
40
|
+
console.warn(' uv tool install git+https://github.com/Microck/discord.py-self-mcp.git');
|
|
41
|
+
console.warn('');
|
|
42
|
+
console.warn(' Or install manually:');
|
|
43
|
+
console.warn(' git clone https://github.com/Microck/discord.py-self-mcp.git');
|
|
44
|
+
console.warn(' cd discord.py-self-mcp');
|
|
45
|
+
console.warn(' pip install -e .');
|
|
46
|
+
console.warn('');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
console.log('✅ discord-selfbot-mcp npm package installed successfully!');
|
package/setup-wizard.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { chromium } = require('playwright');
|
|
4
|
+
const readline = require('readline');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
const DISCORD_URL = 'https://discord.com/login';
|
|
8
|
+
|
|
9
|
+
const rl = readline.createInterface({
|
|
10
|
+
input: process.stdin,
|
|
11
|
+
output: process.stdout
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
function question(prompt) {
|
|
15
|
+
return new Promise(resolve => rl.question(prompt, resolve));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function getTokenFromBrowser() {
|
|
19
|
+
console.log('Opening browser...');
|
|
20
|
+
|
|
21
|
+
const browser = await chromium.launch({
|
|
22
|
+
headless: false,
|
|
23
|
+
args: ['--disable-blink-features=AutomationControlled']
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const context = await browser.newContext({
|
|
27
|
+
viewport: { width: 1280, height: 800 },
|
|
28
|
+
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const page = await context.newPage();
|
|
32
|
+
await page.goto(DISCORD_URL);
|
|
33
|
+
|
|
34
|
+
console.log('Please log in to Discord in the opened browser window.');
|
|
35
|
+
console.log('The script will automatically detect your token once you are logged in.');
|
|
36
|
+
|
|
37
|
+
let token = null;
|
|
38
|
+
while (!token) {
|
|
39
|
+
try {
|
|
40
|
+
token = await page.evaluate(`
|
|
41
|
+
(webpackChunkdiscord_app.push([[],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken).exports.default.getToken()
|
|
42
|
+
`);
|
|
43
|
+
if (token) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
} catch (e) {
|
|
47
|
+
}
|
|
48
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log(`Token found: ${token.substring(0, 20)}...${token.substring(token.length - 5)}`);
|
|
52
|
+
await browser.close();
|
|
53
|
+
return token;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function generateConfig(token) {
|
|
57
|
+
return {
|
|
58
|
+
mcpServers: {
|
|
59
|
+
'discord-selfbot': {
|
|
60
|
+
command: 'discord-selfbot-mcp',
|
|
61
|
+
env: {
|
|
62
|
+
DISCORD_TOKEN: token
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function main() {
|
|
70
|
+
console.log('=== Discord Selfbot MCP Setup ===');
|
|
71
|
+
console.log('1. Extract token automatically (browser)');
|
|
72
|
+
console.log('2. Enter token manually');
|
|
73
|
+
|
|
74
|
+
const choice = await question('Choice (1/2): ');
|
|
75
|
+
|
|
76
|
+
let token = null;
|
|
77
|
+
if (choice === '1') {
|
|
78
|
+
token = await getTokenFromBrowser();
|
|
79
|
+
} else {
|
|
80
|
+
token = await question('Enter your Discord token: ');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (!token) {
|
|
84
|
+
console.log('No token provided.');
|
|
85
|
+
rl.close();
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
console.log('\nGenerated MCP Configuration:');
|
|
90
|
+
console.log(JSON.stringify(generateConfig(token), null, 2));
|
|
91
|
+
|
|
92
|
+
const save = await question('\nSave to mcp.json? (y/n): ');
|
|
93
|
+
if (save.toLowerCase() === 'y') {
|
|
94
|
+
const fs = require('fs');
|
|
95
|
+
fs.writeFileSync('mcp.json', JSON.stringify(generateConfig(token), null, 2));
|
|
96
|
+
console.log('Saved to mcp.json');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
rl.close();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
main().catch(err => {
|
|
103
|
+
console.error('Error:', err.message);
|
|
104
|
+
rl.close();
|
|
105
|
+
process.exit(1);
|
|
106
|
+
});
|