Repository navigation
Releases
Releases · theYahia/tgstat-mcp
v2.0.0
Major rework. Brings the server up to the WWmcp house standard and fixes
correctness bugs verified against the official TGStat API docs
(api.tgstat.ru/docs/ru).
Breaking
- Output is now curated — tools return only the relevant fields (subscribers,
reach, ERR, post text snippet, links) with dates as ISO strings, instead of the
raw API JSON dump. This is cheaper in tokens and easier for an LLM to use.
Consumers that parsed specific raw fields should re-check. search_posts: removed the non-functionalchannelsparameter. TGStat's
posts/searchhas no per-channel filter; the array was being sent as an invalid
peerTypevalue. Replaced with real filters:peer_type,category,
language,country,hide_forwards,minus_words,extended.
Fixed
- Date filters now work.
date_from/date_to(and post date ranges) are
converted to the Unix timestamps the API requires. They were previously sent as
rawYYYY-MM-DD, which the API silently ignored. - Logical API errors are surfaced. A
{"status":"error"}body returned with
HTTP 200 is now reported as a tool error instead of being passed off as success. - Token no longer leaks into logs. Retries/timeouts logged the full request
URL, which carried?token=.... Only the endpoint path is logged now. compare_channelscompares the right thing. It now useschannels/stat
(which has reach/ERR) instead ofchannels/get(which does not), tolerates a
per-channel failure, and returns a table sorted by subscribers.
Added
- 12 new tools (8 → 20):
get_post_stats,get_channel_subscribers,
get_channel_views,get_channel_avg_reach,get_channel_err,
get_channel_forwards,get_word_mentions,get_word_mentions_by_channels,
list_categories,list_countries,list_languages,get_usage. - Retries now cover HTTP 429 (rate limits) and honour the
Retry-Afterheader. - Stronger Zod input validation with sane defaults and limit clamping to API maxima
(channels 100, posts 50, offset 1000). - GitHub Actions CI: build + typecheck + test on Node 18 / 20 / 22.
Internal
- New layout:
client.ts(ApiResulterror-as-value),types.ts,lib/
(formatters, date helpers, tolerant output shapers), and modulartools/*files
registered viaregisterXTools(server). - Tests split into
client.test.tsandtools.test.ts(8 → 26 tests). - Build no longer ships test files in
dist.
Install: npx -y @theyahia/tgstat-mcp@2.0.0 · npm
Tag v2.0.0 was created retroactively and points at commit c4eddab — the exact commit version 2.0.0 was published to npm from on 23.06.2026 (package gitHead), so the tag contents match the published package.