The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Tsgram MCP listing page.
Get Claude Code in your local project talking to Telegram in 3 minutes!
TSGram MCP connects Claude Code sessions to Telegram using TS/Node/Docker/cli-utils, enabling AI-powered code assistance directly in your Telegram chats. Ask questions about your codebase, get AI insights, and even edit files - all from Telegram on your phone!
Let Claude handle the entire setup and ask you for the required values.
From your terminal: 0. Install Docker Desktop and Node.js 20+ (npm included)
Clone the repository:
From the command line, start Claude:
Initialize with /init
Copy and paste this prompt:
First, explain to the human how to register a new Telegram bot with @BotFather and get their bot token (TELEGRAM_BOT_TOKEN), and how to get their Telegram user ID from @userinfobot (for AUTHORIZED_CHAT_ID). They can work on getting these credentials while you set up the system. Then help the user set up tsgram-mcp for claude code. Do everything from installing node modules to creating and deploying the local docker containers. Finally, when everything is deployed, remind the user to configure their bot token and authorized chat ID along wither other required .env variables.
Make sure you replace the TELEGRAM_BOT_TOKEN and AUTHORIZED_CHAT_ID placeholders with the actual values.
In order to retrieve those values, you will have to message the following Telegram bots and follow their instructions:
The AI will then handle all the setup steps for you, including:
CLI no-AI Alternative If Hitting LLM troubles: Setup Shell Script Run from your project root:
Adding TSGram to an Existing Project:
If you already have a project and want to add TSGram as an MCP server:
From your existing project root:
Use Claude to set it up:
Paste this prompt:
"First, explain to the human how to register a new Telegram bot with @BotFather and get their bot token (TELEGRAM_BOT_TOKEN) from @UserBotInfoBot, and how to get their Telegram user ID from @userinfobot (for AUTHORIZED_CHAT_ID). They can work on getting these credentials while you set up the system. Then help me add TSGram MCP to my existing project in the parent directory. Set up the Docker containers and MCP configuration so I can use Telegram to interact with my project files. The project root is one level up from here."
This will configure TSGram to work with your existing project structure (and allow you to extend functionality locally).
IMPORTANT: You will need to message your bot first before it can message you.
Send your bot a message and ask it something about your local project!
⚠️ Security Note: TSGram has basic safeguards to not list, preview, or serve .env files but it is still strongly recommended that you do not use TSGram for anything highly sensitive as third party servers are part of the transport layer.
Monitor and manage your bots through the beautiful web dashboard at http://localhost:3000:
The dashboard provides:
/newbot and follow prompts123456789)Edit .env with your values:
Security Note: The bot now uses your numeric user ID instead of username for authorization. This is more secure because:
:h ls or :h cat $FILE):dangerzone to enable):h - Show help and available commands:h ls [path] - List files in directory:h cat filename - View file contents:dangerzone - Enable file editing (careful!):safetyzone - Disable file editingstop - Pause bot responsesstart - Resume bot responsesThe project includes several helper scripts in the scripts/ directory:
Setup & Configuration
setup.sh - Automated install script (can be run via curl)configure-mcp.sh - Configure MCP settings for Claude Desktop/Codefix-permissions.sh - Fix file permissions if neededUpdates & Maintenance
update-system.sh - Update TSGram to latest versionupdate-ai-context.sh - Update AI context filesTesting & Debugging
test-api-keys.sh - Verify your API keys are workingtest-docker-setup.sh - Test Docker configurationRun any script with:
Add to your Claude Code MCP settings:
Note: Replace 123456789 with your actual numeric user ID from @userinfobot
TSGram uses the standard Model Context Protocol (MCP) format and should be compatible with any MCP-supporting IDE or tool. Tested with:
Should work with (standard MCP format):
Use the same Docker configuration pattern shown above, adapting the syntax for your specific MCP client.
Forward Claude Code CLI responses to Telegram:
Bot not responding?
Can't connect to bot?
.envAUTHORIZED_CHAT_ID is your numeric user ID (not username)
AUTHORIZED_CHAT_ID in your .env fileFile edits not working?
:dangerzone to enable (one-time)PRs welcome! Please:
MIT - Feel free to use in your own projects!
Need help? Open an issue on GitHub or message your bot with questions!