telegram-dev 0.4.0__tar.gz

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 (65) hide show
  1. telegram_dev-0.4.0/.agents/plugins/marketplace.json +20 -0
  2. telegram_dev-0.4.0/.claude-plugin/marketplace.json +17 -0
  3. telegram_dev-0.4.0/.claude-plugin/plugin.json +19 -0
  4. telegram_dev-0.4.0/.codex-plugin/plugin.json +53 -0
  5. telegram_dev-0.4.0/.cursor-plugin/plugin.json +13 -0
  6. telegram_dev-0.4.0/.dockerignore +9 -0
  7. telegram_dev-0.4.0/.mcp.json +9 -0
  8. telegram_dev-0.4.0/AGENTS.md +20 -0
  9. telegram_dev-0.4.0/CHANGELOG.md +40 -0
  10. telegram_dev-0.4.0/Dockerfile +13 -0
  11. telegram_dev-0.4.0/LICENSE +21 -0
  12. telegram_dev-0.4.0/MANIFEST.in +12 -0
  13. telegram_dev-0.4.0/NOTICE +6 -0
  14. telegram_dev-0.4.0/PKG-INFO +190 -0
  15. telegram_dev-0.4.0/README.md +173 -0
  16. telegram_dev-0.4.0/README.ru.md +167 -0
  17. telegram_dev-0.4.0/assets/icon-dark.svg +5 -0
  18. telegram_dev-0.4.0/assets/icon.svg +5 -0
  19. telegram_dev-0.4.0/assets/logo-dark.svg +6 -0
  20. telegram_dev-0.4.0/assets/logo.svg +6 -0
  21. telegram_dev-0.4.0/deploy/.env.example +2 -0
  22. telegram_dev-0.4.0/deploy/Caddyfile +11 -0
  23. telegram_dev-0.4.0/deploy/challenges/.gitkeep +0 -0
  24. telegram_dev-0.4.0/deploy/compose.yml +35 -0
  25. telegram_dev-0.4.0/docs/catalog-submissions.md +126 -0
  26. telegram_dev-0.4.0/docs/deployment.md +51 -0
  27. telegram_dev-0.4.0/docs/maintenance.md +60 -0
  28. telegram_dev-0.4.0/docs/privacy.md +35 -0
  29. telegram_dev-0.4.0/docs/runtime.md +61 -0
  30. telegram_dev-0.4.0/docs/support.md +9 -0
  31. telegram_dev-0.4.0/docs/terms.md +31 -0
  32. telegram_dev-0.4.0/docs/validation.md +75 -0
  33. telegram_dev-0.4.0/pyproject.toml +23 -0
  34. telegram_dev-0.4.0/scripts/check_sources.py +163 -0
  35. telegram_dev-0.4.0/scripts/install.py +10 -0
  36. telegram_dev-0.4.0/scripts/package_openai.py +283 -0
  37. telegram_dev-0.4.0/server.json +43 -0
  38. telegram_dev-0.4.0/setup.cfg +4 -0
  39. telegram_dev-0.4.0/skills/telegram-dev/SKILL.md +65 -0
  40. telegram_dev-0.4.0/skills/telegram-dev/agents/openai.yaml +6 -0
  41. telegram_dev-0.4.0/skills/telegram-dev/references/bot-operations.md +39 -0
  42. telegram_dev-0.4.0/skills/telegram-dev/references/business-and-commerce.md +39 -0
  43. telegram_dev-0.4.0/skills/telegram-dev/references/buttons-and-custom-emoji.md +51 -0
  44. telegram_dev-0.4.0/skills/telegram-dev/references/client-development.md +37 -0
  45. telegram_dev-0.4.0/skills/telegram-dev/references/feature-checks.md +47 -0
  46. telegram_dev-0.4.0/skills/telegram-dev/references/groups-and-channels.md +35 -0
  47. telegram_dev-0.4.0/skills/telegram-dev/references/mini-apps-and-web.md +40 -0
  48. telegram_dev-0.4.0/skills/telegram-dev/references/surface-map.md +54 -0
  49. telegram_dev-0.4.0/telegram_dev.egg-info/PKG-INFO +190 -0
  50. telegram_dev-0.4.0/telegram_dev.egg-info/SOURCES.txt +63 -0
  51. telegram_dev-0.4.0/telegram_dev.egg-info/dependency_links.txt +1 -0
  52. telegram_dev-0.4.0/telegram_dev.egg-info/entry_points.txt +2 -0
  53. telegram_dev-0.4.0/telegram_dev.egg-info/requires.txt +6 -0
  54. telegram_dev-0.4.0/telegram_dev.egg-info/top_level.txt +3 -0
  55. telegram_dev-0.4.0/telegram_dev_install.py +238 -0
  56. telegram_dev-0.4.0/telegram_knowledge.py +689 -0
  57. telegram_dev-0.4.0/tests/behavioral-cases.json +229 -0
  58. telegram_dev-0.4.0/tests/test_fetch.py +39 -0
  59. telegram_dev-0.4.0/tests/test_http.py +78 -0
  60. telegram_dev-0.4.0/tests/test_install.py +251 -0
  61. telegram_dev-0.4.0/tests/test_knowledge.py +123 -0
  62. telegram_dev-0.4.0/tests/test_package.py +167 -0
  63. telegram_dev-0.4.0/tests/test_refresh.py +203 -0
  64. telegram_dev-0.4.0/tests/test_sources.py +83 -0
  65. telegram_dev-0.4.0/uv.lock +978 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "telegram-dev-tools",
3
+ "interface": {
4
+ "displayName": "Telegram Dev Tools"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "telegram-dev",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Developer Tools"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "telegram-dev-tools",
3
+ "owner": {"name": "Kay0k1"},
4
+ "metadata": {"description": "Independent Telegram development tools with official documentation", "version": "0.4.0"},
5
+ "plugins": [
6
+ {
7
+ "name": "telegram-dev",
8
+ "source": "./",
9
+ "description": "Source-verified Telegram development with official documentation search",
10
+ "version": "0.4.0",
11
+ "homepage": "https://github.com/Kay0k1/telegram-dev",
12
+ "repository": "https://github.com/Kay0k1/telegram-dev",
13
+ "license": "MIT",
14
+ "keywords": ["telegram", "documentation", "bot-api", "mini-apps", "mtproto", "tdlib"]
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "telegram-dev",
3
+ "version": "0.4.0",
4
+ "displayName": "Telegram Dev",
5
+ "description": "Source-verified Telegram development across Bot API, Mini Apps, MTProto, TDLib, media and public releases. Independent project by Kay0k1.",
6
+ "author": {
7
+ "name": "Kay0k1",
8
+ "url": "https://github.com/Kay0k1"
9
+ },
10
+ "homepage": "https://github.com/Kay0k1/telegram-dev",
11
+ "repository": "https://github.com/Kay0k1/telegram-dev",
12
+ "license": "MIT",
13
+ "icon": "./assets/logo.svg",
14
+ "documentationUrl": "https://github.com/Kay0k1/telegram-dev#readme",
15
+ "supportUrl": "https://github.com/Kay0k1/telegram-dev/issues",
16
+ "privacyPolicyUrl": "https://github.com/Kay0k1/telegram-dev/blob/main/docs/privacy.md",
17
+ "termsOfServiceUrl": "https://github.com/Kay0k1/telegram-dev/blob/main/docs/terms.md",
18
+ "keywords": ["telegram", "bot-api", "mini-apps", "mtproto", "tdlib", "documentation"]
19
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "telegram-dev",
3
+ "version": "0.4.0",
4
+ "description": "Source-verified Telegram development across Bot API, Mini Apps, MTProto, TDLib and public release history",
5
+ "author": {
6
+ "name": "Kay0k1",
7
+ "url": "https://github.com/Kay0k1"
8
+ },
9
+ "homepage": "https://github.com/Kay0k1/telegram-dev",
10
+ "repository": "https://github.com/Kay0k1/telegram-dev",
11
+ "license": "MIT",
12
+ "keywords": ["telegram", "bot-api", "mini-apps", "mtproto", "tdlib", "documentation"],
13
+ "skills": "./skills/",
14
+ "mcpServers": {
15
+ "telegram-knowledge": {
16
+ "type": "stdio",
17
+ "command": "uv",
18
+ "args": ["run", "--frozen", "telegram_knowledge.py", "serve"],
19
+ "cwd": "./"
20
+ }
21
+ },
22
+ "interface": {
23
+ "displayName": "Telegram Dev",
24
+ "shortDescription": "Telegram development knowledge",
25
+ "longDescription": "Develop Telegram bots, Mini Apps, clients and integrations using public official documentation. Telegram Dev helps identify the API surface, verify feature eligibility, inspect release changes and read current documentation before implementation. The bundled local MCP maintains a documentation cache; uv is required. This independent community project is maintained by Kay0k1 and is not affiliated with Telegram. It does not connect to Telegram accounts or operate on private chats.",
26
+ "developerName": "Kay0k1",
27
+ "category": "Developer Tools",
28
+ "capabilities": ["Search Telegram documentation", "Read official sources", "Check documentation freshness"],
29
+ "websiteURL": "https://github.com/Kay0k1/telegram-dev",
30
+ "supportURL": "https://github.com/Kay0k1/telegram-dev/issues",
31
+ "privacyPolicyURL": "https://github.com/Kay0k1/telegram-dev/blob/main/docs/privacy.md",
32
+ "termsOfServiceURL": "https://github.com/Kay0k1/telegram-dev/blob/main/docs/terms.md",
33
+ "defaultPrompt": ["Implement a Telegram feature using the current official API documentation.", "Verify how colored Telegram buttons and custom emoji work.", "Check Telegram release changes that affect this project."],
34
+ "brandColor": "#1678C8",
35
+ "brandColorDark": "#58BAFF",
36
+ "composerIcon": "./assets/icon.svg",
37
+ "composerIconDark": "./assets/icon-dark.svg",
38
+ "logo": "./assets/logo.svg",
39
+ "logoDark": "./assets/logo-dark.svg"
40
+ },
41
+ "extensions": {
42
+ "com.openai": {
43
+ "publication": {
44
+ "translations": {
45
+ "ru-RU": {
46
+ "subtitle": "Знания для разработки Telegram",
47
+ "description": "Разрабатывайте ботов, Mini Apps, клиенты и интеграции Telegram по официальной публичной документации. Telegram Dev помогает выбрать API, проверить ограничения функции и изучить изменения релизов. Независимый проект Kay0k1; не связан с Telegram. Локальный MCP хранит кэш документации и требует uv. Доступа к аккаунтам и личным чатам Telegram нет."
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "telegram-dev",
3
+ "version": "0.4.0",
4
+ "description": "Source-verified Telegram development: Bot API, Mini Apps, MTProto, TDLib, media and public releases",
5
+ "author": {"name": "Kay0k1"},
6
+ "license": "MIT",
7
+ "repository": "https://github.com/Kay0k1/telegram-dev",
8
+ "homepage": "https://github.com/Kay0k1/telegram-dev",
9
+ "keywords": ["telegram", "bot-api", "mini-apps", "mtproto", "tdlib", "documentation"],
10
+ "logo": "assets/logo.svg",
11
+ "skills": "./skills/",
12
+ "mcpServers": "./.mcp.json"
13
+ }
@@ -0,0 +1,9 @@
1
+ .git
2
+ .venv
3
+ __pycache__
4
+ *.sqlite3*
5
+ *.zip
6
+ dist
7
+ build
8
+ .source-monitor
9
+ .env
@@ -0,0 +1,9 @@
1
+ {
2
+ "mcpServers": {
3
+ "telegram-knowledge": {
4
+ "type": "stdio",
5
+ "command": "uv",
6
+ "args": ["run", "--frozen", "--directory", "${CLAUDE_PLUGIN_ROOT}", "telegram_knowledge.py", "serve"]
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,20 @@
1
+ # Telegram Dev — notes for coding agents
2
+
3
+ MCP server + agent skill that give Claude Code, Codex and Cursor current official Telegram documentation. `CLAUDE.md` is a symlink to this file.
4
+
5
+ ## Layout
6
+
7
+ - `telegram_knowledge.py` — the whole server and CLI: crawler, SQLite FTS5 cache, freshness policy, MCP tools (`serve`, `search`, `status`, `sync`, `maintain`; `install` is dispatched to the installer).
8
+ - `telegram_dev_install.py` — project installer. From a checkout it points the agent at the checkout's Python; from the package it writes a pinned `uvx --from <spec> telegram-dev serve` launcher (spec detected from `direct_url.json`).
9
+ - `skills/telegram-dev/` — the skill; shipped in the wheel as the `telegram_dev_skill` package (see `[tool.setuptools]` in `pyproject.toml`).
10
+ - `.claude-plugin/`, `.codex-plugin/`, `.cursor-plugin/`, `.agents/plugins/` — native plugin manifests and catalogs. `server.json` — MCP Registry entry.
11
+ - `scripts/check_sources.py` — daily source monitor (`.github/workflows/documentation.yml`, results on the `docs-status` branch). `scripts/package_openai.py` — OpenAI submission ZIPs.
12
+ - `docs/` — runtime settings, deployment, validation record, catalog submission steps.
13
+
14
+ ## Rules
15
+
16
+ - Run `uv run --frozen python -m unittest discover -s tests -v` before committing. Add a regression test for logic changes.
17
+ - A release bumps the version in `pyproject.toml`, all plugin manifests, `server.json` and `CHANGELOG.md` together (`VersionTests` enforces it), then `uv lock`. Tag `vX.Y.Z` triggers `.github/workflows/release.yml`.
18
+ - `README.md` is English, `README.ru.md` Russian; keep them in sync. Keep the `mcp-name:` comment in `README.md`.
19
+ - The server only reads public documentation. Never add Telegram account access, message sending or bundled copies of Telegram docs.
20
+ - Conventional commits.
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project. Versions follow [Semantic Versioning](https://semver.org/).
4
+
5
+ ## [0.4.0] - 2026-11-10
6
+
7
+ ### Added
8
+
9
+ - `telegram-dev install --agent claude|codex|cursor` installs the MCP server and the skill into a project with one command: `uvx telegram-dev install --agent claude`. The skill now ships inside the Python package.
10
+ - Installs from the package pin the server to the installed version (or exact git commit) through `uvx`, so no checkout has to stay on disk. Installs from a checkout keep using the checkout's Python.
11
+ - `--from` overrides the package the server is launched from; `--project` defaults to the current directory and refuses the home directory.
12
+ - `telegram-dev --version`; the MCP server reports the package version and project URL.
13
+ - `server.json` for the official MCP Registry.
14
+ - Release workflow: a tag builds, tests and publishes the GitHub release with the wheel, sdist, source ZIP, skill-only ZIP and checksums. PyPI and MCP Registry publishing are opt-in through repository variables.
15
+ - `CHANGELOG.md`.
16
+
17
+ ### Changed
18
+
19
+ - The Python distribution is named `telegram-dev` (was `telegram-dev-knowledge`).
20
+ - `README.md` is in English and starts with a real agent run; the Russian guide is in `README.ru.md`.
21
+ - `scripts/install.py` is a thin wrapper around `telegram_dev_install.py` and keeps working for existing checkouts.
22
+
23
+ ## [0.3.0] - 2026-10-10
24
+
25
+ ### Added
26
+
27
+ - Reference guides for bots, Mini Apps, MTProto/TDLib, calls, Secret Chats, business, payments, groups, channels and media.
28
+ - Freshness checks on read and search, a background refresh cycle and a daily public monitor of 52 official sources.
29
+ - `--update` for installed skills, refusing to overwrite local edits.
30
+ - Custom Codex and Claude Code plugin catalogs, Streamable HTTP transport and a container deployment.
31
+
32
+ ## [0.2.0] - 2026-09-24
33
+
34
+ ### Added
35
+
36
+ - First public release: documentation MCP server with an on-demand local cache, agent skill, project installer for Codex, Claude Code and Cursor, and a Claude Code plugin catalog.
37
+
38
+ [0.4.0]: https://github.com/Kay0k1/telegram-dev/compare/v0.3.0...v0.4.0
39
+ [0.3.0]: https://github.com/Kay0k1/telegram-dev/compare/v0.2.0...v0.3.0
40
+ [0.2.0]: https://github.com/Kay0k1/telegram-dev/releases/tag/v0.2.0
@@ -0,0 +1,13 @@
1
+ FROM ghcr.io/astral-sh/uv:0.11.6 AS uv
2
+ FROM python:3.12-slim
3
+ COPY --from=uv /uv /usr/local/bin/uv
4
+ WORKDIR /app
5
+ COPY pyproject.toml uv.lock ./
6
+ RUN uv sync --frozen --no-install-project --no-dev
7
+ COPY telegram_knowledge.py ./
8
+ RUN groupadd --gid 10001 telegram && useradd --uid 10001 --gid telegram --create-home telegram && mkdir /data && chown telegram:telegram /data
9
+ ENV TELEGRAM_KNOWLEDGE_DB=/data/corpus.sqlite3
10
+ USER telegram
11
+ EXPOSE 8000
12
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=15s CMD ["/app/.venv/bin/python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=3)"]
13
+ CMD ["/app/.venv/bin/python", "telegram_knowledge.py", "serve", "--transport", "streamable-http", "--host", "0.0.0.0", "--port", "8000"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Telegram Dev contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ include README.ru.md CHANGELOG.md AGENTS.md server.json uv.lock .mcp.json
2
+ include Dockerfile .dockerignore
3
+ recursive-include docs *.md
4
+ recursive-include deploy *.yml Caddyfile .env.example .gitkeep
5
+ recursive-include assets *.svg
6
+ recursive-include scripts *.py
7
+ recursive-include skills *.md *.yaml
8
+ recursive-include tests *.py *.json
9
+ recursive-include .claude-plugin *.json
10
+ recursive-include .codex-plugin *.json
11
+ recursive-include .cursor-plugin *.json
12
+ recursive-include .agents *.json
@@ -0,0 +1,6 @@
1
+ Telegram Dev is an independent community project, not an official Telegram product.
2
+ The MIT license applies to this project's original code and authored instructions.
3
+ Retrieved Telegram documentation, third-party source code, names and trademarks
4
+ retain their original ownership and applicable terms. The public source package
5
+ does not redistribute the previously downloaded documentation database. Each
6
+ installation retrieves public sources directly and retains source URLs.
@@ -0,0 +1,190 @@
1
+ Metadata-Version: 2.4
2
+ Name: telegram-dev
3
+ Version: 0.4.0
4
+ Summary: Source-grounded Telegram development skills and documentation MCP
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ License-File: NOTICE
10
+ Requires-Dist: mcp<2,>=1.30
11
+ Requires-Dist: httpx<1,>=0.28
12
+ Requires-Dist: beautifulsoup4<5,>=4.13
13
+ Requires-Dist: markdownify<2,>=1
14
+ Requires-Dist: platformdirs<5,>=4
15
+ Requires-Dist: tomlkit<1,>=0.13
16
+ Dynamic: license-file
17
+
18
+ # Telegram Dev
19
+
20
+ [![Tests](https://github.com/Kay0k1/telegram-dev/actions/workflows/tests.yml/badge.svg)](https://github.com/Kay0k1/telegram-dev/actions/workflows/tests.yml)
21
+ [![PyPI](https://img.shields.io/pypi/v/telegram-dev)](https://pypi.org/project/telegram-dev/)
22
+ [![Docs monitor](https://github.com/Kay0k1/telegram-dev/actions/workflows/documentation.yml/badge.svg)](https://github.com/Kay0k1/telegram-dev/tree/docs-status)
23
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
24
+
25
+ **Current official Telegram documentation for Claude Code, Codex and Cursor.**
26
+
27
+ Telegram Dev is an MCP server plus an agent skill. The server fetches, indexes and searches the official docs (Bot API, Mini Apps, MTProto, TDLib, changelogs) and keeps them fresh. The skill teaches the agent to pick the right API, check eligibility and library support, and cite what it read.
28
+
29
+ [Русская версия](README.ru.md)
30
+
31
+ <!-- mcp-name: io.github.Kay0k1/telegram-dev -->
32
+
33
+ ## Why
34
+
35
+ Telegram ships a new Bot API version every month or two. A model's knowledge of it stops at its training cutoff, so agents confidently write code against fields that changed or never existed. They also mix up the Bot API, MTProto and TDLib, which have very different capabilities.
36
+
37
+ With Telegram Dev the agent reads the current page before it writes code. A real Codex CLI run in a fresh project after `uvx telegram-dev install --agent codex` (tool calls trimmed):
38
+
39
+ ```text
40
+ > Use the telegram-dev skill. In a python-telegram-bot project, I want the inline
41
+ 'Delete' button to be red and show a custom emoji. Which Bot API fields do this,
42
+ what are the requirements, and what does the request JSON look like?
43
+
44
+ telegram_corpus_status {}
45
+ search_telegram_docs {"query": "style icon_custom_emoji_id", "area": "releases"}
46
+ search_telegram_docs {"query": "InlineKeyboardButton icon_custom_emoji_id style", "area": "bot-api"}
47
+ get_telegram_document {"url": "https://core.telegram.org/bots/api", "offset": 167594, "length": 10500}
48
+ get_telegram_document {"url": "https://core.telegram.org/bots/api-changelog", "offset": 39089, "length": 6000}
49
+
50
+ Use these InlineKeyboardButton fields:
51
+ - style: "danger" makes the button red.
52
+ - icon_custom_emoji_id is a custom emoji ID shown before "Delete".
53
+ - callback_data is your action identifier, 1-64 bytes.
54
+
55
+ The custom emoji requires either a bot that bought additional usernames on Fragment,
56
+ or a Premium bot owner with the message sent by the bot to a private chat, group or
57
+ supergroup. PTB 22.7+ supports both fields. Older Telegram clients show the button
58
+ unstyled. Source: https://core.telegram.org/bots/api#inlinekeyboardbutton
59
+
60
+ {"chat_id": 123456789, "text": "Choose an action:",
61
+ "reply_markup": {"inline_keyboard": [[{"text": "Delete", "callback_data": "delete:42",
62
+ "style": "danger", "icon_custom_emoji_id": "YOUR_CUSTOM_EMOJI_ID"}]]}}
63
+ ```
64
+
65
+ ## Install
66
+
67
+ You need [uv](https://docs.astral.sh/uv/getting-started/installation/). No bot token, Telegram account or API key is needed: the server only reads public documentation.
68
+
69
+ ### MCP server and skill, one command
70
+
71
+ Run this in your project directory:
72
+
73
+ ```sh
74
+ uvx telegram-dev install --agent claude # or: codex, cursor
75
+ ```
76
+
77
+ | `--agent` | MCP server is added to | Skill is copied to |
78
+ | --- | --- | --- |
79
+ | `claude` | `.mcp.json` | `.claude/skills/telegram-dev` |
80
+ | `codex` | `.codex/config.toml` | `.agents/skills/telegram-dev` |
81
+ | `cursor` | `.cursor/mcp.json` | `.cursor/skills/telegram-dev` |
82
+
83
+ The installer keeps your other settings, backs up the files it changes and never overwrites an existing Telegram Dev setup. The server is pinned to the installed version, so nothing has to stay on disk besides the uv cache. Open a new agent session afterwards and approve the project MCP server when asked. Codex loads project settings only after you trust the project directory.
84
+
85
+ To upgrade later: `uvx telegram-dev@latest install --agent claude --update`.
86
+
87
+ ### Claude Code plugin
88
+
89
+ ```text
90
+ /plugin marketplace add Kay0k1/telegram-dev
91
+ /plugin install telegram-dev@telegram-dev-tools
92
+ ```
93
+
94
+ This adds the skill and the MCP server for all your projects. Use either the plugin or the installer, not both.
95
+
96
+ ### MCP server only
97
+
98
+ ```sh
99
+ claude mcp add --scope user telegram-knowledge -- uvx telegram-dev serve
100
+ ```
101
+
102
+ ```sh
103
+ codex mcp add telegram-knowledge -- uvx telegram-dev serve
104
+ ```
105
+
106
+ Cursor: [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=telegram-knowledge&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJ0ZWxlZ3JhbS1kZXYiLCJzZXJ2ZSJdfQ%3D%3D)
107
+
108
+ Any other MCP client:
109
+
110
+ ```json
111
+ {
112
+ "mcpServers": {
113
+ "telegram-knowledge": { "command": "uvx", "args": ["telegram-dev", "serve"] }
114
+ }
115
+ }
116
+ ```
117
+
118
+ The tools work without the skill, but the skill is what makes an agent use them consistently.
119
+
120
+ ## Tools
121
+
122
+ | Tool | What it does |
123
+ | --- | --- |
124
+ | `search_telegram_docs` | Full-text search over indexed sections, optionally limited to one area: `bot-api`, `mini-apps`, `telegram-api`, `tdlib`, `releases` and others |
125
+ | `get_telegram_document` | Reads an official page in pages of up to 40,000 characters; fetches it if it is missing or older than 6 hours |
126
+ | `telegram_corpus_status` | What is indexed, how fresh it is and which sources failed |
127
+ | `telegram_document_history` | Revisions of a page captured by this installation |
128
+ | `telegram_sources` | The 52 official entry points, grouped by API area |
129
+
130
+ The cache starts empty. Pages are fetched the first time the agent reads them and indexed right away. To pre-fetch everything reachable from the configured sources:
131
+
132
+ ```sh
133
+ uvx telegram-dev sync --max-pages 0
134
+ uvx telegram-dev search "sendVideoNote"
135
+ uvx telegram-dev status
136
+ ```
137
+
138
+ ## What the skill covers
139
+
140
+ | Area | What the agent checks |
141
+ | --- | --- |
142
+ | Bot API | Messages, keyboards, updates, webhooks, files, permissions |
143
+ | Formatting and emoji | Entities, UTF-16 offsets, custom emoji and who may use them |
144
+ | Media and stickers | Voice messages, video notes, sticker sets, file limits |
145
+ | Mini Apps | JS bridge, launch parameters, themes, server-side `initData` validation |
146
+ | MTProto and TDLib | User vs bot authorization, schema and layers, TDLib versions |
147
+ | Business and payments | Business connections, Stars, subscriptions, gifts, paid media |
148
+ | Groups and channels | Admin rights, forums and topics, moderation |
149
+ | Releases | Bot API changelog, API layers, TDLib changelog, official announcements |
150
+
151
+ The skill lives in [skills/telegram-dev](skills/telegram-dev/SKILL.md), with one reference file per area.
152
+
153
+ ## How fresh the docs are
154
+
155
+ - Reading a page older than 6 hours re-fetches it. Search re-fetches up to six stale matching pages.
156
+ - While the server runs, a background cycle checks up to 120 pages every 6 hours: entry points, newly found links, oldest pages.
157
+ - If Telegram's site is unreachable, the cached text is kept and marked stale with the error, so the agent knows it is reading an old copy.
158
+ - A daily GitHub Action checks all 52 official sources and publishes hashes and errors on the [`docs-status`](https://github.com/Kay0k1/telegram-dev/tree/docs-status) branch.
159
+
160
+ Settings such as the cache path (`TELEGRAM_KNOWLEDGE_DB`) and refresh intervals are in [docs/runtime.md](docs/runtime.md).
161
+
162
+ ## Self-hosting
163
+
164
+ The server also runs over Streamable HTTP, so a team can share one cache. A Dockerfile and a Caddy setup with HTTPS are included: [docs/deployment.md](docs/deployment.md).
165
+
166
+ ```sh
167
+ uvx telegram-dev serve --transport streamable-http --port 8000
168
+ ```
169
+
170
+ ## Limits
171
+
172
+ - Search is local full-text search (SQLite FTS5), not semantic search. Exact method names and English terms work best. A small set of Russian aliases is built in.
173
+ - Coverage is what can be reached from the 52 official entry points. Page history starts when your installation first fetched the page.
174
+ - The server does not log in to Telegram, send messages or touch chats. It only reads public pages.
175
+ - The skill improves how agents work. It does not guarantee a correct answer: check the code against Telegram before shipping.
176
+
177
+ ## Development
178
+
179
+ ```sh
180
+ git clone https://github.com/Kay0k1/telegram-dev && cd telegram-dev
181
+ uv sync --frozen
182
+ uv run --frozen python -m unittest discover -s tests -v
183
+ uv run --frozen telegram-dev install --agent claude --project /path/to/test-project
184
+ ```
185
+
186
+ CI runs the tests on Linux, macOS and Windows and checks the Docker image. [docs/validation.md](docs/validation.md) lists what has been verified by hand and what has not. Issues and pull requests are welcome; [tests/behavioral-cases.json](tests/behavioral-cases.json) has agent scenarios that still need runs in each client.
187
+
188
+ ## License
189
+
190
+ [MIT](LICENSE) for the code and the skill. Fetched Telegram documentation remains Telegram's; the package does not bundle it ([NOTICE](NOTICE)). This is an independent project, not affiliated with Telegram.
@@ -0,0 +1,173 @@
1
+ # Telegram Dev
2
+
3
+ [![Tests](https://github.com/Kay0k1/telegram-dev/actions/workflows/tests.yml/badge.svg)](https://github.com/Kay0k1/telegram-dev/actions/workflows/tests.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/telegram-dev)](https://pypi.org/project/telegram-dev/)
5
+ [![Docs monitor](https://github.com/Kay0k1/telegram-dev/actions/workflows/documentation.yml/badge.svg)](https://github.com/Kay0k1/telegram-dev/tree/docs-status)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
+
8
+ **Current official Telegram documentation for Claude Code, Codex and Cursor.**
9
+
10
+ Telegram Dev is an MCP server plus an agent skill. The server fetches, indexes and searches the official docs (Bot API, Mini Apps, MTProto, TDLib, changelogs) and keeps them fresh. The skill teaches the agent to pick the right API, check eligibility and library support, and cite what it read.
11
+
12
+ [Русская версия](README.ru.md)
13
+
14
+ <!-- mcp-name: io.github.Kay0k1/telegram-dev -->
15
+
16
+ ## Why
17
+
18
+ Telegram ships a new Bot API version every month or two. A model's knowledge of it stops at its training cutoff, so agents confidently write code against fields that changed or never existed. They also mix up the Bot API, MTProto and TDLib, which have very different capabilities.
19
+
20
+ With Telegram Dev the agent reads the current page before it writes code. A real Codex CLI run in a fresh project after `uvx telegram-dev install --agent codex` (tool calls trimmed):
21
+
22
+ ```text
23
+ > Use the telegram-dev skill. In a python-telegram-bot project, I want the inline
24
+ 'Delete' button to be red and show a custom emoji. Which Bot API fields do this,
25
+ what are the requirements, and what does the request JSON look like?
26
+
27
+ telegram_corpus_status {}
28
+ search_telegram_docs {"query": "style icon_custom_emoji_id", "area": "releases"}
29
+ search_telegram_docs {"query": "InlineKeyboardButton icon_custom_emoji_id style", "area": "bot-api"}
30
+ get_telegram_document {"url": "https://core.telegram.org/bots/api", "offset": 167594, "length": 10500}
31
+ get_telegram_document {"url": "https://core.telegram.org/bots/api-changelog", "offset": 39089, "length": 6000}
32
+
33
+ Use these InlineKeyboardButton fields:
34
+ - style: "danger" makes the button red.
35
+ - icon_custom_emoji_id is a custom emoji ID shown before "Delete".
36
+ - callback_data is your action identifier, 1-64 bytes.
37
+
38
+ The custom emoji requires either a bot that bought additional usernames on Fragment,
39
+ or a Premium bot owner with the message sent by the bot to a private chat, group or
40
+ supergroup. PTB 22.7+ supports both fields. Older Telegram clients show the button
41
+ unstyled. Source: https://core.telegram.org/bots/api#inlinekeyboardbutton
42
+
43
+ {"chat_id": 123456789, "text": "Choose an action:",
44
+ "reply_markup": {"inline_keyboard": [[{"text": "Delete", "callback_data": "delete:42",
45
+ "style": "danger", "icon_custom_emoji_id": "YOUR_CUSTOM_EMOJI_ID"}]]}}
46
+ ```
47
+
48
+ ## Install
49
+
50
+ You need [uv](https://docs.astral.sh/uv/getting-started/installation/). No bot token, Telegram account or API key is needed: the server only reads public documentation.
51
+
52
+ ### MCP server and skill, one command
53
+
54
+ Run this in your project directory:
55
+
56
+ ```sh
57
+ uvx telegram-dev install --agent claude # or: codex, cursor
58
+ ```
59
+
60
+ | `--agent` | MCP server is added to | Skill is copied to |
61
+ | --- | --- | --- |
62
+ | `claude` | `.mcp.json` | `.claude/skills/telegram-dev` |
63
+ | `codex` | `.codex/config.toml` | `.agents/skills/telegram-dev` |
64
+ | `cursor` | `.cursor/mcp.json` | `.cursor/skills/telegram-dev` |
65
+
66
+ The installer keeps your other settings, backs up the files it changes and never overwrites an existing Telegram Dev setup. The server is pinned to the installed version, so nothing has to stay on disk besides the uv cache. Open a new agent session afterwards and approve the project MCP server when asked. Codex loads project settings only after you trust the project directory.
67
+
68
+ To upgrade later: `uvx telegram-dev@latest install --agent claude --update`.
69
+
70
+ ### Claude Code plugin
71
+
72
+ ```text
73
+ /plugin marketplace add Kay0k1/telegram-dev
74
+ /plugin install telegram-dev@telegram-dev-tools
75
+ ```
76
+
77
+ This adds the skill and the MCP server for all your projects. Use either the plugin or the installer, not both.
78
+
79
+ ### MCP server only
80
+
81
+ ```sh
82
+ claude mcp add --scope user telegram-knowledge -- uvx telegram-dev serve
83
+ ```
84
+
85
+ ```sh
86
+ codex mcp add telegram-knowledge -- uvx telegram-dev serve
87
+ ```
88
+
89
+ Cursor: [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=telegram-knowledge&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJ0ZWxlZ3JhbS1kZXYiLCJzZXJ2ZSJdfQ%3D%3D)
90
+
91
+ Any other MCP client:
92
+
93
+ ```json
94
+ {
95
+ "mcpServers": {
96
+ "telegram-knowledge": { "command": "uvx", "args": ["telegram-dev", "serve"] }
97
+ }
98
+ }
99
+ ```
100
+
101
+ The tools work without the skill, but the skill is what makes an agent use them consistently.
102
+
103
+ ## Tools
104
+
105
+ | Tool | What it does |
106
+ | --- | --- |
107
+ | `search_telegram_docs` | Full-text search over indexed sections, optionally limited to one area: `bot-api`, `mini-apps`, `telegram-api`, `tdlib`, `releases` and others |
108
+ | `get_telegram_document` | Reads an official page in pages of up to 40,000 characters; fetches it if it is missing or older than 6 hours |
109
+ | `telegram_corpus_status` | What is indexed, how fresh it is and which sources failed |
110
+ | `telegram_document_history` | Revisions of a page captured by this installation |
111
+ | `telegram_sources` | The 52 official entry points, grouped by API area |
112
+
113
+ The cache starts empty. Pages are fetched the first time the agent reads them and indexed right away. To pre-fetch everything reachable from the configured sources:
114
+
115
+ ```sh
116
+ uvx telegram-dev sync --max-pages 0
117
+ uvx telegram-dev search "sendVideoNote"
118
+ uvx telegram-dev status
119
+ ```
120
+
121
+ ## What the skill covers
122
+
123
+ | Area | What the agent checks |
124
+ | --- | --- |
125
+ | Bot API | Messages, keyboards, updates, webhooks, files, permissions |
126
+ | Formatting and emoji | Entities, UTF-16 offsets, custom emoji and who may use them |
127
+ | Media and stickers | Voice messages, video notes, sticker sets, file limits |
128
+ | Mini Apps | JS bridge, launch parameters, themes, server-side `initData` validation |
129
+ | MTProto and TDLib | User vs bot authorization, schema and layers, TDLib versions |
130
+ | Business and payments | Business connections, Stars, subscriptions, gifts, paid media |
131
+ | Groups and channels | Admin rights, forums and topics, moderation |
132
+ | Releases | Bot API changelog, API layers, TDLib changelog, official announcements |
133
+
134
+ The skill lives in [skills/telegram-dev](skills/telegram-dev/SKILL.md), with one reference file per area.
135
+
136
+ ## How fresh the docs are
137
+
138
+ - Reading a page older than 6 hours re-fetches it. Search re-fetches up to six stale matching pages.
139
+ - While the server runs, a background cycle checks up to 120 pages every 6 hours: entry points, newly found links, oldest pages.
140
+ - If Telegram's site is unreachable, the cached text is kept and marked stale with the error, so the agent knows it is reading an old copy.
141
+ - A daily GitHub Action checks all 52 official sources and publishes hashes and errors on the [`docs-status`](https://github.com/Kay0k1/telegram-dev/tree/docs-status) branch.
142
+
143
+ Settings such as the cache path (`TELEGRAM_KNOWLEDGE_DB`) and refresh intervals are in [docs/runtime.md](docs/runtime.md).
144
+
145
+ ## Self-hosting
146
+
147
+ The server also runs over Streamable HTTP, so a team can share one cache. A Dockerfile and a Caddy setup with HTTPS are included: [docs/deployment.md](docs/deployment.md).
148
+
149
+ ```sh
150
+ uvx telegram-dev serve --transport streamable-http --port 8000
151
+ ```
152
+
153
+ ## Limits
154
+
155
+ - Search is local full-text search (SQLite FTS5), not semantic search. Exact method names and English terms work best. A small set of Russian aliases is built in.
156
+ - Coverage is what can be reached from the 52 official entry points. Page history starts when your installation first fetched the page.
157
+ - The server does not log in to Telegram, send messages or touch chats. It only reads public pages.
158
+ - The skill improves how agents work. It does not guarantee a correct answer: check the code against Telegram before shipping.
159
+
160
+ ## Development
161
+
162
+ ```sh
163
+ git clone https://github.com/Kay0k1/telegram-dev && cd telegram-dev
164
+ uv sync --frozen
165
+ uv run --frozen python -m unittest discover -s tests -v
166
+ uv run --frozen telegram-dev install --agent claude --project /path/to/test-project
167
+ ```
168
+
169
+ CI runs the tests on Linux, macOS and Windows and checks the Docker image. [docs/validation.md](docs/validation.md) lists what has been verified by hand and what has not. Issues and pull requests are welcome; [tests/behavioral-cases.json](tests/behavioral-cases.json) has agent scenarios that still need runs in each client.
170
+
171
+ ## License
172
+
173
+ [MIT](LICENSE) for the code and the skill. Fetched Telegram documentation remains Telegram's; the package does not bundle it ([NOTICE](NOTICE)). This is an independent project, not affiliated with Telegram.