@deadragdoll/tellymcp 0.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.
Files changed (124) hide show
  1. package/.env.example.client +93 -0
  2. package/.env.example.gateway +120 -0
  3. package/CHANGELOG.md +155 -0
  4. package/LICENSE +21 -0
  5. package/README-ru.md +338 -0
  6. package/README.md +1262 -0
  7. package/STANDALONE-ru.md +266 -0
  8. package/STANDALONE.md +266 -0
  9. package/TOOLS.md +1296 -0
  10. package/config/templates/env.both.template +83 -0
  11. package/config/templates/env.client.template +60 -0
  12. package/config/templates/env.gateway.template +82 -0
  13. package/dist/cli.js +636 -0
  14. package/dist/index.js +17 -0
  15. package/dist/lib/logfeed/store.js +52 -0
  16. package/dist/lib/middlewares/tracer.js +172 -0
  17. package/dist/lib/mixins/db.js +267 -0
  18. package/dist/lib/mixins/logfeed.js +34 -0
  19. package/dist/lib/mixins/session.errors.js +142 -0
  20. package/dist/lib/moleculer.js +2 -0
  21. package/dist/lib/trace.js +147 -0
  22. package/dist/lib/traceContext.js +116 -0
  23. package/dist/moleculer.config.js +274 -0
  24. package/dist/services/features/telegram-mcp/approval.service.js +33 -0
  25. package/dist/services/features/telegram-mcp/browser.service.js +42 -0
  26. package/dist/services/features/telegram-mcp/collaboration.service.js +53 -0
  27. package/dist/services/features/telegram-mcp/ensuredb.service.js +337 -0
  28. package/dist/services/features/telegram-mcp/gateway-delivery.service.js +378 -0
  29. package/dist/services/features/telegram-mcp/gateway-loopback.js +10 -0
  30. package/dist/services/features/telegram-mcp/gateway-rmq.service.js +294 -0
  31. package/dist/services/features/telegram-mcp/gateway-socket.service.js +1463 -0
  32. package/dist/services/features/telegram-mcp/gateway.service.js +1141 -0
  33. package/dist/services/features/telegram-mcp/inbox.service.js +33 -0
  34. package/dist/services/features/telegram-mcp/mcp-http.service.js +76 -0
  35. package/dist/services/features/telegram-mcp/mcp-server.service.js +127 -0
  36. package/dist/services/features/telegram-mcp/notify.service.js +33 -0
  37. package/dist/services/features/telegram-mcp/pair.service.js +33 -0
  38. package/dist/services/features/telegram-mcp/runtime.service.js +36 -0
  39. package/dist/services/features/telegram-mcp/session-context.service.js +33 -0
  40. package/dist/services/features/telegram-mcp/src/app/bootstrap/runtime.js +103 -0
  41. package/dist/services/features/telegram-mcp/src/app/config/env.js +317 -0
  42. package/dist/services/features/telegram-mcp/src/app/http.js +774 -0
  43. package/dist/services/features/telegram-mcp/src/app/index.js +2 -0
  44. package/dist/services/features/telegram-mcp/src/app/providers/mcp/server.js +13 -0
  45. package/dist/services/features/telegram-mcp/src/app/providers/redis/client.js +18 -0
  46. package/dist/services/features/telegram-mcp/src/app/webapp/assets.js +740 -0
  47. package/dist/services/features/telegram-mcp/src/app/webapp/auth.js +267 -0
  48. package/dist/services/features/telegram-mcp/src/app/webapp/relay.js +69 -0
  49. package/dist/services/features/telegram-mcp/src/app/webapp/tmux.js +9 -0
  50. package/dist/services/features/telegram-mcp/src/entities/auth/model/types.js +2 -0
  51. package/dist/services/features/telegram-mcp/src/entities/browser/model/types.js +2 -0
  52. package/dist/services/features/telegram-mcp/src/entities/collaboration/model/types.js +2 -0
  53. package/dist/services/features/telegram-mcp/src/entities/inbox/model/types.js +2 -0
  54. package/dist/services/features/telegram-mcp/src/entities/request/model/schema.js +545 -0
  55. package/dist/services/features/telegram-mcp/src/entities/request/model/types.js +2 -0
  56. package/dist/services/features/telegram-mcp/src/entities/session/model/types.js +2 -0
  57. package/dist/services/features/telegram-mcp/src/features/ask-user/model/askUserTelegram.js +33 -0
  58. package/dist/services/features/telegram-mcp/src/features/browser/model/browserClearLogsTool.js +28 -0
  59. package/dist/services/features/telegram-mcp/src/features/browser/model/browserClickTool.js +28 -0
  60. package/dist/services/features/telegram-mcp/src/features/browser/model/browserCloseTool.js +28 -0
  61. package/dist/services/features/telegram-mcp/src/features/browser/model/browserComputedStyleTool.js +28 -0
  62. package/dist/services/features/telegram-mcp/src/features/browser/model/browserConsoleTool.js +28 -0
  63. package/dist/services/features/telegram-mcp/src/features/browser/model/browserDomTool.js +28 -0
  64. package/dist/services/features/telegram-mcp/src/features/browser/model/browserErrorsTool.js +28 -0
  65. package/dist/services/features/telegram-mcp/src/features/browser/model/browserFillTool.js +28 -0
  66. package/dist/services/features/telegram-mcp/src/features/browser/model/browserNetworkFailuresTool.js +28 -0
  67. package/dist/services/features/telegram-mcp/src/features/browser/model/browserOpenTool.js +33 -0
  68. package/dist/services/features/telegram-mcp/src/features/browser/model/browserPressTool.js +28 -0
  69. package/dist/services/features/telegram-mcp/src/features/browser/model/browserReloadTool.js +28 -0
  70. package/dist/services/features/telegram-mcp/src/features/browser/model/browserScreenshotTool.js +28 -0
  71. package/dist/services/features/telegram-mcp/src/features/browser/model/browserService.js +689 -0
  72. package/dist/services/features/telegram-mcp/src/features/browser/model/browserWaitForTool.js +28 -0
  73. package/dist/services/features/telegram-mcp/src/features/browser/model/browserWaitForUrlTool.js +28 -0
  74. package/dist/services/features/telegram-mcp/src/features/collaboration/model/backend.js +2 -0
  75. package/dist/services/features/telegram-mcp/src/features/collaboration/model/collaborationService.js +26 -0
  76. package/dist/services/features/telegram-mcp/src/features/collaboration/model/localCollaborationBackend.js +390 -0
  77. package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerFileService.js +102 -0
  78. package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerFileTool.js +33 -0
  79. package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerNoteTool.js +33 -0
  80. package/dist/services/features/telegram-mcp/src/features/distributed-client/model/gatewayCollaborationBackend.js +69 -0
  81. package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/gatewayHttpService.js +657 -0
  82. package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/gatewayReplyResolution.js +17 -0
  83. package/dist/services/features/telegram-mcp/src/features/inbox/model/deleteTelegramInboxMessageTool.js +33 -0
  84. package/dist/services/features/telegram-mcp/src/features/inbox/model/getTelegramInboxCountTool.js +33 -0
  85. package/dist/services/features/telegram-mcp/src/features/inbox/model/getTelegramInboxTool.js +33 -0
  86. package/dist/services/features/telegram-mcp/src/features/inbox/model/inboxService.js +77 -0
  87. package/dist/services/features/telegram-mcp/src/features/notify/model/notifyService.js +93 -0
  88. package/dist/services/features/telegram-mcp/src/features/notify/model/notifyTelegramTool.js +33 -0
  89. package/dist/services/features/telegram-mcp/src/features/pair-session/model/clearSessionPairingTool.js +33 -0
  90. package/dist/services/features/telegram-mcp/src/features/pair-session/model/createSessionPairCodeTool.js +33 -0
  91. package/dist/services/features/telegram-mcp/src/features/pair-session/model/generatePairCode.js +202 -0
  92. package/dist/services/features/telegram-mcp/src/features/session-context/model/clearSessionContextTool.js +33 -0
  93. package/dist/services/features/telegram-mcp/src/features/session-context/model/getSessionContextTool.js +33 -0
  94. package/dist/services/features/telegram-mcp/src/features/session-context/model/getTmuxTargetTool.js +33 -0
  95. package/dist/services/features/telegram-mcp/src/features/session-context/model/renameSessionTool.js +33 -0
  96. package/dist/services/features/telegram-mcp/src/features/session-context/model/sessionContextService.js +409 -0
  97. package/dist/services/features/telegram-mcp/src/features/session-context/model/setSessionContextTool.js +33 -0
  98. package/dist/services/features/telegram-mcp/src/features/session-context/model/setTmuxTargetTool.js +33 -0
  99. package/dist/services/features/telegram-mcp/src/features/tools-sync/model/refreshToolsMarkdownService.js +123 -0
  100. package/dist/services/features/telegram-mcp/src/features/tools-sync/model/refreshToolsMarkdownTool.js +33 -0
  101. package/dist/services/features/telegram-mcp/src/processes/human-approval/model/orchestrator.js +243 -0
  102. package/dist/services/features/telegram-mcp/src/shared/api/storage/contract.js +2 -0
  103. package/dist/services/features/telegram-mcp/src/shared/api/tool-registry/registry.js +8 -0
  104. package/dist/services/features/telegram-mcp/src/shared/api/tool-registry/types.js +2 -0
  105. package/dist/services/features/telegram-mcp/src/shared/api/transport/contract.js +2 -0
  106. package/dist/services/features/telegram-mcp/src/shared/integrations/object-storage/minioExchangeStore.js +86 -0
  107. package/dist/services/features/telegram-mcp/src/shared/integrations/redis/stateStore.js +436 -0
  108. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/collabSemantics.js +21 -0
  109. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/collabUi.js +87 -0
  110. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/messageFormat.js +60 -0
  111. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/proxyFetch.js +46 -0
  112. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transport.js +6534 -0
  113. package/dist/services/features/telegram-mcp/src/shared/integrations/tmux/client.js +280 -0
  114. package/dist/services/features/telegram-mcp/src/shared/lib/ids/ids.js +34 -0
  115. package/dist/services/features/telegram-mcp/src/shared/lib/logger/logger.js +68 -0
  116. package/dist/services/features/telegram-mcp/src/shared/lib/project-identity/projectIdentity.js +223 -0
  117. package/dist/services/features/telegram-mcp/src/shared/lib/redact-secrets/redactSecrets.js +22 -0
  118. package/dist/services/features/telegram-mcp/src/shared/lib/truncate/truncate.js +12 -0
  119. package/dist/services/features/telegram-mcp/src/shared/lib/version/versionHandshake.js +124 -0
  120. package/dist/services/features/telegram-mcp/src/shared/types/common.js +2 -0
  121. package/dist/services/features/telegram-mcp/standalone-http.service.js +113 -0
  122. package/dist/services/features/telegram-mcp/tools-sync.service.js +33 -0
  123. package/package.json +110 -0
  124. package/scripts/postinstall.js +60 -0
@@ -0,0 +1,266 @@
1
+ # TellyMCP Standalone Guide
2
+
3
+ [English](STANDALONE.md) | [Русский](STANDALONE-ru.md)
4
+
5
+ Это пошаговая инструкция для самого простого сценария TellyMCP:
6
+
7
+ - одна машина
8
+ - один Telegram-бот
9
+ - без shared gateway
10
+ - без Postgres
11
+ - без RabbitMQ
12
+
13
+ Именно с этого режима лучше начинать.
14
+
15
+ ## Что понадобится
16
+
17
+ Перед установкой нужны:
18
+
19
+ 1. Node.js 24+
20
+ 2. `tmux`
21
+ 3. Redis
22
+ 4. Telegram bot token из BotFather
23
+
24
+ Зачем это нужно:
25
+
26
+ - Node.js запускает сервис
27
+ - `tmux` нужен для Live View, `nudge` и полноценной интерактивной работы
28
+ - Redis хранит состояние сессий, inbox, pairing и меню
29
+ - Telegram bot token связывает сервис с Telegram
30
+
31
+ ## Шаг 1. Установить зависимости
32
+
33
+ Пример для Ubuntu / Debian:
34
+
35
+ ```bash
36
+ sudo apt-get update
37
+ sudo apt-get install -y tmux redis-server
38
+ node -v
39
+ tmux -V
40
+ redis-cli ping
41
+ ```
42
+
43
+ Ожидаемый результат:
44
+
45
+ - Node версии `24.x` или новее
46
+ - `tmux -V` показывает версию
47
+ - `redis-cli ping` возвращает `PONG`
48
+
49
+ ## Шаг 2. Создать Telegram-бота
50
+
51
+ В Telegram:
52
+
53
+ 1. Открой BotFather
54
+ 2. Выполни `/newbot`
55
+ 3. Выбери имя бота
56
+ 4. Выбери username бота
57
+ 5. Сохрани токен
58
+
59
+ Тебе понадобятся:
60
+
61
+ - `TELEGRAM_BOT_TOKEN`
62
+ - `TELEGRAM_BOT_USERNAME`
63
+
64
+ ## Шаг 3. Установить TellyMCP
65
+
66
+ ```bash
67
+ npm install -g @deadragdoll/tellymcp
68
+ ```
69
+
70
+ Проверка CLI:
71
+
72
+ ```bash
73
+ tellymcp help
74
+ ```
75
+
76
+ ## Шаг 4. Запустить агента в tmux
77
+
78
+ Это важный момент.
79
+
80
+ Для полноценной работы агент лучше запускать внутри `tmux`, а не в обычной shell-сессии.
81
+
82
+ Создать tmux-сессию:
83
+
84
+ ```bash
85
+ tmux new -s backend
86
+ ```
87
+
88
+ Хорошие имена:
89
+
90
+ - `backend`
91
+ - `frontend`
92
+ - `review`
93
+ - `ops`
94
+
95
+ Почему имя tmux-сессии важно:
96
+
97
+ - по нему проще различать агентов
98
+ - оно улучшает диагностику
99
+ - в Telegram и Live View проще понимать, какая сессия открыта
100
+
101
+ Если нужно выйти:
102
+
103
+ ```bash
104
+ tmux detach
105
+ ```
106
+
107
+ И вернуться:
108
+
109
+ ```bash
110
+ tmux attach -t backend
111
+ ```
112
+
113
+ ## Шаг 5. Создать standalone-конфиг
114
+
115
+ В рабочей директории:
116
+
117
+ ```bash
118
+ tellymcp init client
119
+ ```
120
+
121
+ Команда создаст локальный `.env`.
122
+
123
+ ## Шаг 6. Заполнить `.env`
124
+
125
+ Минимум:
126
+
127
+ ```env
128
+ TELEGRAM_BOT_TOKEN=...
129
+ TELEGRAM_BOT_USERNAME=@your_bot
130
+ REDIS_HOST=127.0.0.1
131
+ REDIS_PORT=6379
132
+ REDIS_DB=1
133
+ MCP_HTTP_HOST=127.0.0.1
134
+ MCP_HTTP_PORT=8787
135
+ MCP_HTTP_PATH=/mcp
136
+ MCP_HTTP_BEARER_TOKEN=choose-a-secret-token
137
+ DISTRIBUTED_MODE=client
138
+ WEBAPP_ENABLED=true
139
+ ```
140
+
141
+ Если tmux использует нестандартный socket:
142
+
143
+ ```env
144
+ TMUX_SOCKET_PATH=/tmp/tmux-1000/default
145
+ ```
146
+
147
+ ## Шаг 7. Проверить конфиг
148
+
149
+ ```bash
150
+ tellymcp doctor --env .env
151
+ ```
152
+
153
+ В standalone `client` режиме он должен проверить:
154
+
155
+ - `tmux`
156
+ - `.env`
157
+ - Redis
158
+ - локальный MCP bind
159
+
160
+ ## Шаг 8. Запустить сервис
161
+
162
+ ```bash
163
+ tellymcp run --env .env
164
+ ```
165
+
166
+ Обычный standalone MCP endpoint:
167
+
168
+ - `http://127.0.0.1:8787/mcp`
169
+
170
+ ## Шаг 9. Подключить MCP к агенту
171
+
172
+ Чтобы получить готовый snippet:
173
+
174
+ ```bash
175
+ tellymcp mcp --help
176
+ ```
177
+
178
+ Типичный локальный endpoint:
179
+
180
+ - `http://127.0.0.1:8787/mcp`
181
+
182
+ Если используешь bearer auth, агент должен подключаться с тем же токеном, что и в `.env`.
183
+
184
+ ## Шаг 10. Привязать агента к Telegram
185
+
186
+ После подключения MCP можно просто написать агенту:
187
+
188
+ - `привяжись к Telegram`
189
+ - `подключись к Telegram`
190
+ - `свяжи эту сессию с Telegram`
191
+ - `создай код привязки к Telegram`
192
+
193
+ Ожидаемый flow:
194
+
195
+ 1. агент вызывает `create_session_pair_code`
196
+ 2. отдаёт короткий код
197
+ 3. ты отправляешь боту `/start <code>` или `/link <code>`
198
+ 4. после успеха открываешь `/menu`
199
+
200
+ Если агент работает внутри `tmux`, ему желательно передать:
201
+
202
+ - `cwd`
203
+ - имя tmux-сессии
204
+ - tmux window/pane атрибуты
205
+
206
+ Тогда `Live` и `nudge` заработают сразу.
207
+
208
+ ## Шаг 11. Что будет после pairing
209
+
210
+ После привязки Telegram можно использовать для:
211
+
212
+ - inbox
213
+ - вопросов к человеку
214
+ - local partner collaboration
215
+ - переключения сессий
216
+ - просмотра storage
217
+ - Live View
218
+
219
+ Агент сможет:
220
+
221
+ - вызывать `ask_user_telegram`
222
+ - читать несвязанные входящие сообщения
223
+ - отправлять note и файлы
224
+ - получать tmux `nudge`, когда появляется новая работа
225
+
226
+ ## Что работает без tmux
227
+
228
+ TellyMCP можно запустить и без `tmux`, но это урезанный режим.
229
+
230
+ Не будет:
231
+
232
+ - Live View
233
+ - tmux `nudge`
234
+ - прямого управления из Telegram Mini App
235
+
236
+ Такой режим стоит использовать только если тебя устраивает пассивная работа.
237
+
238
+ ## Troubleshooting
239
+
240
+ Если `doctor` ругается:
241
+
242
+ - проверь, что Redis запущен
243
+ - проверь, что установлен `tmux`
244
+ - проверь правильность bot token
245
+ - проверь, что bearer token совпадает с MCP-конфигом агента
246
+
247
+ Если pairing работает, а Live View нет:
248
+
249
+ - убедись, что агент действительно запущен внутри `tmux`
250
+ - убедись, что у tmux-сессии есть стабильное имя
251
+ - при необходимости задай `TMUX_SOCKET_PATH`
252
+
253
+ Если агент не может подключиться к MCP:
254
+
255
+ - проверь, что `tellymcp run --env .env` действительно запущен
256
+ - проверь endpoint `http://127.0.0.1:8787/mcp`
257
+ - проверь bearer token
258
+
259
+ ## Следующий шаг
260
+
261
+ Когда standalone уже работает, дальше можно переходить к:
262
+
263
+ - `gateway`
264
+ - или `both`
265
+
266
+ Это нужно только если нужен `Collab` между машинами.
package/STANDALONE.md ADDED
@@ -0,0 +1,266 @@
1
+ # TellyMCP Standalone Guide
2
+
3
+ [English](STANDALONE.md) | [Русский](STANDALONE-ru.md)
4
+
5
+ This guide explains the simplest TellyMCP setup:
6
+
7
+ - one machine
8
+ - one Telegram bot
9
+ - no shared gateway
10
+ - no Postgres
11
+ - no RabbitMQ
12
+
13
+ This is the best way to start.
14
+
15
+ ## What you need
16
+
17
+ Before installation, make sure you have:
18
+
19
+ 1. Node.js 24+
20
+ 2. `tmux`
21
+ 3. Redis
22
+ 4. a Telegram bot token from BotFather
23
+
24
+ Why these matter:
25
+
26
+ - Node.js runs the service
27
+ - `tmux` enables Live View, nudges, and direct Telegram-side interaction
28
+ - Redis stores session state, inbox, pairing state, and menu state
29
+ - Telegram bot token connects your bot to Telegram
30
+
31
+ ## Step 1. Install prerequisites
32
+
33
+ Ubuntu / Debian example:
34
+
35
+ ```bash
36
+ sudo apt-get update
37
+ sudo apt-get install -y tmux redis-server
38
+ node -v
39
+ tmux -V
40
+ redis-cli ping
41
+ ```
42
+
43
+ Expected:
44
+
45
+ - Node version is `24.x` or newer
46
+ - `tmux -V` prints a version
47
+ - `redis-cli ping` returns `PONG`
48
+
49
+ ## Step 2. Create a Telegram bot
50
+
51
+ In Telegram:
52
+
53
+ 1. Open BotFather
54
+ 2. Run `/newbot`
55
+ 3. Choose a bot name
56
+ 4. Choose a bot username
57
+ 5. Save the token
58
+
59
+ You will need:
60
+
61
+ - `TELEGRAM_BOT_TOKEN`
62
+ - `TELEGRAM_BOT_USERNAME`
63
+
64
+ ## Step 3. Install TellyMCP
65
+
66
+ ```bash
67
+ npm install -g @deadragdoll/tellymcp
68
+ ```
69
+
70
+ Check that the CLI works:
71
+
72
+ ```bash
73
+ tellymcp help
74
+ ```
75
+
76
+ ## Step 4. Start a tmux session for the agent
77
+
78
+ This part is important.
79
+
80
+ Run the agent inside `tmux`, not in a plain shell, if you want the full experience.
81
+
82
+ Create a session:
83
+
84
+ ```bash
85
+ tmux new -s backend
86
+ ```
87
+
88
+ Good session names:
89
+
90
+ - `backend`
91
+ - `frontend`
92
+ - `review`
93
+ - `ops`
94
+
95
+ Why the session name matters:
96
+
97
+ - it helps identify the agent in practice
98
+ - it improves diagnostics
99
+ - it makes Telegram and Live View easier to understand
100
+
101
+ If you later detach:
102
+
103
+ ```bash
104
+ tmux detach
105
+ ```
106
+
107
+ and return:
108
+
109
+ ```bash
110
+ tmux attach -t backend
111
+ ```
112
+
113
+ ## Step 5. Create the standalone config
114
+
115
+ Inside the workspace where you want to run TellyMCP:
116
+
117
+ ```bash
118
+ tellymcp init client
119
+ ```
120
+
121
+ This creates a local `.env`.
122
+
123
+ ## Step 6. Fill `.env`
124
+
125
+ At minimum, set:
126
+
127
+ ```env
128
+ TELEGRAM_BOT_TOKEN=...
129
+ TELEGRAM_BOT_USERNAME=@your_bot
130
+ REDIS_HOST=127.0.0.1
131
+ REDIS_PORT=6379
132
+ REDIS_DB=1
133
+ MCP_HTTP_HOST=127.0.0.1
134
+ MCP_HTTP_PORT=8787
135
+ MCP_HTTP_PATH=/mcp
136
+ MCP_HTTP_BEARER_TOKEN=choose-a-secret-token
137
+ DISTRIBUTED_MODE=client
138
+ WEBAPP_ENABLED=true
139
+ ```
140
+
141
+ If your tmux server uses a non-default socket:
142
+
143
+ ```env
144
+ TMUX_SOCKET_PATH=/tmp/tmux-1000/default
145
+ ```
146
+
147
+ ## Step 7. Validate the setup
148
+
149
+ ```bash
150
+ tellymcp doctor --env .env
151
+ ```
152
+
153
+ In standalone `client` mode it should verify:
154
+
155
+ - `tmux`
156
+ - `.env`
157
+ - Redis
158
+ - local MCP bind
159
+
160
+ ## Step 8. Run the service
161
+
162
+ ```bash
163
+ tellymcp run --env .env
164
+ ```
165
+
166
+ Standalone MCP endpoint is normally:
167
+
168
+ - `http://127.0.0.1:8787/mcp`
169
+
170
+ ## Step 9. Add MCP to your agent
171
+
172
+ To get a ready-to-paste config snippet:
173
+
174
+ ```bash
175
+ tellymcp mcp --help
176
+ ```
177
+
178
+ Typical local MCP config target:
179
+
180
+ - `http://127.0.0.1:8787/mcp`
181
+
182
+ If you use bearer auth, configure your agent with the same token from `.env`.
183
+
184
+ ## Step 10. Pair the agent with Telegram
185
+
186
+ Once MCP is connected, tell the agent something like:
187
+
188
+ - `pair with Telegram`
189
+ - `link to Telegram`
190
+ - `connect this session to Telegram`
191
+ - `create a Telegram pairing code`
192
+
193
+ Expected flow:
194
+
195
+ 1. the agent calls `create_session_pair_code`
196
+ 2. it gives you a short code
197
+ 3. you send `/start <code>` or `/link <code>` to the bot
198
+ 4. after success, open `/menu`
199
+
200
+ If the agent is running inside `tmux`, it should pass:
201
+
202
+ - `cwd`
203
+ - tmux session name
204
+ - tmux window/pane attributes
205
+
206
+ This lets Live View and tmux nudges work immediately.
207
+
208
+ ## Step 11. What you get after pairing
209
+
210
+ After pairing, Telegram can be used for:
211
+
212
+ - inbox messages
213
+ - clarifying questions
214
+ - local partner collaboration
215
+ - session switching
216
+ - storage inspection
217
+ - Live View
218
+
219
+ The agent can:
220
+
221
+ - call `ask_user_telegram`
222
+ - read unsolicited inbox messages
223
+ - send notes and files
224
+ - receive tmux nudges when new work arrives
225
+
226
+ ## What works without tmux
227
+
228
+ TellyMCP can still run without `tmux`, but this is a reduced mode.
229
+
230
+ You lose:
231
+
232
+ - Live View
233
+ - tmux nudges
234
+ - direct Telegram Mini App controls
235
+
236
+ Use this only if you accept a passive workflow.
237
+
238
+ ## Troubleshooting
239
+
240
+ If `doctor` fails:
241
+
242
+ - verify Redis is running
243
+ - verify `tmux` is installed
244
+ - verify the bot token is correct
245
+ - verify your bearer token matches the MCP client config
246
+
247
+ If pairing works but Live View does not:
248
+
249
+ - make sure the agent is really inside `tmux`
250
+ - make sure the tmux session has a stable name
251
+ - if needed, set `TMUX_SOCKET_PATH`
252
+
253
+ If the agent cannot connect to MCP:
254
+
255
+ - confirm `tellymcp run --env .env` is running
256
+ - confirm the endpoint is `http://127.0.0.1:8787/mcp`
257
+ - confirm the bearer token matches
258
+
259
+ ## Next step
260
+
261
+ After standalone is working, the next upgrade path is:
262
+
263
+ - `gateway`
264
+ - or `both`
265
+
266
+ Use that only when you need cross-machine collaboration.