Telegram MCP Server
Telegram MCP 服务器
一个基于 Telethon 和 FastMCP 构建的 Telegram 模型上下文协议 (MCP) 服务器。
功能特性
MTProto 支持:通过 Telethon 实现高性能通信。
FastMCP:与 AI 智能体无缝集成。
异步与高性能:针对速度和并发进行了优化。
专业核心:内置日志记录、缓存和配置功能。
Related MCP server: telegram-mcp
设置
如果尚未安装,请安装
uv。克隆仓库。
根据
.env.example创建一个.env文件:cp .env.example .env从 my.telegram.org 获取并填写您的
API_ID和API_HASH。安装依赖:
uv sync
使用方法
运行 MCP 服务器:
uv run python -m telegram_mcp.server项目结构
src/telegram_mcp/core/:基础工具(日志记录器、缓存、配置)。src/telegram_mcp/service/:业务逻辑和外部 API 客户端。src/telegram_mcp/models/:Pydantic 数据模型。src/telegram_mcp/server.py:MCP 服务器定义和工具注册。
Available Tools
1 toolget_account_infoA
Returns information about the currently logged-in Telegram account.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose behavioral traits beyond the fact that it returns information. For a simple read-only tool, this is adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It is appropriately concise for a trivial tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description could be more specific about what 'information' is returned. However, for a tool with no parameters and no siblings, it is minimally complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are no parameters, and the schema coverage is 100%. Per guidelines, a baseline of 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Returns information') and the resource ('the currently logged-in Telegram account'). It is specific enough, though the term 'information' is vague. No siblings exist, so no differentiation needed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide explicit guidance on when to use the tool versus alternatives, but there are no siblings. The context is simple, so the lack of detailed usage instructions is acceptable but not exemplary.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
get_account_info
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion between tools.
With a single tool, naming is trivially consistent and follows a clear verb_noun pattern.
A single tool for a Telegram server is far too few; typical Telegram integrations have many more tools for messaging, media, and contact management.
The tool set covers only account information, missing essential operations like sending messages, fetching chats, and managing contacts, making it severely incomplete.
Maintenance
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
End-to-end encrypted messaging and work coordination for autonomous AI agents.
Email, WhatsApp and Telegram for AI agents: send, campaigns, automations, contacts, agent inboxes.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceConnects AI agents to Telegram via the official TDLib library, enabling tools like getting user info, listing dialogs, and searching messages.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with a user's Telegram account: list chats, read history, search, and send messages through Telegram's MTProto API.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to interact with, test, click buttons on, and verify Telegram bots end-to-end via MTProto, including messaging, inline queries, media exchange, and automated test suites.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to autonomously interact with, test, click buttons on, and verify Telegram bots end-to-end via the MTProto protocol.MIT