MCP-Telegram allows Large Language Models to interact with Telegram via the Model Context Protocol (MCP). This server enables AI agents to perform Telegram actions such as sending messages, searching chats, managing drafts, and downloading media using the MTProto protocol.
uv
package manager - Install following the official uv guideInstall the MCP-Telegram CLI tool:
uv tool install mcp-telegram
Before using the server, you need to authenticate with your Telegram account:
mcp-telegram login
During the login process, you'll need to provide:
Your credentials will be securely stored for future use.
To logout from the current session:
mcp-telegram logout
To remove all stored session data:
mcp-telegram clear-session
To use MCP-Telegram with clients like Claude Desktop or Cursor, you need to configure the MCP server:
{
"mcpServers": {
"mcp-telegram": {
"command": "mcp-telegram",
"args": ["start"],
"env": {
"API_ID": "<your_api_id>",
"API_HASH": "<your_api_hash>"
}
}
}
}
If the client can't find the command, use the full path to the executable:
which mcp-telegram
(macOS/Linux) or where mcp-telegram
(Windows)command
value with the full pathSave the configuration file in the appropriate location:
~/Library/Application Support/Claude/
or ~/.cursor/
%APPDATA%\Claude\
or %APPDATA%\Cursor\
Restart your application
For detailed parameter information and examples:
mcp-telegram tools
If you encounter "database is locked" errors, it's likely because multiple instances of mcp-telegram
are using the same session file. Ensure only one instance uses a session file at a time.
To force-stop existing processes:
pkill -f "mcp-telegram"
taskkill /F /IM mcp-telegram.exe /T
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.