Overview
Telegram MCP Server is a project that provides a Telegram client library and an MCP (Model Context Protocol) server, enabling AI assistants to interact with Telegram.
To use the Telegram MCP Server, set up your environment with your Telegram API credentials, install the necessary dependencies, and run the server to interact with Telegram channels and messages.
- Authentication with Telegram (including 2FA support) - Session management for automatic reuse of existing sessions - Retrieving chats and messages from specific channels - Filtering messages using regex patterns - Searching for channels by keywords
- Building AI assistants that can interact with Telegram channels.
- Automating message retrieval and filtering for data analysis.
- Creating chatbots that can manage and respond to messages in Telegram.
Add to your AI client
Use these steps to connect Telegram MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"telegram-mcp-server-kfastov": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-telegram-mcp-server-kfastov"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"telegram-mcp-server-kfastov": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-telegram-mcp-server-kfastov"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"telegram-mcp-server-kfastov": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-telegram-mcp-server-kfastov"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"telegram-mcp-server-kfastov": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-telegram-mcp-server-kfastov"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"telegram-mcp-server-kfastov": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-telegram-mcp-server-kfastov"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"telegram-mcp-server-kfastov": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-telegram-mcp-server-kfastov"
]
}
}
}FAQ
Can I use this server with any AI assistant?
Yes! The MCP server can be used with any MCP-compatible assistant.
Is there a limit to the number of channels I can access?
No, you can access all channels that your Telegram account has access to.
How do I filter messages?
You can filter messages by applying regex patterns to the retrieved messages.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":3461,"uuid":"8bb4340b-a19a-4820-825e-3ba487a1b334","name":"telegram-mcp-server","title":"Telegram MCP Server","description":"MCP server implementation for Telegram","avatar_url":"https://avatars.githubusercontent.com/u/1312744?v=4","created_at":"2025-03-19T16:44:48.942Z","updated_at":"2025-03-19T16:45:35.333Z","status":"created","author_name":"kfastov","author_avatar_url":"https://avatars.githubusercontent.com/u/1312744?v=4","tags":"telegram,mcp,telegram-client,ai-agents,mcp-server,fastmcp","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/kfastov/telegram-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"12\",\"license\":\"MIT license\",\"language\":\"JavaScript\",\"is_official\":false,\"latest_commit_time\":\"2025-04-22 19:52:43\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]