Commit graph

105 commits

Author SHA1 Message Date
Eugene Evstafev
fcadc0f3c7
Merge pull request #40 from triepod-ai/feat/add-title-annotations
feat: Add title annotations to all 78 tools for improved LLM display
2025-12-23 14:02:12 +00:00
triepod-ai
49d70795f0 feat: Add title annotations to all 78 tools for improved LLM display
Add human-readable title annotations to all MCP tools to help clients
display tool names in a user-friendly format.

Changes:
- Added title annotation to all 78 tools (e.g., "Get Chats", "Send Message")
- Formatted with Black for code style consistency

This improves the user experience when MCP clients display tool lists.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-23 07:55:43 -06:00
Eugene Evstafev
83c2c73a3b
Merge pull request #35 from uriyyo/main
Add ability to run telegram-mcp using uvx
2025-12-19 09:08:31 +00:00
Yurii Karabas
92a0dc31b5 fix lint errors 2025-12-18 23:47:12 +01:00
Yurii Karabas
7e2f4427e5
Merge branch 'chigwell:main' into main 2025-12-19 00:44:44 +02:00
Eugene Evstafev
0cb7b74ee5
Merge pull request #38 from dmitry-simple-it/fix/update-mcp-for-tool-annotations
fix: update uv.lock to resolve ToolAnnotations import error
2025-11-27 19:16:33 +00:00
Dmitrii Zolotukhin
f5bf9d1a24 fix: update uv.lock to resolve ToolAnnotations import error
Fixes #37

The mcp package was locked at version 1.6.0 which does not include
the ToolAnnotations type. This caused the server to fail on startup
with:

  ImportError: cannot import name 'ToolAnnotations' from 'mcp.types'

Updated mcp from 1.6.0 to 1.22.0 which includes ToolAnnotations
and is compatible with the code added in PR #34.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 22:13:08 +03:00
Yurii Karabas
603119073a Add scripts entrypoint to run telegram-mcp using uvx 2025-11-22 14:22:13 +01:00
Eugene Evstafev
6fca222f42
Merge pull request #34 from strato-space/feat/tool-annotations
feat: add comprehensive ToolAnnotations to all MCP tools
2025-11-18 15:00:50 +00:00
Valeriy_Pavlovich
be12812c62 black: reformatted main.py 2025-11-14 01:08:37 +03:00
Valeriy_Pavlovich
1c71806082 feat: add comprehensive ToolAnnotations to all MCP tools
- Add openWorldHint=True to all 63+ @mcp.tool decorators
- Add readOnlyHint=True to read-only operations (get/list/search/export functions)
- Add destructiveHint=True to state-changing operations (send/create/delete/edit functions)
- Add idempotentHint=True to safely repeatable operations (block/unblock/pin/unpin/ban/unban/etc.)
- Fix syntax errors: openWorldHint(True) → openWorldHint=True
- Remove incorrect idempotentHint from non-idempotent operations (send_file, press_inline_button, import_contacts)

These annotations help MCP clients understand tool behavior:
- readOnlyHint: tool doesn't modify environment
- destructiveHint: tool performs destructive updates
- idempotentHint: repeated calls with same args have no additional effect
- openWorldHint: tool interacts with external entities (Telegram API)

Improves tool discoverability and helps AI agents make better decisions about tool usage.
2025-11-14 00:26:35 +03:00
Valeriy Pavlovich
57b6ef44f8
Merge pull request #1 from chigwell/main
22 commits behind chigwell/telegram-mcp:main.
2025-11-13 01:33:19 +03:00
Eugene Evstafev
ac284bcd4e
Merge pull request #32 from Latand/feature/inline-buttons-subscribe
Add inline button helpers and channel subscription tool
2025-11-05 10:28:55 +00:00
latand
b5ac2c0445 Format main.py with black 2025-11-05 12:17:21 +02:00
latand
c3594795cd Add inline button helpers and channel subscription tool 2025-11-04 20:56:04 +02:00
Eugene Evstafev
66ae9f6f8e
Merge pull request #23 from korjavin/feature/id-validation-decorator
Feature/id validation decorator
2025-10-22 16:28:21 +01:00
Korzhavin Ivan
62a3fd68be fix: undefined variable _id in unarchive_chat function
Fixed undefined variable '_id' in unarchive_chat function by
changing it to 'chat_id' which is the correct parameter name.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 09:34:48 +02:00
Korzhavin Ivan
994a49faba style: format code with black 2025-10-20 01:06:06 +02:00
Korzhavin Ivan
80245bcdc9 fix: resolve stash conflict 2025-10-20 01:01:13 +02:00
Korzhavin Ivan
f8a8b581f4 fix: merge conflict 2025-10-20 01:00:55 +02:00
Eugene Evstafev
97884fd1c1
Merge pull request #24 from korjavin/main
Refactor error logging in main.py to structured JSON format with backward compatibility
2025-10-19 17:16:57 +01:00
Korzhavin Ivan
cbe429b474 Merge branch 'main' of https://github.com/chigwell/telegram-mcp into feature/id-validation-decorator
Resolved conflict in log_and_format_error function by:
- Combining ErrorCategory enum (from main) with user_message parameter (from feature branch)
- Supporting both ErrorCategory and string prefixes (for validation errors)
- Keeping validation decorator functionality intact

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:23:15 +02:00
Korzhavin Ivan
2a7134be39 fix: Apply Black formatting to pass CI checks
Applied Black code formatting to main.py to resolve linting
failures in GitHub Actions for PR #24.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:19:34 +02:00
Korzhavin Ivan
251be7219d chore: Add Black and flake8 as dev dependencies
Added Black and flake8 to development dependencies to ensure
consistent code formatting and linting across the project.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:18:32 +02:00
Korzhavin Ivan
6bbeae8c98 fix: Apply Black formatting to pass CI checks
Applied Black code formatting to main.py and test_validation.py
to resolve linting failures in GitHub Actions.

Changes include:
- Proper line breaking for long lines
- Consistent quote style (single to double quotes)
- Better formatting of return statements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:18:05 +02:00
Eugene Evstafev
eb6a6d0ff2
Merge pull request #30 from Marenz/poll
feat: add poll creation functionality
2025-10-17 16:39:36 +01:00
Mathias L. Baumann
7f078dd1e7 feat: add poll creation functionality
- Implement create_poll tool using Telethon's native poll API
- Support for multiple choice, quiz mode, public votes, and close dates
2025-10-17 17:32:14 +02:00
Eugene Evstafev
e7995ae001
Merge pull request #31 from strato-space/feat/list_topics
feat: Add forum topics support with `list_topics` tool
2025-10-16 10:27:11 +01:00
Valeriy Pavlovich
aa6d2761ce feat: Add forum topics support with list_topics tool
Add new list_topics() MCP tool to retrieve forum topics from Telegram
supergroups with forum feature enabled.

Features:
- Validates chat is a supergroup with forum enabled
- Supports pagination via offset_topic parameter
- Supports search filtering via search_query parameter
- Returns comprehensive topic metadata:
  * Topic ID and title
  * Total messages and unread count
  * Status flags (closed, hidden)
  * Last activity timestamp
- Proper error handling and logging

Documentation:
- Added list_topics to README Messaging tools list
- Added complete code example with implementation
- Added example output showing typical usage

Uses Telethon's GetForumTopicsRequest API for reliable forum topic
retrieval from supergroups.
2025-10-14 15:39:00 +03:00
Eugene Evstafev
da3f3ec524
Merge pull request #28 from strato-space/main
fix: make list_messages respect date/search limits (#27)
2025-10-13 20:12:27 +01:00
Valeriy Pavlovich
f08667c47a Format main.py with Black 2025-10-13 21:20:24 +03:00
Valeriy Pavlovich
553125cd76 Make list_messages predictable and efficient for date ranges and search: avoid over-fetch, apply limit after filtering, and separate search from date offsets #27
- stream search results via `client.iter_messages()` and apply date bounds in-code so we collect up to `limit` matches
- use server-side iteration for date-only queries with inclusive upper bounds to avoid over-fetching
- keep the existing `get_messages()` fast path when no filters are provided
2025-10-12 07:14:25 +03:00
Korjavin Ivan
127c953801
Merge pull request #1 from korjavin/feature/structured-json-logging
Implement Structured JSON Error Logging
2025-09-06 22:32:57 +02:00
google-labs-jules[bot]
50b01ca494 feat: implement structured JSON error logging
- Add python-json-logger dependency.
- Configure file handler to use JsonFormatter for structured logging.
- Keep console handler with the existing text format.
- Refactor log_and_format_error to log a dictionary with structured error data.
2025-09-01 14:39:30 +00:00
Eugene Evstafev
3cd0489769
Merge pull request #22 from korjavin/feature/error-code-enum
refactor: Replace hardcoded error prefixes with an Enum
2025-08-30 23:07:10 +01:00
Eugene Evstafev
b15c3e7b29
Merge pull request #21 from korjavin/main
Fix run how-to to use uv for consistency with production case
2025-08-30 23:06:09 +01:00
Korzhavin Ivan
30f759e3cb Fix unnecesary python downgrade 2025-08-29 23:23:27 +02:00
google-labs-jules[bot]
34bdd58905 feat: Implement input validation decorator for chat/user IDs
Adds a new `@validate_id` decorator to validate `chat_id` and `user_id` parameters in `main.py`.

This decorator ensures that all IDs passed to functions are in a valid format before making RPC calls to the Telegram API. It handles:
- Integer IDs (positive and negative)
- String representations of integer IDs
- Usernames (e.g., "@username")
- Lists of IDs

Key changes:
- Created a `validate_id` decorator in `main.py`.
- Applied the decorator to all functions that accept `chat_id`, `user_id`, or similar parameters.
- Updated the central `log_and_format_error` function to handle custom validation error messages and a specific `VALIDATION-001` error code for logging.
- Added a new test suite (`test_validation.py`) with comprehensive tests for the decorator.
- Updated `README.md` and `session_string_generator.py` with documentation about the new validation.
2025-08-29 23:16:13 +02:00
google-labs-jules[bot]
59fb2dcd10 refactor: Replace hardcoded error prefixes with an Enum 2025-08-29 23:13:59 +02:00
Korzhavin Ivan
016fd31603 Fix run how-to to use uv for consistency with production case 2025-08-28 22:18:58 +02:00
Eugene Evstafev
9464b4de75
Merge pull request #19 from TimTProd/add_replies
feat: enhance message display with reply information
2025-08-06 19:39:07 +01:00
Tim
78a99b06f2 refactor: clean up whitespace and improve code formatting using black . 2025-08-06 21:07:59 +03:00
TimTProd
2dc8454a4f
Merge branch 'main' into add_replies 2025-08-06 20:19:38 +03:00
Eugene Evstafev
574fe149e5
Merge pull request #17 from TimTProd/add_nicknames
feat: add get_sender_name function to enhance message formatting
2025-08-06 17:53:53 +01:00
Tim
103ce35594 feat: enhance message display with reply information
Updated message formatting in various functions to include details about replies. When a message is a reply, it now shows the ID of the original message and the sender's name, improving context for users.
2025-08-06 19:37:30 +03:00
Tim
f0072801cb feat: add get_sender_name function to enhance message formatting
Introduced a new helper function, get_sender_name, to retrieve the sender's name from messages. Updated various message display functions to include the sender's name in the output, improving clarity and context for users
2025-07-24 17:28:42 +03:00
Eugene Evstafev
e16b41115c
Merge pull request #9 from chigwell/test-branch
docs: update README.md
2025-04-26 08:20:56 +01:00
Eugene Evstafev
3f59865361 docs: update README.md 2025-04-26 08:17:23 +01:00
Eugene Evstafev
bb464e52fa
Merge pull request #8 from l1v0n1/main
Merge v2.0.2: Dockerization & CI Enhancements into Telegram MCP Mainline
2025-04-24 17:41:46 +01:00
anonim
b1f0e79b6b chore: update references to the renamed container in documentation and workflows
Renamed all instances of 'telegram-mcp-server' to 'telegram-mcp' in docker-compose.yml, README.md, and the Docker build workflow to ensure consistency and clarity across the project.
2025-04-24 15:09:38 +03:00