Skip to content

feat(tg): tg_* tools read Telegram through the VIBEE app (refs gHashTag/t27#10066) - #21

Merged
gHashTag merged 1 commit into
masterfrom
t27mcp/telegram-via-app
Oct 18, 2026
Merged

gHashTag merged 1 commit into
masterfrom
t27mcp/telegram-via-app

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

What

The tg_* tools now read the owner's Telegram account through the owner's VIBEE app instead of the tg CLI.

The app is gHashTag/999-multibots-telegraf, running as the vibee-render service. It already holds the logged-in session and serves its tg_* tools at POST /mcp. The tg CLI's Keychain session was never created, so the old tools could only answer no session. These tools return data from the first call.

There are seven tools, under the app's own names:

  • tg_unanswered
  • tg_dialogs
  • tg_history
  • tg_search
  • tg_contacts
  • tg_participants
  • tg_scheduled

The contract is specs/t27mcp/telegram.t27, in gHashTag/t27#10326. It is compiled to wasm/telegram.wasm (332 B), and wasm/telegram_table.mjs is generated from it.

  • Arguments. A bad chat or query is refused before the app is called.
  • Outcomes.
    • no key (VIBEE_AGENT_KEY unset)
    • unreachable
    • denied (401/403)
    • failed (non-200, or an error inside a 200)
    • ok
  • Sending. There is no send tool. A send over /mcp becomes a draft that no screen can confirm. tg_unanswered ends by pointing to the app's bot or mini app, where the owner presses the button on the draft card.

Changes

  • telegram.mjs: the glue, rewritten to forward to the app over fetch, 39 lines. It passes counts and flags to the wasm, never text.
  • wasm/telegram.wasm and wasm/telegram_table.mjs are regenerated.
  • The wasm/BUILD record is updated.
  • In the README, the tool row and the configuration rows (VIBEE_AGENT_KEY, T27_TG_APP) replace T27_TG.

Evidence

Live on the owner's Mac over stdio JSON-RPC:

  • tools/list lists 26 tools.
  • tg_unanswered {limit: 3} returns data that starts with the FOREIGN DATA line and ends with the line on where sending is.
  • tg_search {query: "t27"} returns 17 KB.
  • tg_history {chat: "bad chat; rm"} is refused with the spec's text.
  • An unset key, a wrong key, T27_TG_APP=http://127.0.0.1:9/mcp and an unknown username each give their own outcome text.

Refs gHashTag/t27#10066

🤖 Generated with Claude Code

… graded by telegram.t27

The owner's session already lives in the VIBEE app (vibee-render, gHashTag/999-multibots-telegraf),
which serves its tg_* tools at POST /mcp. telegram.mjs now forwards a read call the wasm accepted there
with X-Agent-Key from VIBEE_AGENT_KEY, instead of spawning the tg CLI whose Keychain session was never
created. Seven tools under the app's names: tg_unanswered, tg_dialogs, tg_history, tg_search,
tg_contacts, tg_participants, tg_scheduled. No send tool; tg_unanswered ends with where sending is.

wasm/telegram.wasm and wasm/telegram_table.mjs regenerated from specs/t27mcp/telegram.t27
(gHashTag/t27#10326) on the lab: 9 of 9 tests, 0 vacuous, 9 mutants caught.

Refs gHashTag/t27#10066

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag merged commit 9b481b8 into master Oct 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant