Telegram MCP Server
Allows AI assistants to send messages to Telegram users via a Telegram bot, supporting chat IDs and usernames, with optional default user configuration.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Telegram MCP Serversend a message to the team: Deployment completed successfully"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Telegram MCP Server
⚠️ Disclaimer: This project contains AI-generated code that has not been thoroughly tested. Use at your own risk and verify all functionality before production deployment.
A Model Context Protocol (MCP) server that enables AI assistants to send messages to Telegram users. Features a web-based configuration interface and supports both chat IDs and usernames.
Features
MCP Tool:
send_telegram_messagetool for AI assistantsDefault User Support: Send messages to a configured default user when no recipient is specified
Web Interface: Easy configuration and testing via web browser
Flexible Recipients: Support for both Telegram chat IDs and usernames
Real-time Status: Live status monitoring of server and bot configuration
Related MCP server: Telegram Bot MCP
Prerequisites
Node.js 18 or higher
A Telegram bot token from @BotFather
Quick Start
1. Create a Telegram Bot
Open Telegram and search for @BotFather
Start a chat and send the command
/newbotFollow the prompts to:
Choose a name for your bot
Choose a username for your bot (must end with
bot)
Copy the API token provided by BotFather
2. Install and Configure
# Clone or download this repository
git clone <repository-url>
cd telegram-mcp-server
# Install dependencies
npm install
# Copy environment template
cp .env.example .env
# Edit .env file with your bot token
# TELEGRAM_BOT_TOKEN=your_bot_token_here3. Start the Server
# Start the server
npm startThe web interface will be available at http://localhost:3000
4. Configure via Web Interface
Open
http://localhost:3000in your browserEnter your bot token in the configuration section
Optionally set a default user (chat ID or username)
Click "Save Configuration"
5. Test the Bot
In the web interface, go to the "Test Message Sending" section
Enter a test message
Optionally specify a recipient (leave empty to test default user)
Click "Send Test Message"
Configuration
Primary Configuration: MCP Servers GUI (Recommended)
Configuration should be managed through Cursor's MCP Servers settings:
Open Cursor Settings (
Ctrl+,orCmd+,)Search for "MCP" or navigate to MCP Servers settings
Add or edit the
telegramserver configurationSet environment variables:
TELEGRAM_BOT_TOKEN(required): Your bot token from @BotFatherTELEGRAM_DEFAULT_USER(optional): Default chat ID or username for messages
Configuration Priority:
Primary: Environment variables from MCP Server configuration (Cursor GUI) - used at startup
Secondary: Runtime updates via web interface API - for testing/debugging only
Stored Values as Defaults:
When tool calls don't provide
chatIdorusername, the storedTELEGRAM_DEFAULT_USERis used automaticallyIf
TELEGRAM_DEFAULT_USERis not configured and no recipient is provided, an error is returned
Web Interface Configuration (Testing/Debugging)
The web interface (http://localhost:3000) allows runtime configuration changes for testing:
Bot Token: Enter your Telegram bot token (runtime only)
Default User: Set a fallback recipient when no user is specified in messages
Use chat ID (numeric) for reliability
Username can be used but requires the user to have started your bot
⚠️ Note: Web interface configuration is temporary and for testing purposes. For persistent configuration, use Cursor's MCP Servers GUI.
Legacy: Environment Variables File
For standalone usage (not via MCP), you can create a .env file:
# Required: Your bot token from BotFather
TELEGRAM_BOT_TOKEN=your_bot_token_here
# Optional: Default user for messages (chat ID or username)
TELEGRAM_DEFAULT_USER=123456789
# Optional: Web interface port (default: 3000)
WEB_PORT=3000Usage with MCP Clients
Connecting to Cursor
Build the project:
npm run buildConfigure in Cursor's MCP Servers GUI:
Open Cursor Settings (
Ctrl+,orCmd+,)Search for "MCP Servers" or navigate to MCP settings
Add a new server or edit existing:
Name:
telegramCommand:
nodeArguments:
C:\AppDev\Projects\MsgMCP\dist\index.js(use your full path)Environment Variables:
TELEGRAM_BOT_TOKEN: Your bot token from @BotFatherTELEGRAM_DEFAULT_USER: (Optional) Default chat ID or username
Restart Cursor for changes to take effect
Cursor AI Notification Rule
Purpose: Ensure the user is promptly notified whenever user intervention is required.
Triggers:
Completion of the process with a success message
Any unexpected halts or issues in the process
When Cursor AI requires user input or has questions
Action: Utilize send_telegram_message tool to send a detailed Telegram message to the user.
Connecting to Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"telegram": {
"command": "node",
"args": ["/path/to/telegram-mcp-server/dist/index.js"],
"env": {
"TELEGRAM_BOT_TOKEN": "your_bot_token_here",
"TELEGRAM_DEFAULT_USER": "your_default_user"
}
}
}
}Using the Tool
The server provides one MCP tool: send_telegram_message
Parameters
message(required): The text message to send to the default user
Examples
Send to default user:
Send a message saying "Hello from AI!"The tool automatically sends to the TELEGRAM_DEFAULT_USER configured in the .env file. No recipient specification needed!
Simple usage:
Tell the user that the task is completeNotify that the server is runningAPI Endpoints
The server exposes a REST API for configuration and testing:
GET /api/status
Get server and bot status information.
Response:
{
"server": "running",
"bot": "initialized",
"config": {
"hasToken": true,
"hasDefaultUser": true
}
}GET /api/config
Get current configuration (masked for security).
Response:
{
"telegramBotToken": "configured",
"telegramDefaultUser": "123456789",
"webPort": 3000
}POST /api/config
Update configuration.
Request:
{
"telegramBotToken": "new_token_here",
"telegramDefaultUser": "new_default_user"
}POST /api/test
Send a test message.
Request:
{
"message": "Test message",
"chatId": "123456789",
"username": "@testuser"
}Development
Build
npm run buildDevelopment Mode
npm run devRun Web Interface Only
npm run webTroubleshooting
Bot Not Sending Messages
Check Bot Token: Ensure your bot token is correct and the bot is not revoked
User Interaction: For username-based sending, the user must have started your bot first
Chat ID vs Username: Use chat IDs for more reliable message delivery
Web Interface Not Loading
Port Conflict: Check if port 3000 is available
Firewall: Ensure the port is not blocked by firewall
Environment: Verify Node.js version and dependencies
MCP Connection Issues
Path: Ensure the path to
dist/index.jsis correct in your MCP client configEnvironment Variables: Make sure required environment variables are set
Build: Ensure the project is built (
npm run build) before connecting
Security Considerations
Store bot tokens securely and never commit them to version control
The web interface is intended for local configuration only
Consider additional authentication for production deployments
Bot tokens have full access to your bot - keep them confidential
License
Contributing
Fork the repository
Create a feature branch
Make your changes
Test thoroughly
Submit a pull request
Support
For issues and questions:
Check the troubleshooting section above
Review the Telegram Bot API documentation
Check MCP documentation for client integration
Changelog
v1.0.0
Initial release
MCP server with Telegram messaging tool
Web-based configuration interface
Support for chat IDs and usernames
Default user fallback functionality
Available Tools
1 toolsend_telegram_messageB
Send a message to the default Telegram user configured in .env file.
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The message text to send to the default user configured in .env file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the basic action but omits important traits such as side effects (external message delivery), error behavior if .env is misconfigured, whether the send is synchronous or asynchronous, or any rate limits. For a tool with no annotation safety net, this is insufficient.
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 that directly states what the tool does without any redundant or extraneous words. It earns its place by being both concise and informative.
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?
The tool is simple, but with no output schema and no annotations, the description should explain what happens after sending, such as return values or error behavior. The current description ends at the action itself, leaving the agent without information about outcomes. This is a significant gap for proper tool selection and invocation.
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?
The input schema already provides 100% coverage for the single 'message' parameter with a clear description, so the tool description does not need to add more. The description adds no additional parameter meaning beyond the schema, placing it at the baseline of 3.
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 tool's action ('Send') and resource ('a message to the default Telegram user configured in .env file'). It is specific and directly mirrors the tool name, with no ambiguity. There are no sibling tools to differentiate from, so this fully satisfies purpose clarity.
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 implies usage whenever a message needs to be sent to the configured default Telegram user, but it does not explicitly state when to use this tool or mention any alternatives. Since there are no sibling tools, explicit exclusions are unnecessary, but the guidance is implied rather than stated.
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. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
send_telegram_message
TDQS
Only one tool exists, so there is no possibility of confusing it with others. The tool's purpose is clearly stated.
The tool name follows a clear verb_noun pattern (send_telegram_message), and with only one tool, consistency is trivially maintained.
A single tool is far too few for a Telegram MCP server, which typically requires sending, receiving, editing, and media operations. The narrow scope of sending only to a default user makes the server feel like a minimal notification service rather than a general Telegram integration.
The tool surface is severely incomplete, covering only text message sending to a default recipient. Missing common operations such as sending media, editing messages, handling updates, and selecting recipients makes most Telegram workflows impossible.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Share one project context across ChatGPT, Claude, Telegram and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA Model Context Protocol server that enables AI assistants to interact with Telegram, allowing them to search channels, list available channels, retrieve messages, and filter messages by regex patterns.5142MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to send messages and interact with Telegram chats through MCP tools, with support for user management, conversation history, and bot command handling.1-
- -licenseNot gradedqualityNot gradedmaintenanceA comprehensive integration that allows AI models to interact with Telegram accounts for messaging, group management, and contact synchronization. It enables automated tasks like chat history analysis, message scheduling, and webhook-based responses through the Model Context Protocol.-
- FlicenseNot gradedqualityDmaintenanceEnables sending messages to Telegram channels via MCP protocol, integrating with AI assistants for automated messaging.7-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bonzhigh/MsgMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server