{"type":"mcp_server","name":"telegram-mcp","description":"This repository provides a Telegram MCP server, enabling interaction with Telegram chats through MCP-compatible hosts like Claude for Desktop, using tools for retrieving chats, messages, and sending messages.","category":"Communication","language":"Python","stars":1251,"forks":7,"owner":"chigwell","github_url":"https://github.com/chigwell/telegram-mcp","homepage":null,"setup":"## Setup\n\n1.  Clone the Repository:\n\n    ```bash\n    git clone https://github.com/chigwell/telegram-mcp\n    cd telegram-mcp\n    ```\n\n2.  Create Environment File: Copy and rename `.env.example` to `.env` and fill it with your Telegram credentials obtained from [https://my.telegram.org/apps](https://my.telegram.org/apps):\n\n    ```bash\n    cp .env.example .env\n    ```\n\n    Your `.env` file should look like:\n\n    ```env\n    TELEGRAM_API_ID=your_api_id_here\n    TELEGRAM_API_HASH=your_api_hash_here\n    TELEGRAM_SESSION_NAME=your_session_name\n    ```\n\n3.  Setup Python Environment: Use `uv` to set up the Python environment and install dependencies:\n\n    ```bash\n    uv venv\n    source .venv/bin/activate\n    uv add \"mcp[cli]\" telethon python-dotenv nest_asyncio\n    ```\n\n4.  Run the Server (First-time Auth): The first time you run the server, Telethon will prompt you to enter a Telegram authentication code:\n\n    ```bash\n    uv run main.py\n    ```\n\n    Authenticate by entering the code sent to your Telegram client; this step is only required once.\n\n5. Integrating with Claude for Desktop:\n\n    *   macOS/Linux: Edit your Claude Desktop configuration:\n\n        ```bash\n        nano ~/Library/Application\\ Support/Claude/claude_desktop_config.json\n        ```\n\n        Add this MCP server configuration:\n\n        ```json\n        {\n            \"mcpServers\": {\n                \"telegram-mcp\": {\n                    \"command\": \"uv\",\n                    \"args\": [\n                        \"--directory\",\n                        \"/ABSOLUTE_PATH/telegram-mcp\",\n                        \"run\",\n                        \"main.py\"\n                    ]\n                }\n            }\n        }\n        ```\n\n        Ensure you replace `/ABSOLUTE_PATH/telegram-mcp` with your project's absolute path.\n\n    *   Windows: Edit your Claude Desktop configuration:\n\n        ```powershell\n        nano $env:AppData\\Claude\\claude_desktop_config.json\n        ```\n\n        Add this MCP server configuration:\n\n        ```json\n        {\n            \"mcpServers\": {\n                \"telegram-mcp\": {\n                    \"command\": \"uv\",\n                    \"args\": [\n                        \"--directory\",\n                        \"C:\\\\ABSOLUTE_PATH\\\\telegram-mcp\",\n                        \"run\",\n                        \"main.py\"\n                    ]\n                }\n            }\n        }\n        ```\n\n        Ensure you replace `C:\\ABSOLUTE_PATH\\telegram-mcp` with your project's absolute path.","tools":"## Available Tools\n\n\t\t1. `get_chats` (Retrieve a paginated list of your Telegram chats.)\n\t\t2. `get_messages` (Retrieve paginated messages from a specific chat.)\n\t\t3. `send_message` (Send a message to a specific chat.)","faq":null,"created_at":"2025-03-20T14:06:35+00:00","updated_at":"2025-03-28T18:02:15+00:00","source_url":"https://model-context-protocol.com/servers/telegram-mcp-server-chat-integration-api","related_articles":[]}