# @theyahia/tgstat-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/theYahia/tgstat-mcp  
**GitHub Stars:** 4  
**npm Downloads (last month):** 70  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/theyahia-tgstat-mcp

## Description
MCP server for TGStat — Telegram channel analytics, search, stats (Russia). 20 tools.

## Tools
Capabilities this server exposes over MCP:

- **search_channels** — Search Telegram channels by query, with optional category / language / country / type filters. Returns curated channel cards.
- **get_channel** — Get a Telegram channel's profile: subscribers, category, citation index (ci_index), RKN verification. For reach/ERR use get_channel_stats.
- **get_channel_stats** — Get a channel's statistics: average post reach, ERR%, daily reach, citation index.
- **get_channel_mentions** — Find where a channel is mentioned or forwarded by other channels and chats.
- **compare_channels** — Compare several channels side by side on subscribers, average reach and ERR (one channels/stat lookup per channel).
- **get_channel_posts** — Get recent posts of a channel with view metrics. Supports an optional date range and pagination.
- **get_post** — Get details of a single post: views, forwards, reactions, text.
- **search_posts** — Full-text search across Telegram posts, with optional source-type / category / language / country / date filters.
- **get_post_stats** — Get a post's engagement dynamics: views, forwards and reactions over time.
- **get_channel_subscribers** — Subscriber-count history of a channel over time.
- **get_channel_views** — Total post-views history of a channel over time.
- **get_channel_avg_reach** — Average post-reach history of a channel over time.
- **get_channel_err** — ERR (engagement rate by reach) history of a channel over time.
- **get_channel_forwards** — Posts from other channels that forwarded this channel's content.
- **get_word_mentions** — Track how often a keyword is mentioned across Telegram over time (mentions + views per period).
- **get_word_mentions_by_channels** — Break down keyword mentions by the channels that mention it most (channel + mention/view counts).
- **list_categories** — List available channel category codes (use as the `category` filter in search).
- **list_countries** — List available country codes (use as the `country` filter in search).
- **list_languages** — List available language codes (use as the `language` filter in search).
- **get_usage** — Show your TGStat API usage and quota: requests / channels / words spent vs allowed, and package expiry.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "tgstat-mcp": {
    "command": "npx",
    "args": ["-y","@theyahia/tgstat-mcp"],
    "env": {
      "TGSTAT_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `TGSTAT_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What @theyahia/tgstat-mcp does

@theyahia/tgstat-mcp exposes TGStat’s Telegram channel analytics and search capabilities through the Model Context Protocol. It is designed for questions that would otherwise require manually browsing TGStat, such as finding Russian-language channels, checking a channel’s average reach and ERR, comparing several channels, or measuring how often a word appears across Telegram content.

The package provides 20 tools for channel discovery, post research, historical metrics, keyword analysis, reference data, and API quota inspection. Results are filtered to relevant fields rather than returning every API field. Typical returned data includes subscriber counts, views, reach, ERR, reposts, text snippets, links, and dates.

## How it works

An MCP client starts the package with `npx`, and the server makes requests to TGStat using the configured API token. TGStat separates access between its Stat API and Search API, so the token’s enabled packages determine which groups of tools are available.

Date filters use `YYYY-MM-DD` values. The server converts those dates into the Unix timestamps expected by the TGStat API, while returned dates use ISO formatting. This keeps natural-language requests and tool responses easier for an AI client to handle.

## Setup and configuration

Create a TGStat API token through the TGStat API website, with access to the Stat API, Search API, or both as required by the tools you plan to use. Set the token as `TGSTAT_TOKEN` in the MCP client configuration.

For Claude Desktop, add an MCP server entry that runs `npx -y @theyahia/tgstat-mcp` and passes `TGSTAT_TOKEN` through the entry’s environment. Claude Code can add the same command with:

```bash
claude mcp add tgstat -e TGSTAT_TOKEN=your_token -- npx -y @theyahia/tgstat-mcp
```

The `get_usage` tool reports consumed requests, channel and word usage, quota limits, and the package expiration date.

## Tools and capabilities

Channel tools support:

- Searching by query with category, language, country, and type filters
- Retrieving channel profiles, subscriber counts, categories, citation index, and RKN status
- Inspecting average post reach, daily reach, and ERR
- Finding channels and chats that mention or repost a channel
- Comparing two to ten channels by subscribers, reach, and ERR

Post tools can list recent posts with date filters and pagination, retrieve individual post details, search post text with filters, and show engagement changes over time.

Historical metric tools track subscribers, total post views, average post reach, ERR, and forwards. Keyword tools show mention and view trends over time and break mentions down by channel. Directory tools list category, country, and language codes for filters.

## Limitations and notes

Tool availability depends on the TGStat token’s Stat API and Search API access. Usage is also governed by the quota and limits attached to the TGStat package. The server provides analytics and search through TGStat; it does not itself perform Telegram advertising, publishing, or messaging actions.

The package is distributed under the MIT license. Its documented client setup uses Claude Desktop and Claude Code, with the server launched as a local `npx` process.

_Full upstream README: https://allmcps.com/mcp/theyahia-tgstat-mcp/readme_

