communication
Telegram MCP Integration for Vercel AI SDK
Connect Telegram to Vercel AI SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.
Connect Telegram to Vercel AI SDK
Use KosmoKrator as a local integration gateway for Vercel AI SDK agents and scripts.
Create an MCP client that starts or connects to the KosmoKrator gateway for the selected integration. The gateway is local, scoped to this integration, and starts with
--write=deny so Vercel AI SDK can inspect read-capable tools without receiving write access by default.
Telegram MCP Config for Vercel AI SDK
Prefer CLI JSON calls when a workflow only needs one deterministic integration operation.
{
"mcpServers": {
"kosmokrator-telegram": {
"type": "stdio",
"command": "kosmo",
"args": [
"mcp:serve",
"--integration=telegram",
"--write=deny"
]
}
}
} Run the Gateway Manually
kosmokrator mcp:serve --integration=telegram --write=deny Why Use KosmoKrator Here
Expose only Telegram instead of a broad multi-service tool list.
Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.
Start read-only, then opt into ask or allow for trusted workspaces.
Telegram Tools Visible to Vercel AI SDK
Vercel AI SDK sees stable MCP tool names generated from the Telegram integration catalog.
| MCP tool | Source function | Type | Description |
|---|---|---|---|
integration__telegram__telegram_send_message | telegram.telegram_send_message | Write | Send a text message to a Telegram chat. Provide the chat_id and message text. The chat_id can be a numeric ID or @channelusername. Supports optional parse_mode (Markdown, MarkdownV2, HTML) and other formatting options. |
integration__telegram__telegram_list_updates | telegram.telegram_list_updates | Read | Get incoming updates (messages, callback queries, inline queries, etc.) for the Telegram bot. Use offset to acknowledge previously received updates. Returns an array of update objects. |
integration__telegram__telegram_get_me | telegram.telegram_get_me | Read | Get information about the authenticated Telegram bot. Returns the bot ID, username, display name, and capability flags. |
integration__telegram__telegram_list_chats | telegram.telegram_list_chats | Read | List recent chats the bot has interacted with. Since Telegram Bot API does not have a native list-chats endpoint, this fetches recent updates and extracts unique chats. Returns chat IDs, types, and titles. |
integration__telegram__telegram_get_chat | telegram.telegram_get_chat | Read | Get information about a specific Telegram chat by its ID or @username. Returns chat type, title, description, member count, and other metadata. |
integration__telegram__telegram_send_photo | telegram.telegram_send_photo | Write | Send a photo to a Telegram chat. Provide the chat_id and a photo URL or file_id. Supports optional caption with formatting and other options. |
integration__telegram__telegram_get_current_user | telegram.telegram_get_current_user | Read | Get the profile of the currently authenticated Telegram bot. Returns bot ID, username, display name, and capability flags. |