Works with Telegram through MTProto so agents can list dialogs and read messages.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add telegram --env TELEGRAM_API_ID='<TELEGRAM_API_ID>' --env TELEGRAM_API_HASH='<TELEGRAM_API_HASH>' -- uv run mcp-telegram~/.codex/config.toml
[mcp_servers.telegram]
command = "uv"
args = ["run", "mcp-telegram"]
env = { TELEGRAM_API_ID = "<TELEGRAM_API_ID>", TELEGRAM_API_HASH = "<TELEGRAM_API_HASH>" }
# codex mcp add telegram --env TELEGRAM_API_ID='<TELEGRAM_API_ID>' --env TELEGRAM_API_HASH='<TELEGRAM_API_HASH>' -- uv run mcp-telegram~/.cursor/mcp.json
{
"mcpServers": {
"telegram": {
"command": "uv",
"args": [
"run",
"mcp-telegram"
],
"env": {
"TELEGRAM_API_ID": "<TELEGRAM_API_ID>",
"TELEGRAM_API_HASH": "<TELEGRAM_API_HASH>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"telegram": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"mcp-telegram"
],
"env": {
"TELEGRAM_API_ID": "<TELEGRAM_API_ID>",
"TELEGRAM_API_HASH": "<TELEGRAM_API_HASH>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"telegram": {
"command": "uv",
"args": [
"run",
"mcp-telegram"
],
"env": {
"TELEGRAM_API_ID": "<TELEGRAM_API_ID>",
"TELEGRAM_API_HASH": "<TELEGRAM_API_HASH>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"telegram": {
"command": "uv",
"args": [
"run",
"mcp-telegram"
],
"env": {
"TELEGRAM_API_ID": "<TELEGRAM_API_ID>",
"TELEGRAM_API_HASH": "<TELEGRAM_API_HASH>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"telegram": {
"command": "uv",
"args": [
"run",
"mcp-telegram"
],
"env": {
"TELEGRAM_API_ID": "<TELEGRAM_API_ID>",
"TELEGRAM_API_HASH": "<TELEGRAM_API_HASH>"
}
}
}
}Environment variables
TELEGRAM_API_IDTELEGRAM_API_HASH
Replace the placeholders with your own credentials and keep them out of version control.