Skip to content

Commit a723665

Browse files
author
Anant Kumar
committed
docs: add uvx quick start guide to README
Add comprehensive documentation for running telegram-mcp via uvx, including installation, configuration, and benefits. This addresses the gap where uvx support was implemented but not documented. The new section covers: - Prerequisites and setup - Session string generation - Running with uvx - MCP configuration examples for Claude and Cursor - File-path tools configuration - Benefits of using uvx over traditional installation Fixes #42
1 parent aaa14c9 commit a723665

1 file changed

Lines changed: 98 additions & 2 deletions

File tree

README.md

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,106 @@ docker run -it --rm \
297297

298298
---
299299

300-
## ⚙️ Configuration for Claude & Cursor
300+
## Quick Start with uvx
301+
302+
For the fastest setup without cloning the repository, you can use `uvx` (part of the `uv` toolchain) to run `telegram-mcp` directly from PyPI:
303+
304+
### Prerequisites
305+
- Python 3.10 or higher
306+
- [uv](https://docs.astral.sh/uv/) installed (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
307+
- Telegram API credentials from [my.telegram.org/apps](https://my.telegram.org/apps)
308+
- A session string (generate one first—see below)
309+
310+
### Generate a Session String
311+
312+
Before using `uvx`, you need to generate a session string. Clone the repository temporarily to use the session generator:
313+
314+
```bash
315+
git clone https://github.com/chigwell/telegram-mcp.git
316+
cd telegram-mcp
317+
uv run session_string_generator.py
318+
```
319+
320+
Follow the prompts to authenticate with your Telegram account. Save the generated session string securely.
321+
322+
### Running with uvx
323+
324+
Once you have your session string, you can run the server directly:
325+
326+
```bash
327+
uvx telegram-mcp
328+
```
329+
330+
The server will look for environment variables or a `.env` file in your current directory. Make sure to set:
331+
332+
```bash
333+
export TELEGRAM_API_ID=your_api_id_here
334+
export TELEGRAM_API_HASH=your_api_hash_here
335+
export TELEGRAM_SESSION_STRING=your_session_string_here
336+
```
337+
338+
Alternatively, create a `.env` file in your working directory with these values.
339+
340+
### MCP Configuration for uvx
341+
342+
To use `telegram-mcp` via `uvx` in Claude or Cursor, update your MCP configuration:
343+
344+
**Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
345+
```json
346+
{
347+
"mcpServers": {
348+
"telegram-mcp": {
349+
"command": "uvx",
350+
"args": ["telegram-mcp"],
351+
"env": {
352+
"TELEGRAM_API_ID": "your_api_id_here",
353+
"TELEGRAM_API_HASH": "your_api_hash_here",
354+
"TELEGRAM_SESSION_STRING": "your_session_string_here"
355+
}
356+
}
357+
}
358+
}
359+
```
360+
361+
**Cursor** (`~/.cursor/mcp.json`): Same format as above.
362+
363+
### Benefits of uvx
364+
365+
- **No repository clone required**: Run directly from PyPI
366+
- **Automatic dependency management**: `uv` handles all dependencies in isolated environments
367+
- **Easy updates**: `uvx telegram-mcp` always runs the latest published version
368+
- **Clean system**: No global installation or virtual environment clutter
369+
370+
For file-path tools (e.g., `send_file`, `download_media`), pass allowed root directories as arguments:
371+
372+
```bash
373+
uvx telegram-mcp /path/to/allowed/dir1 /path/to/allowed/dir2
374+
```
375+
376+
Or in your MCP config:
377+
378+
```json
379+
{
380+
"mcpServers": {
381+
"telegram-mcp": {
382+
"command": "uvx",
383+
"args": ["telegram-mcp", "/data/telegram", "/tmp/telegram-mcp"],
384+
"env": {
385+
"TELEGRAM_API_ID": "your_api_id_here",
386+
"TELEGRAM_API_HASH": "your_api_hash_here",
387+
"TELEGRAM_SESSION_STRING": "your_session_string_here"
388+
}
389+
}
390+
}
391+
}
392+
```
393+
394+
---
395+
396+
## Configuration for Claude & Cursor (Development Setup)
301397

302398
### MCP Configuration
303-
Edit your Claude desktop config (e.g. `~/Library/Application Support/Claude/claude_desktop_config.json`) or Cursor config (`~/.cursor/mcp.json`):
399+
If you've cloned the repository for development, edit your Claude desktop config (e.g. `~/Library/Application Support/Claude/claude_desktop_config.json`) or Cursor config (`~/.cursor/mcp.json`):
304400
305401
```json
306402
{

0 commit comments

Comments
 (0)