> ## Documentation index
> Fetch the complete documentation index at: https://tgcloud.docs7.io/llms.txt
> Ask it with GET https://tgcloud.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# التثبيت

> تثبيت tgcloud-mcp وربطه بعميل MCP

# التثبيت

يلزم **Node.js 20+**. واجهة المنصة نفسها تتطلب Node.js 18+.

<CardGroup cols={2}>
  <Card title="npm" icon="box" href="#npm">
    npm install -g tgcloud-mcp ثم tgcloud-mcp setup
  </Card>
  <Card title="أمر واحد" icon="terminal" href="#curl-bash">
    curl | bash — اللغة أولًا، ثم الشعار والمعالج
  </Card>
  <Card title="Docker" icon="layers" href="#docker">
    ghcr.io/sdamarketing/tgcloud-mcp عبر stdio بلا Node على الجهاز
  </Card>
  <Card title="إعداد العملاء" icon="plug" href="#clients">
    opencode وClaude Code وCursor وVS Code
  </Card>
</CardGroup>

## من npm {#npm}

```bash
npm install -g tgcloud-mcp
tgcloud-mcp setup
```

المعالج يكتب إعداد MCP ويسأل إن كنت تريد تثبيت [Agent Plugin](https://agent-plugins.org) (المجلد `agent-plugin/` في المستودع). النسخة توضع في `~/.tgcloud-mcp/agent-plugin`. يحصل Cursor على `~/.cursor/plugins/local/tgcloud`. يحصل VS Code على مدخل في `chat.pluginLocations`. يحمّل Codex وCopilot وKiro المجلد نفسه من واجهة الإضافات.

يبقى Claude Code وopencode على إعداد MCP. أضف المهارة هكذا:

```bash
npx skills add sdamarketing/tgcloud_mcp
```

## أمر واحد {#curl-bash}

```bash
curl -fsSL https://raw.githubusercontent.com/sdamarketing/tgcloud_mcp/main/install.sh | bash
```

ينسخ المستودع إلى `~/.tgcloud-mcp`، يبني، ثم يشغّل المعالج. إعادة التشغيل تُحدّث.
يسأل أولًا عن اللغة (English وРусский و中文 والعربية وDeutsch وFrançais؛
Enter تعني الإنجليزية، أو عيّن `TGCLOUD_MCP_LANG`). ثم يعرض شعارًا داخل إطار
(تدرّج أزرق في طرفية truecolor) ومؤشر دوران أثناء النسخ والتثبيت والبناء.
المعالج يتابع باللغة نفسها ويقرأ `/dev/tty`، لذلك يسأل حتى مع `curl | bash`.

## Docker {#docker}

```bash
docker run -i --rm ghcr.io/sdamarketing/tgcloud-mcp
```

## إعداد يدوي {#clients}

**opencode** (`~/.config/opencode/opencode.json`):

```json
{ "mcp": { "tgcloud": { "type": "local", "command": ["npx", "-y", "tgcloud-mcp"], "enabled": true } } }
```

**Claude Code / Cursor:**

```json
{ "mcpServers": { "tgcloud": { "command": "npx", "args": ["-y", "tgcloud-mcp"] } } }
```

**VS Code** (`mcp.json`):

```json
{ "servers": { "tgcloud": { "type": "stdio", "command": "npx", "args": ["-y", "tgcloud-mcp"] } } }
```

## متغيرات البيئة

| المتغير | الافتراضي | الغرض |
|---|---|---|
| `TGCLOUD_CLI` | `npx` | أمر تشغيل واجهة المنصة (يمكن أن يكون غلافًا لبروكسي) |
| `TGCLOUD_CLI_ARGS` | `tgcloud` | وسائط تسبق الأمر الفرعي |
| `TGCLOUD_TIMEOUT_MS` | `120000` | مهلة أمر واحد. `deploy` يمنح `npm run build` ما لا يقل عن 300000 مللي ثانية |
| `TGCLOUD_TOKEN` | — | CLI access token بدلًا من `tgcloud login` |
