telegram-context-mcp 0.2.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 (105) hide show
  1. telegram_context_mcp-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +44 -0
  2. telegram_context_mcp-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +27 -0
  3. telegram_context_mcp-0.2.0/.github/dependabot.yml +32 -0
  4. telegram_context_mcp-0.2.0/.github/pull_request_template.md +14 -0
  5. telegram_context_mcp-0.2.0/.github/workflows/ci.yml +127 -0
  6. telegram_context_mcp-0.2.0/.github/workflows/release.yml +93 -0
  7. telegram_context_mcp-0.2.0/.gitignore +12 -0
  8. telegram_context_mcp-0.2.0/.python-version +1 -0
  9. telegram_context_mcp-0.2.0/AGENTS.md +25 -0
  10. telegram_context_mcp-0.2.0/CHANGELOG.md +52 -0
  11. telegram_context_mcp-0.2.0/CONTRIBUTING.md +91 -0
  12. telegram_context_mcp-0.2.0/LICENSE +21 -0
  13. telegram_context_mcp-0.2.0/Makefile +6 -0
  14. telegram_context_mcp-0.2.0/PKG-INFO +187 -0
  15. telegram_context_mcp-0.2.0/README.md +153 -0
  16. telegram_context_mcp-0.2.0/ROADMAP.md +95 -0
  17. telegram_context_mcp-0.2.0/SECURITY.md +43 -0
  18. telegram_context_mcp-0.2.0/config.example.toml +28 -0
  19. telegram_context_mcp-0.2.0/docs/architecture.md +130 -0
  20. telegram_context_mcp-0.2.0/docs/clients.md +184 -0
  21. telegram_context_mcp-0.2.0/docs/configuration.md +141 -0
  22. telegram_context_mcp-0.2.0/docs/releasing.md +88 -0
  23. telegram_context_mcp-0.2.0/docs/specs/README.md +43 -0
  24. telegram_context_mcp-0.2.0/docs/specs/m1-public-channel-discovery.md +126 -0
  25. telegram_context_mcp-0.2.0/docs/specs/m2-message-navigation.md +331 -0
  26. telegram_context_mcp-0.2.0/docs/troubleshooting.md +130 -0
  27. telegram_context_mcp-0.2.0/docs/usage.md +335 -0
  28. telegram_context_mcp-0.2.0/pyproject.toml +66 -0
  29. telegram_context_mcp-0.2.0/scripts/check_release.py +68 -0
  30. telegram_context_mcp-0.2.0/scripts/probe_package.py +150 -0
  31. telegram_context_mcp-0.2.0/scripts/smoke_distribution.py +68 -0
  32. telegram_context_mcp-0.2.0/src/telegram_mcp/__init__.py +1 -0
  33. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/__init__.py +1 -0
  34. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/bridge.py +77 -0
  35. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/cli.py +215 -0
  36. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/clock.py +12 -0
  37. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/config.py +169 -0
  38. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/cursors.py +58 -0
  39. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/http_token.py +76 -0
  40. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/mcp.py +363 -0
  41. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/session.py +57 -0
  42. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/__init__.py +6 -0
  43. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/auth.py +48 -0
  44. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/backend.py +101 -0
  45. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/chats.py +178 -0
  46. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/discovery.py +50 -0
  47. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/forums.py +124 -0
  48. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/mapping.py +287 -0
  49. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/messages.py +397 -0
  50. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/metadata.py +142 -0
  51. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/telegram/runtime.py +138 -0
  52. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/tool_gate.py +24 -0
  53. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/transport.py +106 -0
  54. telegram_context_mcp-0.2.0/src/telegram_mcp/adapters/version.py +7 -0
  55. telegram_context_mcp-0.2.0/src/telegram_mcp/application/__init__.py +1 -0
  56. telegram_context_mcp-0.2.0/src/telegram_mcp/application/access.py +59 -0
  57. telegram_context_mcp-0.2.0/src/telegram_mcp/application/catalog.py +76 -0
  58. telegram_context_mcp-0.2.0/src/telegram_mcp/application/common.py +19 -0
  59. telegram_context_mcp-0.2.0/src/telegram_mcp/application/discovery.py +50 -0
  60. telegram_context_mcp-0.2.0/src/telegram_mcp/application/message_pager.py +134 -0
  61. telegram_context_mcp-0.2.0/src/telegram_mcp/application/messages.py +195 -0
  62. telegram_context_mcp-0.2.0/src/telegram_mcp/application/ports.py +123 -0
  63. telegram_context_mcp-0.2.0/src/telegram_mcp/application/queries.py +118 -0
  64. telegram_context_mcp-0.2.0/src/telegram_mcp/application/query_preparation.py +154 -0
  65. telegram_context_mcp-0.2.0/src/telegram_mcp/application/requests.py +47 -0
  66. telegram_context_mcp-0.2.0/src/telegram_mcp/application/retry.py +31 -0
  67. telegram_context_mcp-0.2.0/src/telegram_mcp/application/service.py +182 -0
  68. telegram_context_mcp-0.2.0/src/telegram_mcp/application/topics.py +146 -0
  69. telegram_context_mcp-0.2.0/src/telegram_mcp/bootstrap.py +45 -0
  70. telegram_context_mcp-0.2.0/src/telegram_mcp/cli.py +6 -0
  71. telegram_context_mcp-0.2.0/src/telegram_mcp/domain/__init__.py +1 -0
  72. telegram_context_mcp-0.2.0/src/telegram_mcp/domain/folders.py +93 -0
  73. telegram_context_mcp-0.2.0/src/telegram_mcp/domain/models.py +319 -0
  74. telegram_context_mcp-0.2.0/src/telegram_mcp/domain/policy.py +12 -0
  75. telegram_context_mcp-0.2.0/src/telegram_mcp/domain/text.py +16 -0
  76. telegram_context_mcp-0.2.0/tests/__init__.py +0 -0
  77. telegram_context_mcp-0.2.0/tests/fakes.py +325 -0
  78. telegram_context_mcp-0.2.0/tests/fixtures/mcp_contract.json +2920 -0
  79. telegram_context_mcp-0.2.0/tests/test_albums.py +412 -0
  80. telegram_context_mcp-0.2.0/tests/test_albums_backend.py +283 -0
  81. telegram_context_mcp-0.2.0/tests/test_albums_mcp.py +238 -0
  82. telegram_context_mcp-0.2.0/tests/test_architecture.py +146 -0
  83. telegram_context_mcp-0.2.0/tests/test_cli_auth.py +100 -0
  84. telegram_context_mcp-0.2.0/tests/test_cli_config.py +247 -0
  85. telegram_context_mcp-0.2.0/tests/test_config_cursors.py +122 -0
  86. telegram_context_mcp-0.2.0/tests/test_contracts.py +36 -0
  87. telegram_context_mcp-0.2.0/tests/test_discovery.py +326 -0
  88. telegram_context_mcp-0.2.0/tests/test_discovery_backend.py +343 -0
  89. telegram_context_mcp-0.2.0/tests/test_folders.py +105 -0
  90. telegram_context_mcp-0.2.0/tests/test_lifecycle.py +240 -0
  91. telegram_context_mcp-0.2.0/tests/test_mcp.py +219 -0
  92. telegram_context_mcp-0.2.0/tests/test_message_metadata_backend.py +359 -0
  93. telegram_context_mcp-0.2.0/tests/test_message_metadata_mcp.py +239 -0
  94. telegram_context_mcp-0.2.0/tests/test_navigation.py +601 -0
  95. telegram_context_mcp-0.2.0/tests/test_navigation_backend.py +312 -0
  96. telegram_context_mcp-0.2.0/tests/test_navigation_mcp.py +233 -0
  97. telegram_context_mcp-0.2.0/tests/test_packaging.py +81 -0
  98. telegram_context_mcp-0.2.0/tests/test_service.py +470 -0
  99. telegram_context_mcp-0.2.0/tests/test_session_lease.py +78 -0
  100. telegram_context_mcp-0.2.0/tests/test_shared_transport.py +477 -0
  101. telegram_context_mcp-0.2.0/tests/test_telegram.py +473 -0
  102. telegram_context_mcp-0.2.0/tests/test_topic_history.py +595 -0
  103. telegram_context_mcp-0.2.0/tests/test_topic_history_backend.py +490 -0
  104. telegram_context_mcp-0.2.0/tests/test_topic_history_mcp.py +255 -0
  105. telegram_context_mcp-0.2.0/uv.lock +896 -0
@@ -0,0 +1,44 @@
1
+ name: Bug report
2
+ description: Report a reproducible problem with the server or its tools.
3
+ body:
4
+ - type: markdown
5
+ attributes:
6
+ value: |
7
+ Use a minimal, synthetic example. Do not include phone numbers, login codes,
8
+ API keys or hashes, session files, credentials, or private Telegram dumps.
9
+ - type: textarea
10
+ id: environment
11
+ attributes:
12
+ label: Versions and environment
13
+ description: Include the project version or commit, Python and uv versions, OS, and MCP client when relevant.
14
+ placeholder: |
15
+ Project version or commit:
16
+ Python:
17
+ uv:
18
+ OS:
19
+ MCP client and version:
20
+ validations:
21
+ required: true
22
+ - type: textarea
23
+ id: reproduction
24
+ attributes:
25
+ label: Minimal reproduction
26
+ description: List the commands or tool arguments needed to reproduce the problem. Use synthetic data and omit secrets.
27
+ placeholder: |
28
+ 1.
29
+ 2.
30
+ validations:
31
+ required: true
32
+ - type: textarea
33
+ id: expected
34
+ attributes:
35
+ label: Expected behavior
36
+ validations:
37
+ required: true
38
+ - type: textarea
39
+ id: actual
40
+ attributes:
41
+ label: Actual behavior
42
+ description: Include the error code and a short, sanitized diagnostic excerpt if useful.
43
+ validations:
44
+ required: true
@@ -0,0 +1,27 @@
1
+ name: Feature request
2
+ description: Propose a focused improvement and explain the use case.
3
+ body:
4
+ - type: markdown
5
+ attributes:
6
+ value: |
7
+ Check ROADMAP.md for the current direction. Describe the need using synthetic
8
+ examples; do not include credentials, session files, or private Telegram content.
9
+ - type: textarea
10
+ id: use_case
11
+ attributes:
12
+ label: Use case
13
+ description: What task is difficult or impossible today, and who needs the improvement?
14
+ validations:
15
+ required: true
16
+ - type: textarea
17
+ id: scope
18
+ attributes:
19
+ label: Proposed behavior and scope
20
+ description: Describe the smallest useful change, what success looks like, and anything that should remain outside scope.
21
+ validations:
22
+ required: true
23
+ - type: input
24
+ id: roadmap
25
+ attributes:
26
+ label: Related roadmap item or issue
27
+ description: Link an existing issue or name a milestone, or state that this is a new direction.
@@ -0,0 +1,32 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: uv
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ open-pull-requests-limit: 4
8
+ versioning-strategy: lockfile-only
9
+ allow:
10
+ - dependency-type: all
11
+ commit-message:
12
+ prefix: chore
13
+ include: scope
14
+ groups:
15
+ mcp:
16
+ patterns: [mcp, mcp-types]
17
+ other-dependencies:
18
+ patterns: ["*"]
19
+ exclude-patterns: [telethon, mcp, mcp-types]
20
+ update-types: [minor, patch]
21
+ - package-ecosystem: github-actions
22
+ directory: /
23
+ schedule:
24
+ interval: weekly
25
+ open-pull-requests-limit: 2
26
+ commit-message:
27
+ prefix: chore
28
+ include: scope
29
+ groups:
30
+ actions:
31
+ patterns: ["*"]
32
+ update-types: [minor, patch]
@@ -0,0 +1,14 @@
1
+ ## Change
2
+
3
+ <!-- State the problem and resulting behavior. Keep this PR to one bounded change.
4
+ Mention any public API, configuration, or compatibility changes. -->
5
+
6
+ ## Validation
7
+
8
+ <!-- Report the checks you ran and their results, such as `make check`.
9
+ For documentation-only work, describe the relevant review. Identify any unverified behavior.
10
+ Do not include credentials, session files, or private Telegram content. -->
11
+
12
+ ## Related work
13
+
14
+ <!-- Link an issue or ROADMAP.md item when relevant. Remove this section if unnecessary. -->
@@ -0,0 +1,127 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ push:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+ workflow_call:
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ concurrency:
15
+ group: ci-${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ quality:
20
+ name: Formatting, lint, and types
21
+ runs-on: ubuntu-latest
22
+ timeout-minutes: 10
23
+ steps:
24
+ - name: Check out the repository
25
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26
+ with:
27
+ persist-credentials: false
28
+ - name: Install uv
29
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
30
+ with:
31
+ version: "0.13.1"
32
+ python-version: "3.12"
33
+ enable-cache: true
34
+ - name: Install locked dependencies
35
+ run: uv sync --locked --group dev
36
+ - name: Check formatting
37
+ run: uv run --locked ruff format --check .
38
+ - name: Check lint
39
+ run: uv run --locked ruff check .
40
+ - name: Check types
41
+ run: uv run --locked ty check
42
+
43
+ build:
44
+ name: Build distributions
45
+ runs-on: ubuntu-latest
46
+ timeout-minutes: 10
47
+ steps:
48
+ - name: Check out the repository
49
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
50
+ with:
51
+ persist-credentials: false
52
+ - name: Install uv and Python
53
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
54
+ with:
55
+ version: "0.13.1"
56
+ python-version: "3.12"
57
+ enable-cache: true
58
+ - name: Check the lockfile
59
+ run: uv lock --check
60
+ - name: Build wheel and source distribution
61
+ run: uv build --no-sources
62
+ - name: Save distributions
63
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
64
+ with:
65
+ name: distributions
66
+ path: dist/*
67
+ if-no-files-found: error
68
+ retention-days: 14
69
+
70
+ tests:
71
+ name: Tests (${{ matrix.os }}, Python ${{ matrix.python }})
72
+ needs: build
73
+ runs-on: ${{ matrix.os }}
74
+ timeout-minutes: 15
75
+ strategy:
76
+ fail-fast: false
77
+ matrix:
78
+ os: [ubuntu-latest]
79
+ python: ["3.12", "3.13", "3.14", "3.15"]
80
+ include:
81
+ - os: macos-latest
82
+ python: "3.12"
83
+ - os: macos-latest
84
+ python: "3.15"
85
+ - os: windows-latest
86
+ python: "3.12"
87
+ - os: windows-latest
88
+ python: "3.15"
89
+ steps:
90
+ - name: Check out the repository
91
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
92
+ with:
93
+ persist-credentials: false
94
+ - name: Install uv and Python
95
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
96
+ with:
97
+ version: "0.13.1"
98
+ python-version: ${{ matrix.python }}
99
+ enable-cache: true
100
+ - name: Install locked dependencies
101
+ run: uv sync --locked --group dev
102
+ - name: Run autonomous tests
103
+ run: uv run --locked pytest
104
+ - name: Download distributions
105
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
106
+ with:
107
+ name: distributions
108
+ path: dist
109
+ - name: Smoke test fresh wheel and source installations
110
+ run: uv run --locked python scripts/smoke_distribution.py
111
+
112
+ checks:
113
+ name: checks
114
+ if: always()
115
+ needs: [quality, build, tests]
116
+ runs-on: ubuntu-latest
117
+ timeout-minutes: 1
118
+ steps:
119
+ - name: Require every check to succeed
120
+ env:
121
+ QUALITY_RESULT: ${{ needs.quality.result }}
122
+ BUILD_RESULT: ${{ needs.build.result }}
123
+ TEST_RESULT: ${{ needs.tests.result }}
124
+ run: |
125
+ test "$QUALITY_RESULT" = success
126
+ test "$BUILD_RESULT" = success
127
+ test "$TEST_RESULT" = success
@@ -0,0 +1,93 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ concurrency:
11
+ group: release-${{ github.ref }}
12
+ cancel-in-progress: false
13
+
14
+ jobs:
15
+ validate:
16
+ name: Validate release metadata
17
+ runs-on: ubuntu-latest
18
+ timeout-minutes: 5
19
+ steps:
20
+ - name: Check out the tagged commit and main history
21
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ with:
23
+ fetch-depth: 0
24
+ persist-credentials: false
25
+ - name: Install uv and Python
26
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
27
+ with:
28
+ version: "0.13.1"
29
+ python-version: "3.12"
30
+ - name: Verify tag, package version, changelog, and main ancestry
31
+ env:
32
+ RELEASE_TAG: ${{ github.ref_name }}
33
+ run: >-
34
+ uv run --no-project python scripts/check_release.py
35
+ --tag "$RELEASE_TAG" --notes-file release-notes.md
36
+ - name: Save release notes
37
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
38
+ with:
39
+ name: release-notes
40
+ path: release-notes.md
41
+ if-no-files-found: error
42
+ retention-days: 14
43
+
44
+ validation:
45
+ name: Validate distributions
46
+ needs: validate
47
+ uses: ./.github/workflows/ci.yml
48
+
49
+ publish:
50
+ name: Publish to PyPI
51
+ needs: validation
52
+ runs-on: ubuntu-latest
53
+ timeout-minutes: 10
54
+ environment:
55
+ name: pypi
56
+ url: https://pypi.org/project/telegram-context-mcp/
57
+ permissions:
58
+ id-token: write
59
+ steps:
60
+ - name: Download the validated distributions
61
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
62
+ with:
63
+ name: distributions
64
+ path: dist
65
+ - name: Publish with PyPI Trusted Publishing
66
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
67
+
68
+ github-release:
69
+ name: Create GitHub Release
70
+ needs: publish
71
+ runs-on: ubuntu-latest
72
+ timeout-minutes: 5
73
+ permissions:
74
+ contents: write
75
+ steps:
76
+ - name: Download the published distributions
77
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
78
+ with:
79
+ name: distributions
80
+ path: dist
81
+ - name: Download the validated release notes
82
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
83
+ with:
84
+ name: release-notes
85
+ path: .
86
+ - name: Create the release with the exact PyPI artifacts
87
+ env:
88
+ GH_TOKEN: ${{ github.token }}
89
+ GH_REPO: ${{ github.repository }}
90
+ RELEASE_TAG: ${{ github.ref_name }}
91
+ run: >-
92
+ gh release create "$RELEASE_TAG" dist/* --verify-tag
93
+ --title "$RELEASE_TAG" --notes-file release-notes.md
@@ -0,0 +1,12 @@
1
+ .venv/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ .coverage
6
+ htmlcov/
7
+ dist/
8
+ *.session*
9
+ .env*
10
+ !.env.example
11
+ config.toml
12
+ .DS_Store
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,25 @@
1
+ # Repository conventions
2
+
3
+ ## Language
4
+
5
+ - Use English for documentation, code comments and docstrings, CLI text,
6
+ identifiers, test names, and commit messages.
7
+ - Preserve multilingual source content and test fixtures when their language
8
+ is relevant to the behavior being tested.
9
+ - Conversation replies may follow the user's language.
10
+
11
+ ## GitHub workflow
12
+
13
+ - Work on a focused branch and open a pull request to `main`; avoid direct pushes to `main`.
14
+ - Use Conventional Branch purpose prefixes: `feature/`, `bugfix/`, `hotfix/`,
15
+ `chore/`, or `release/`. Use lowercase kebab-case descriptions; release versions
16
+ may contain dots. Example: `feature/public-channel-discovery`.
17
+ - Dependabot-generated `dependabot/` branches are the approved automation exception;
18
+ human-created branches must still use the Conventional Branch prefixes above.
19
+ - Use Conventional Commits for commit messages and PR titles.
20
+ - Run `make check`, review the diff, and wait for the GitHub `checks` job before merging.
21
+ - Squash-merge completed PRs. Start the next branch from the updated `main`.
22
+ - Update `ROADMAP.md` with completed work. See `CONTRIBUTING.md` for contributor guidance.
23
+ - Review dependency-update PRs manually; do not enable automatic merging.
24
+ - Keep public changes in `CHANGELOG.md`. Follow `docs/releasing.md` for version tags
25
+ and PyPI publication; do not treat a merged PR as a published release.
@@ -0,0 +1,52 @@
1
+ # Changelog
2
+
3
+ Public changes to `telegram-context-mcp`. The command name is `telegram-mcp`.
4
+
5
+ A version entry describes its target artifact. Verify publication on
6
+ [PyPI](https://pypi.org/project/telegram-context-mcp/) and
7
+ [GitHub Releases](https://github.com/egor-fedorov/telegram-mcp/releases).
8
+
9
+ ## [Unreleased]
10
+
11
+ No additional changes recorded.
12
+
13
+ ## [0.2.0] - 2026-10-21
14
+
15
+ ### Added
16
+
17
+ - A foreground, bearer-authenticated local HTTP server at `127.0.0.1:8765/mcp`.
18
+ - A `connect` STDIO proxy so several MCP clients can share one Telegram session,
19
+ read policy, and process-local cursor store.
20
+ - `--version`, pinned installation examples, and configuration guides for Codex,
21
+ Claude Desktop, Claude Code, Cursor, and VS Code.
22
+ - Package build checks, platform/Python compatibility checks, Trusted Publisher
23
+ release automation, and reviewed dependency-update PRs.
24
+
25
+ ### Changed
26
+
27
+ - Session locking supports Windows as well as macOS and Linux.
28
+ - Local files use explicit UTF-8 handling; configuration errors identify invalid
29
+ fields and sources without exposing their values.
30
+ - Interactive configuration preserves existing settings on Enter and explicitly
31
+ prompts for `allow_all_chats`.
32
+ - The README focuses on installation and first use; detailed usage, configuration,
33
+ troubleshooting, release instructions, and completed specifications have their
34
+ own documents.
35
+
36
+ ### Compatibility
37
+
38
+ - `telegram-mcp serve` remains the standalone STDIO command. The same 14 tools and
39
+ message schemas are available through both transports.
40
+ - Shared clients must run as one trusted local user. The HTTP process is started
41
+ explicitly; `connect` never starts it or falls back to opening another session.
42
+ - Stop the session-owning process before local login, configuration, catalog, or
43
+ status commands. Use MCP `get_status` while the server is running.
44
+ - Existing Telegram sessions and TOML read-policy settings remain usable.
45
+
46
+ ## Earlier source development
47
+
48
+ M0–M2 added reliable retrieval, public-channel discovery, topic and pinned-message
49
+ navigation, counters, reactions, polls, and bounded album retrieval. R1 separated
50
+ domain, application, adapters, and bootstrap while preserving all tool contracts.
51
+ See the [completed specifications](docs/specs/README.md) and
52
+ [architecture decision](docs/architecture.md) for those implementation records.
@@ -0,0 +1,91 @@
1
+ # Contributing
2
+
3
+ Use English for repository documentation, code comments, CLI text, commit messages,
4
+ and pull requests. Keep multilingual fixtures when their language matters to a test.
5
+ See [ROADMAP.md](ROADMAP.md) for current priorities, [Architecture](docs/architecture.md)
6
+ for dependency boundaries, and [completed specifications](docs/specs/README.md) for
7
+ the accepted M1/M2 contracts.
8
+
9
+ ## Local setup and checks
10
+
11
+ Use Python 3.12 and [uv](https://docs.astral.sh/uv/) for the standard development
12
+ environment. The supported runtime range is Python 3.12–3.15 on Windows, macOS, and
13
+ Linux. From the project directory:
14
+
15
+ ```sh
16
+ uv sync --locked --python 3.12
17
+ make check
18
+ ```
19
+
20
+ `make check` runs Ruff formatting checks, Ruff lint, ty, and pytest. Tests are offline:
21
+ they do not require a Telegram account, login, or network requests to Telegram.
22
+ Dependency installation may require network access. Add tests for changed behavior
23
+ and keep existing MCP contracts compatible, or explain any compatibility changes.
24
+ For documentation-only changes, check links, examples, and formatting.
25
+
26
+ On Windows without Make, run the same checks directly:
27
+
28
+ ```sh
29
+ uv run --locked ruff format --check .
30
+ uv run --locked ruff check .
31
+ uv run --locked ty check
32
+ uv run --locked pytest
33
+ ```
34
+
35
+ CI checks formatting/types, builds wheel and source distributions, and runs tests
36
+ plus clean-install smoke checks. The matrix covers Python 3.12–3.15 on Linux and
37
+ 3.12/3.15 on macOS and Windows. The required `checks` job succeeds only when its
38
+ dependencies succeed. No Telegram credentials or publishing secrets are needed.
39
+
40
+ When changing transport behavior, cover standalone STDIO, authenticated local HTTP,
41
+ and the STDIO proxy without a real Telegram account. Shared-client tests should
42
+ exercise lifecycle and cursor behavior, including a client disconnecting while the
43
+ session-owning server remains available. Preserve the recorded schemas of all 14 tools.
44
+
45
+ ## Branches, commits, and pull requests
46
+
47
+ 1. Start from the current `main` and create a branch for one bounded change. Follow
48
+ [Conventional Branch](https://conventionalbranch.org): use `feature/`, `bugfix/`,
49
+ `hotfix/`, or `chore/` with a lowercase kebab-case description, such as
50
+ `feature/public-channel-discovery` or `bugfix/preserve-retry-delay`.
51
+ Documentation-only work uses a branch such as `chore/update-docs`.
52
+ Release branches use `release/vX.Y.Z`, for example `release/v1.2.0`.
53
+ Dependabot's generated `dependabot/` branches are the approved automation exception;
54
+ human-created branches still use the Conventional Branch prefixes above.
55
+ 2. Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for
56
+ commit messages and the PR title: `<type>[optional scope]: <description>`.
57
+ Examples: `feat(discovery): add public channel search`,
58
+ `fix: preserve retry delays`, and `docs: explain discovery permissions`.
59
+ 3. Run the relevant checks and open a pull request targeting `main`. Describe the
60
+ problem, resulting behavior, and validation. Link a related issue or roadmap item
61
+ when applicable. Update documentation for public behavior or configuration changes.
62
+ 4. Address review feedback and wait for the GitHub `checks` job to pass. Use squash
63
+ merge after review; the final PR title becomes the squash commit message. Do not push feature work
64
+ directly to `main`.
65
+
66
+ Keep changes focused. Propose a new direction with a feature request before expanding
67
+ an agreed milestone. Add or update roadmap completion records only when their acceptance
68
+ criteria are met; distinguish offline checks from any separately performed live validation.
69
+
70
+ ## Dependencies and releases
71
+
72
+ Commit `uv.lock` alongside dependency changes. Review release notes and the lockfile
73
+ diff, then run the appropriate compatibility checks. Dependabot opens update PRs for
74
+ review; it does not merge them automatically. Updates to pinned GitHub Actions follow
75
+ the same review and CI process as Python dependencies.
76
+
77
+ Changes intended for users should have a concise entry in [CHANGELOG.md](CHANGELOG.md).
78
+ Release preparation belongs in a PR; a version tag is pushed only after that PR has
79
+ been squash-merged and checked. Follow [the release procedure](docs/releasing.md) for
80
+ PyPI Trusted Publisher setup, artifact checks, tagging, and publication verification.
81
+ Do not claim a PyPI release from a successful source build alone.
82
+
83
+ ## Reporting issues
84
+
85
+ Use the bug report form for a minimal reproduction, version information, and expected
86
+ versus actual behavior. Use the feature request form to explain the use case, proposed
87
+ scope, and relationship to the roadmap.
88
+
89
+ Never include phone numbers, login codes, API keys or hashes, session files, HTTP tokens,
90
+ or private Telegram conversation dumps in issues, pull requests, logs, or fixtures.
91
+ Use synthetic examples and remove sensitive data from diagnostics before sharing them.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Egor Fyodorov
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,6 @@
1
+ .PHONY: check
2
+ check:
3
+ uv run --locked ruff format --check .
4
+ uv run --locked ruff check .
5
+ uv run --locked ty check
6
+ uv run --locked pytest