@fre4x/telegram 1.0.53
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 +75 -0
- package/dist/index.js +277131 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @fre4x/telegram
|
|
2
|
+
|
|
3
|
+
Telegram MCP server implementing Claude Code Channels for bidirectional communication and remote permission relay.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Push Notifications:** Sends incoming Telegram messages directly to the Claude Code session via `notifications/push_event`.
|
|
8
|
+
- **Bidirectional Chat:** Allows Claude to send messages to Telegram using the `send_telegram_message` tool.
|
|
9
|
+
- **Security:** Filters incoming messages based on an allowed user ID.
|
|
10
|
+
- **Remote Control:** (Planned) Approve or deny Claude's tool-use prompts from your mobile device.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install
|
|
16
|
+
npm run build
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
This MCP server requires environment variables to secure its endpoints and access the Telegram API. You can either provide these via a local `.env` file (for development) or directly inside your Claude Desktop / MCP client JSON configuration (recommended for production).
|
|
22
|
+
|
|
23
|
+
### Environment Variables
|
|
24
|
+
|
|
25
|
+
- `TELEGRAM_BOT_TOKEN` **(Required)**: Your bot's API token. Obtain this by talking to [@BotFather](https://t.me/botfather).
|
|
26
|
+
- `ALLOWED_USER_ID` **(Required)**: The primary Telegram numeric user ID allowed to send messages to the bot in private chats and use commands. Obtain this via [@userinfobot](https://t.me/userinfobot).
|
|
27
|
+
- `ENABLE_RECIPIENT_WHITELIST` *(Optional)*: Set to `"true"` to enforce a strict whitelist of users/groups the bot is allowed to message.
|
|
28
|
+
- `ALLOWED_RECIPIENTS` *(Optional)*: A comma-separated list of Telegram numeric IDs (e.g., `1234567,-100987654`) that Claude is permitted to message.
|
|
29
|
+
|
|
30
|
+
## MCP Client Setup (Claude Desktop)
|
|
31
|
+
|
|
32
|
+
To use this server with Claude Desktop or any standard MCP client, add the following configuration to your `claude_desktop_config.json` (or equivalent MCP settings file).
|
|
33
|
+
|
|
34
|
+
**For macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
35
|
+
**For Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"telegram": {
|
|
41
|
+
"command": "npx",
|
|
42
|
+
"args": [
|
|
43
|
+
"-y",
|
|
44
|
+
"@fre4x/telegram"
|
|
45
|
+
],
|
|
46
|
+
"env": {
|
|
47
|
+
"TELEGRAM_BOT_TOKEN": "your_bot_token_here",
|
|
48
|
+
"ALLOWED_USER_ID": "your_telegram_user_id_here",
|
|
49
|
+
"ENABLE_RECIPIENT_WHITELIST": "true",
|
|
50
|
+
"ALLOWED_RECIPIENTS": "123456789"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Usage with Claude Code (Channels)
|
|
58
|
+
|
|
59
|
+
If you are using this plugin as a bidirectional Claude Code channel rather than a standard tool server:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
claude --channels plugin:telegram --dangerously-load-development-channels
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Development
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run dev
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Run the MCP Inspector:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm run inspector
|
|
75
|
+
```
|