跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Telegram Bot,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
通过 Telegram Bot API,从任意 AI 代理发送 Telegram 消息、照片、相册、文档、音频、视频、动画、贴纸、联系人、地点、位置和投票。21 个工具,使用机器人令牌认证。以发送为主,另可轻量读取最近的更新(不使用长轮询)。
试试这样问
Telegram Bot 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Telegram Bot、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Telegram Bot + Microsoft Copilot
通过 Telegram Bot API,从任意 AI 代理发送 Telegram 消息、照片、相册、文档、音频、视频、动画、贴纸、联系人、地点、位置和投票。21 个工具,使用机器人令牌认证。以发送为主,另可轻量读取最近的更新(不使用长轮询)。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
TELEGRAM_BOT_TOKEN
步骤 1 — 获取凭证
- 在 Telegram 中打开与 @BotFather 的对话,发送
/newbot,然后设置显示名称和以bot结尾的用户名。 - BotFather 会回复一个类似
123456789:ABCdef...的令牌。请把它当作密钥保管:任何拿到它的人都能以你的机器人身份发送消息。 - 将完整令牌粘贴到
TELEGRAM_BOT_TOKEN,然后安装连接器。Telegram 要求令牌出现在请求地址中,连接器会自动帮你放进去。 - 先运行
telegram_bot_get_me,确认令牌可用。
机器人能联系谁:每个聊天都有一个数字 chat_id。用户必须至少给你的机器人发送过一次 /start,群组和频道则需要先把机器人加进去。公开频道也接受 @channelusername;私有频道需要数字 id,以 -100 开头。telegram_bot_get_updates 会显示最近收到的消息及其 chat id。
能发送什么:文本消息(HTML 格式最稳妥)、照片、相册、文档、音频文件、语音消息、视频、GIF 动画、贴纸、联系人名片、地点、位置(包括实时位置)以及投票或测验。它还可以编辑和删除自己发出的消息,并读取聊天详情。
相册:telegram_bot_send_album 可将 2 到 10 张照片和视频作为一条分组消息发送,也可发送 2 到 10 个文档或 2 到 10 个音频文件;文档和音频不能与其他类型混合。说明文字放在第一项上。如果 Telegram 对某一项报告 WEBPAGE_CURL_FAILED,说明它无法下载该文件:链接必须公开,并直接指向文件本身,而不是网页。
文件:媒体通过 HTTPS 链接发送(照片最大 5 MB,其他文件最大 20 MB),或使用之前发送过的内容的 file_id。不支持在同一次调用中从你的电脑上传文件。
已经安装过? 相册、动画、贴纸、联系人和地点工具会通过目录更新加入你之前安装的连接器:在 AnythingMCP 中打开该连接器,在 Catalog update available 下查看新工具列表,然后点击 Apply update。你的机器人令牌和你自己添加的工具保持不变。
速率限制:不同聊天之间每秒约 30 条消息,同一聊天每秒 1 条,同一群组每分钟 20 条。遇到 429 时,Telegram 会告知需要等待多久。
连接器只在被要求时读取最近的更新,不会运行自动回复的聊天机器人,那需要你自己托管的 webhook。不支持支付、内联模式、游戏和贴纸集管理。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Microsoft Copilot 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Microsoft Copilot 通过在 Copilot Studio 中构建的智能体使用 MCP 服务器:把 AnythingMCP 作为工具添加到智能体,然后把智能体发布到 Microsoft 365 Copilot 和 Teams。Copilot Studio 从 Microsoft 的云端通过 Streamable HTTP 连接,AnythingMCP 支持这种方式。
- 在 Copilot Studio 中打开你的智能体(或新建一个),进入 Tools,选择 Add a tool → New tool → Model Context Protocol。
- 填写 Server name(例如
AnythingMCP)、说明连接器用途的 Server description,以及 Server URLhttps://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。Copilot Studio 根据描述决定何时调用该服务器。 - 身份验证选择 API key,把 Type 设为 Header,请求头名称填
X-API-Key,然后选择 Create。 - 在 Add tool 中选择 Create a new connection,粘贴 AnythingMCP 的 MCP API 密钥(MCP Servers → 你的服务器 → API keys),然后选择 Add to agent。
- 在智能体的 Test 窗格中试一试:提出需要用到
Telegram Bot的工具的请求。 - 选择 Publish,然后进入 Channels → Microsoft 365 and Microsoft Teams,保持勾选 Make agent available in Microsoft Copilot,再选择 Add channel。See agent in Teams 会为你安装该智能体;在 Microsoft 365 Copilot 中输入 @ 并选择该智能体。
希望每个用户各自登录?请选择 OAuth 2.0 → Dynamic discovery 代替 API 密钥:每个用户会在智能体首次调用时登录 AnythingMCP。
自托管?请用你实例的公网 HTTPS 地址替换 https://cloud.anythingmcp.com。Copilot Studio 从 Microsoft 的云端连接,因此 localhost 无法使用。
可用工具
| Tool | What it does |
|---|---|
telegram_bot_get_me | Return the bot's own user info: id, username, first_name, can_join_groups, can_read_all_group_messages, supports_inline_queries |
telegram_bot_send_message | Send a text message to a chat |
telegram_bot_send_photo | Send a photo (JPG/PNG, ≤5MB via URL) by HTTPS URL or by reusable file_id |
telegram_bot_send_document | Send a document (any type, ≤20MB via URL) by HTTPS URL or file_id |
telegram_bot_send_audio | Send an audio file (MP3, M4A, ≤20MB via URL) |
telegram_bot_send_voice | Send a voice note (OGG-Opus encoded) |
telegram_bot_send_video | Send a video (MP4, H.264, AAC, ≤20MB via URL) |
telegram_bot_send_location | Send a location point |
telegram_bot_send_poll | Send a poll (regular or quiz) |
telegram_bot_edit_message_text | Edit the text of a previously-sent message (your bot's own messages only) |
telegram_bot_delete_message | Delete a message the bot sent (within ~48 hours for groups, anytime for own DMs) |
telegram_bot_get_chat | Fetch chat info: title, type (private/group/supergroup/channel), photo, description, invite_link, member_count, permissions |
telegram_bot_get_updates | Long-poll recent inbound messages (one-shot: pulls all updates since the last offset+1) |
telegram_bot_send_album | Send 2 to 10 photos or videos as one album (sendMediaGroup), or 2 to 10 documents, or 2 to 10 audio files; documents and audio cannot be… |
telegram_bot_send_animation | Send a GIF or a silent MP4 animation by HTTPS URL or file_id; Telegram plays it on a loop |
telegram_bot_send_sticker | Send a sticker by file_id (any sticker the bot has seen, e.g. from telegram_bot_get_updates) or by HTTPS URL of a .WEBP image |
telegram_bot_send_contact | Send a phone contact card that the recipient can save or call |
telegram_bot_send_venue | Send a venue: a map pin with a name and address, e.g. a shop or meeting point |
telegram_bot_get_file | Look up a file the bot received (photo, document, voice note, video) by its file_id, from a message in telegram_bot_get_updates |
telegram_bot_download_file | Download a file by the file_path telegram_bot_get_file returned |
telegram_bot_fetch_sticker_set | Read a sticker set (or custom emoji set) by its name: title, sticker_type (regular, mask, custom_emoji) and every sticker with its emoji… |
示例提示
- “把这四个链接里的照片作为一个相册发到我们的团队频道,说明文字写‘新系列,今日上线’。”
- “在销售群里发一个投票:季度回顾安排在周二还是周四?”
- “把我们店的地址作为地点发到客户聊天里,方便他们在地图应用中打开。”
- “给我看看机器人在过去一小时收到的消息,以及是谁发的。”
FAQ
这适用于哪个 Copilot? 适用于工作中的 Microsoft 365 Copilot,通过 Copilot Studio 的智能体实现。面向个人账户的 Microsoft Copilot 应用无法添加自己的 MCP 服务器。
我需要什么? 一个可以使用 Copilot Studio 的工作账户(许可证或试用版),用于构建智能体。在 Microsoft 365 Copilot 或 Teams 中使用它的人需要拥有该智能体的访问权限:把它共享给他们,或请管理员为整个组织发布。如果你的组织对 Power Platform 连接器设置了数据策略,这些策略同样适用于 MCP 服务器。
智能体不调用工具。 检查请求头名称是否正好是 X-API-Key,密钥是否属于与 URL 相同的 MCP 服务器,并把 Server description 写得具体:Copilot Studio 根据它决定何时调用服务器。每次修改后重新发布智能体;在已打开的对话中输入 "start over" 即可使用新版本。
下一步
这份指南对你有帮助吗?