From 20cb8d2f924e3e8db21903777c308892c30405ca Mon Sep 17 00:00:00 2001 From: leemour Date: Sun, 4 Oct 2026 23:45:29 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20ChatGPT=20and=20Claude=20in=20the=20bro?= =?UTF-8?q?wser=20=E2=80=94=20a=20guide=20to=20mcp=20--http=20with=20Tails?= =?UTF-8?q?cale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What users get, how it works with a diagram, whether it is safe, then setup step by step: Tailscale with its three console switches, starting the tunnel and the program, adding the connector in Claude and ChatGPT, first requests, stopping, revoking and troubleshooting. English, Russian, Spanish; tooltips for tunnel, Tailscale and connector; linked from getting started and the MCP guide, with a sidebar icon. Co-Authored-By: Claude Opus 5.5 (1M context) --- components/architecture-diagram.tsx | 61 ++++++++++++ content/docs/browser-apps.es.mdx | 146 ++++++++++++++++++++++++++++ content/docs/browser-apps.mdx | 146 ++++++++++++++++++++++++++++ content/docs/browser-apps.ru.mdx | 146 ++++++++++++++++++++++++++++ content/docs/index.es.mdx | 2 +- content/docs/index.mdx | 2 +- content/docs/index.ru.mdx | 2 +- content/docs/mcp.es.md | 1 + content/docs/mcp.md | 1 + content/docs/mcp.ru.md | 1 + content/docs/meta.es.json | 1 + content/docs/meta.json | 1 + content/docs/meta.ru.json | 1 + lib/doc-terms.ts | 60 ++++++++++++ lib/docs-sidebar-tree.tsx | 1 + 15 files changed, 569 insertions(+), 3 deletions(-) create mode 100644 content/docs/browser-apps.es.mdx create mode 100644 content/docs/browser-apps.mdx create mode 100644 content/docs/browser-apps.ru.mdx diff --git a/components/architecture-diagram.tsx b/components/architecture-diagram.tsx index 5ebe266..c13db7b 100644 --- a/components/architecture-diagram.tsx +++ b/components/architecture-diagram.tsx @@ -195,6 +195,67 @@ const diagrams: Record> = { ], }, }, + remote: { + en: { + title: "From ChatGPT or Claude to your messages", + rows: [ + { + boxes: [ + { name: "ChatGPT · Claude", note: "in your browser; their servers make the request", tone: "outside" }, + ], + }, + { boxes: [{ name: "Tailscale Funnel", note: "a public https address for one port of your computer" }] }, + { + boxes: [ + { + name: "tg / max mcp --http", + note: "on your computer; asks for the login code, then a form before each change", + tone: "tool", + }, + ], + }, + { boxes: [{ name: "Telegram · MAX", note: "your own account", tone: "outside" }] }, + ], + }, + ru: { + title: "От ChatGPT или Claude до вашей переписки", + rows: [ + { boxes: [{ name: "ChatGPT · Claude", note: "в браузере; запрос делают их серверы", tone: "outside" }] }, + { boxes: [{ name: "Tailscale Funnel", note: "публичный адрес https для одного порта компьютера" }] }, + { + boxes: [ + { + name: "tg / max mcp --http", + note: "на вашем компьютере; просит код входа, а перед каждым изменением — форму", + tone: "tool", + }, + ], + }, + { boxes: [{ name: "Telegram · MAX", note: "ваш собственный аккаунт", tone: "outside" }] }, + ], + }, + es: { + title: "De ChatGPT o Claude a tus mensajes", + rows: [ + { + boxes: [ + { name: "ChatGPT · Claude", note: "en tu navegador; la petición la hacen sus servidores", tone: "outside" }, + ], + }, + { boxes: [{ name: "Tailscale Funnel", note: "una dirección https pública para un puerto de tu ordenador" }] }, + { + boxes: [ + { + name: "tg / max mcp --http", + note: "en tu ordenador; pide el código de acceso y un formulario antes de cada cambio", + tone: "tool", + }, + ], + }, + { boxes: [{ name: "Telegram · MAX", note: "tu propia cuenta", tone: "outside" }] }, + ], + }, + }, layers: { en: { title: "Layers: each calls only the ones below", diff --git a/content/docs/browser-apps.es.mdx b/content/docs/browser-apps.es.mdx new file mode 100644 index 0000000..866c364 --- /dev/null +++ b/content/docs/browser-apps.es.mdx @@ -0,0 +1,146 @@ +--- +title: ChatGPT y Claude en el navegador +description: Usa tus conversaciones de Telegram o MAX desde ChatGPT o Claude en el navegador, sin un agente en tu ordenador, en el chat que ya usas. +--- + +Pregunta a ChatGPT o Claude por tus conversaciones de Telegram o MAX en la misma ventana de chat que ya usas: en el navegador, en el trabajo, en un portátil sin nada instalado. «¿Qué dijo Anna sobre el contrato?», «¿Qué preguntas del chat del equipo siguen sin respuesta?», «Prepara una respuesta para el casero». El asistente lee los mensajes que necesita y te pregunta antes de enviar nada. + +> **Disponible a partir de la próxima versión de `tg` y `max`.** Los pasos de abajo necesitan una versión con `mcp --http`; hasta que esté en npm, pide una versión de prueba. + +## Qué obtienes + +- **Tu asistente, tus mensajes.** ChatGPT o Claude buscan en tus chats, resumen lo no leído, reúnen contexto antes de una llamada y preparan respuestas: las mismas tareas que en [primeras tareas](./first-tasks.md), desde el navegador. +- **Nada se envía sin ti.** Cada cambio —un mensaje, una reacción, un borrado— muestra antes un formulario en el chat con lo que va a pasar exactamente. Lo permites con un clic, o no pasa nada. +- **Ningún servicio externo ve tus mensajes.** El programa funciona en tu ordenador y habla directamente con Telegram o MAX. ChatGPT o Claude reciben solo lo que piden en tu conversación. +- **Gratis, aparte de tu plan de ChatGPT o Claude.** El túnel que usamos, , es gratuito para uso personal. + +## Cómo funciona + +ChatGPT y Claude en el navegador no pueden ejecutar programas en tu ordenador. En cambio, llaman a herramientas de internet que añades como . Así que hacemos accesible el programa de tu ordenador, de forma segura y solo mientras tú quieras. + + + +1. **En tu ordenador**, `tg` (Telegram) o `max` (MAX) funciona en un modo especial, `mcp --http`, que habla el mismo lenguaje que usan los asistentes para sus herramientas. +2. **Un ** —Tailscale Funnel— da a ese único programa una dirección https pública, como `https://laptop.tail1234.ts.net`. Nada más de tu ordenador queda accesible, y no necesitas dominio ni configurar el router. +3. **En ChatGPT o Claude** añades esa dirección como conector. La primera vez, la app abre una página de acceso desde tu ordenador y escribes un **código de un solo uso** que solo muestra tu terminal. +4. **Luego solo conversas.** Cuando el asistente necesita mensajes, sus servidores llaman a tu ordenador por el túnel; tu ordenador pregunta a Telegram o MAX y responde. + +Tu ordenador tiene que estar encendido, con el programa en marcha. Para usarlo desde cualquier sitio, ejecútalo en un pequeño servidor siempre encendido: mira [el final de esta página](#tenerlo-siempre-en-marcha). + +## ¿Es seguro? + +- **Solo tú puedes conectar una app.** Cada acceso pide un código impreso en tu terminal. Sirve una vez y durante 10 minutos; cinco códigos erróneos bloquean la página de acceso hasta que reinicies. +- **La página de acceso dice adónde lleva.** Antes de escribir el código, comprueba que el acceso va a `claude.ai` o `chatgpt.com`. +- **Los cambios siempre preguntan.** Por esta conexión, cada escritura muestra un formulario, sea cual sea tu configuración. Si una app no puede mostrar esos formularios, solo puede leer. +- **Puedes cortar el acceso a todas.** `tg mcp --revoke` termina el acceso de todas las apps a la vez. El acceso también caduca a los 30 días si la app deja de usarlo. +- **Un acceso robado está limitado.** Las claves de acceso duran una hora y solo se renuevan a través de la app que inició sesión; el programa guarda solo sus huellas, nunca las claves. +- **Tus permisos siguen valiendo.** Un perfil de solo lectura sigue siéndolo; la [protección de envíos](./security.md#la-protección-de-envíos) y su límite por hora también funcionan aquí. + +Más detalles: [Seguridad](./security.md). + +## Qué necesitas + +- **`tg` o `max` instalado y con sesión iniciada.** Si aún no: [Instalación](./installation.mdx). +- **Un plan de ChatGPT o Claude que admita tus propios conectores:** + - **Claude:** todos los planes, incluido el gratuito — [conectores personalizados](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp). + - **ChatGPT:** Plus, Pro, Business, Enterprise o Education, en modo desarrollador — [modo desarrollador](https://developers.openai.com/api/docs/guides/developer-mode). +- **Una cuenta gratuita de Tailscale**: la creas en el paso 1. +- **Unos 15 minutos** la primera vez; después, dos comandos. + +## Paso 1 · Configurar Tailscale (una vez) + +1. **Crea una cuenta** en [tailscale.com](https://tailscale.com/): basta con entrar con Google, Microsoft o GitHub. +2. **Instala Tailscale en el ordenador donde funciona `tg` o `max`:** + - **macOS o Windows:** descarga la app desde [tailscale.com/download](https://tailscale.com/download), ábrela e inicia sesión. También usarás su comando `tailscale` en la terminal: mira la [guía de línea de comandos de Tailscale](https://tailscale.com/kb/1080/cli). + - **Linux:** en una terminal: + + ```sh + curl -fsSL https://tailscale.com/install.sh | sh + sudo tailscale up + sudo tailscale set --operator=$USER + ``` + + El segundo comando imprime un enlace: ábrelo e inicia sesión. El tercero te deja ejecutar `tailscale funnel` sin `sudo`. +3. **Activa tres interruptores** en la [consola de Tailscale](https://login.tailscale.com/admin), una vez: + 1. **DNS → MagicDNS → Enable.** Tu ordenador recibe un nombre como `laptop.tail1234.ts.net`. + 2. **DNS → HTTPS Certificates → Enable HTTPS.** La dirección recibe un certificado. El nombre de tu ordenador y el de tu red aparecen entonces en registros públicos de certificados — [por qué](https://tailscale.com/kb/1153/enabling-https). + 3. **Access controls → Funnel → Add Funnel to policy → Save.** Esto permite Funnel en tus dispositivos — [guía de Funnel](https://tailscale.com/kb/1223/funnel). + +## Paso 2 · Ponerlo en marcha + +Necesitas dos ventanas de terminal; mantén ambas abiertas mientras usas el asistente. + +**Primera ventana: el túnel.** + +```sh +tailscale funnel 8765 +``` + +Imprime tu dirección pública, `https://..ts.net`. La primera vez puede imprimir un enlace para aprobar Funnel: ábrelo. + +**Segunda ventana: el programa,** con tu dirección: + +```sh +tg mcp --http --public-url https://..ts.net +``` + +Para MAX, usa `max` en lugar de `tg`. El programa imprime un **código de acceso** como `K7QP-M2XD`, y uno nuevo después de cada acceso. + +## Paso 3 · Añadirlo a ChatGPT o Claude + +La dirección que hay que añadir es tu dirección de Tailscale con `/mcp` al final: `https://..ts.net/mcp`. + +**Claude** ([guía](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp)): + +1. Abre **Customize → Connectors**, pulsa **+ Add** y luego **Add custom connector**. +2. Ponle nombre, por ejemplo `Telegram`, y pega la dirección. Deja activado el inicio de sesión. +3. Pulsa **Add** y conéctalo: Claude abre la página de acceso desde tu ordenador. + +**ChatGPT** ([guía](https://developers.openai.com/api/docs/guides/developer-mode)): + +1. Abre **Settings → Security and login** y activa **Developer mode**. +2. Crea una app del modo desarrollador para tu servidor MCP con la dirección, como muestra la guía. +3. Conéctala: ChatGPT abre la página de acceso desde tu ordenador. + +**En la página de acceso:** comprueba la línea que dice adónde va el acceso —debe ser `claude.ai` o `chatgpt.com`—, escribe el código de la segunda ventana y pulsa **Allow**. + +## Paso 4 · Probarlo + +Empieza un chat nuevo con el conector activado y pregunta: + +```text prompt +Muéstrame mis cinco chats de Telegram más recientes y cuántos mensajes sin leer tiene cada uno. +``` + +Luego algo útil: + +- «Resume lo que me perdí en el chat del equipo desde ayer». +- «Busca dónde acordamos con Max la fecha de entrega». +- «Prepara una respuesta al último mensaje de Anna y enséñamela antes de enviarla». + +Cuando el asistente quiera enviar, aparece un formulario con el chat y el texto exacto. Permítelo, o recházalo y no se envía nada. [Cómo escribir peticiones](./prompting.md) explica cómo pedir bien. + +## Detener y revocar + +- **Detener por ahora:** Ctrl-C en las dos ventanas. Con el túnel cerrado, nada queda accesible. +- **La próxima vez:** los mismos dos comandos; las apps siguen conectadas durante 30 días. +- **Quitar el acceso a todas las apps:** + + ```sh + tg mcp --revoke + ``` + + Cada app tendrá que volver a entrar con un código nuevo. Si ya no quieres el conector, quítalo también en los ajustes de la app. + +## Si algo no funciona + +- **La app no puede conectar.** Abre `https://..ts.net/.well-known/oauth-protected-resource/mcp` en el navegador. Un JSON corto significa que el túnel funciona; si no, el túnel no está en marcha, Funnel no está activado (paso 1) o los puertos de las dos ventanas no coinciden. +- **«Too many wrong codes».** Cinco códigos erróneos bloquean la página de acceso hasta reiniciar el programa. Si no los escribiste tú, alguien encontró tu dirección: reinicia y piensa en cambiar el nombre del ordenador en Tailscale. +- **El código se rechaza por caducado.** Los códigos duran 10 minutos. Inténtalo de nuevo: la terminal mostrará uno nuevo. +- **Un cambio falla con «the owner did not confirm this».** La app no mostró el formulario o se rechazó. No se envió nada. +- **Conecta pero no muestra herramientas.** Ejecuta `tg chats list --limit 3` en una terminal; ahí se ve un acceso caducado, y [Inicio de sesión](./tg/sessions.md) explica cómo renovarlo. +- **El puerto está ocupado.** Elige otro con `--port 8766` y da al túnel el mismo número: `tailscale funnel 8766`. + +## Tenerlo siempre en marcha + +Los pasos de arriba usan tu propio ordenador, que debe seguir encendido. Para llegar a tus mensajes desde cualquier sitio —un móvil, un portátil prestado—, haz lo mismo en un pequeño servidor siempre encendido: instala allí `tg` o `max`, inicia sesión (`tg setup --agent none`), instala Tailscale y lanza los dos comandos. Por tu parte solo hará falta un navegador. diff --git a/content/docs/browser-apps.mdx b/content/docs/browser-apps.mdx new file mode 100644 index 0000000..cf18c53 --- /dev/null +++ b/content/docs/browser-apps.mdx @@ -0,0 +1,146 @@ +--- +title: ChatGPT and Claude in the browser +description: Use your Telegram or MAX conversations from ChatGPT or Claude in a browser — no agent on your computer to talk to, just the chat you already use. +--- + +Ask ChatGPT or Claude about your Telegram or MAX conversations, right in the chat window you already use — in a browser, at work, on a laptop with nothing installed. "What did Anna say about the contract?", "Which questions in the team chat are still unanswered?", "Draft a reply to the landlord." The assistant reads the messages it needs, and asks you before it sends anything. + +> **Available from the next release of `tg` and `max`.** The steps below need a version with `mcp --http`; until it is on npm, ask for a test build. + +## What you get + +- **Your own assistant, your own messages.** ChatGPT or Claude can search your chats, summarise unread messages, gather context before a call and prepare replies — the same tasks as in [first tasks](./first-tasks.md), from the browser. +- **Nothing sent without you.** Every change — a message, a reaction, a deletion — first shows you a form in the chat with exactly what will happen. You click to allow it, or nothing happens. +- **No third-party service sees your messages.** The program runs on your own computer and talks to Telegram or MAX directly. ChatGPT or Claude receive only what they ask for in your conversation. +- **Free, apart from your ChatGPT or Claude plan.** The tunnel we use, , is free for personal use. + +## How it works + +ChatGPT and Claude in a browser cannot run programs on your computer. Instead, they call tools on the internet that you add as a . So we make the program on your computer reachable — safely, and only while you want it. + + + +1. **On your computer**, `tg` (Telegram) or `max` (MAX) runs in a special mode, `mcp --http`, which speaks the same language the assistants use for tools. +2. **A ** — Tailscale Funnel — gives that one program a public https address, like `https://laptop.tail1234.ts.net`. Nothing else on your computer becomes reachable, and you do not need a domain or router settings. +3. **In ChatGPT or Claude** you add that address as a connector. The first time, the app opens a login page from your computer, and you type a **one-time code** that only your terminal shows. +4. **Then you just chat.** When the assistant needs messages, its servers call your computer through the tunnel; your computer asks Telegram or MAX and answers. + +Your computer has to be on, with the program running. To use it from anywhere, run it on a small always-on server instead — see [the end of this page](#running-it-all-the-time). + +## Is it safe? + +- **Only you can log an app in.** Each login needs a code printed in your terminal. It works once, for 10 minutes; five wrong codes lock the login page until you restart. +- **The login page tells you where it leads.** Before you type the code, check that it says the login goes to `claude.ai` or `chatgpt.com`. +- **Changes always ask.** Over this connection, every write shows a form, whatever your settings. If an app cannot show such forms, it can only read. +- **You can cut everyone off.** `tg mcp --revoke` ends every app's login at once. Logins also expire after 30 days unless the app keeps using them. +- **A stolen login is limited.** Access keys last an hour and renew only through the app that logged in; the program keeps only their fingerprints, never the keys themselves. +- **Your permission settings still apply.** A profile that may only read stays read-only; the [send guard](./security.md#the-send-guard) and its hourly limit work here too. + +More detail: [Security](./security.md). + +## What you need + +- **`tg` or `max` installed and logged in.** If not yet: [Installation](./installation.mdx). +- **A ChatGPT or Claude plan that allows your own connectors:** + - **Claude:** every plan, including Free — [custom connectors](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp). + - **ChatGPT:** Plus, Pro, Business, Enterprise or Education, in developer mode — [developer mode](https://developers.openai.com/api/docs/guides/developer-mode). +- **A free Tailscale account** — you create it in step 1. +- **About 15 minutes** the first time; afterwards, two commands. + +## Step 1 · Set up Tailscale (once) + +1. **Create an account** at [tailscale.com](https://tailscale.com/) — signing in with Google, Microsoft or GitHub is enough. +2. **Install Tailscale on the computer that runs `tg` or `max`:** + - **macOS or Windows:** download the app from [tailscale.com/download](https://tailscale.com/download), open it and sign in. You will also use its `tailscale` command in the terminal — see [Tailscale's command-line guide](https://tailscale.com/kb/1080/cli). + - **Linux:** in a terminal: + + ```sh + curl -fsSL https://tailscale.com/install.sh | sh + sudo tailscale up + sudo tailscale set --operator=$USER + ``` + + The second command prints a link: open it and sign in. The third lets you run `tailscale funnel` without `sudo`. +3. **Turn on three switches** in the [Tailscale admin console](https://login.tailscale.com/admin), once: + 1. **DNS → MagicDNS → Enable.** Your computer gets a name like `laptop.tail1234.ts.net`. + 2. **DNS → HTTPS Certificates → Enable HTTPS.** This gives the address a certificate. Your computer's name and network name then appear in public certificate logs — [why](https://tailscale.com/kb/1153/enabling-https). + 3. **Access controls → Funnel → Add Funnel to policy → Save.** This allows Funnel on your devices — [Funnel guide](https://tailscale.com/kb/1223/funnel). + +## Step 2 · Start it + +You need two terminal windows; keep both open while you use the assistant. + +**First window — the tunnel:** + +```sh +tailscale funnel 8765 +``` + +It prints your public address, `https://..ts.net`. The very first time it may print a link to approve Funnel — open it. + +**Second window — the program,** with your address: + +```sh +tg mcp --http --public-url https://..ts.net +``` + +For MAX, use `max` instead of `tg`. The program prints a **login code** such as `K7QP-M2XD`, and a new one after each login. + +## Step 3 · Add it to ChatGPT or Claude + +The address to add is your Tailscale address with `/mcp` at the end: `https://..ts.net/mcp`. + +**Claude** ([guide](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp)): + +1. Open **Customize → Connectors**, click **+ Add**, then **Add custom connector**. +2. Name it, for example `Telegram`, and paste the address. Keep sign-in on. +3. Click **Add**, then connect: Claude opens the login page from your computer. + +**ChatGPT** ([guide](https://developers.openai.com/api/docs/guides/developer-mode)): + +1. Open **Settings → Security and login** and turn on **Developer mode**. +2. Create a developer-mode app for your MCP server with the address, as the guide shows. +3. Connect it: ChatGPT opens the login page from your computer. + +**On the login page:** check the line that says where the login goes — it should be `claude.ai` or `chatgpt.com` — then type the code from the second terminal window and click **Allow**. + +## Step 4 · Try it + +Start a new chat with the connector turned on, and ask: + +```text prompt +List my five most recent Telegram chats with their unread counts. +``` + +Then something useful: + +- "Summarise what I missed in the team chat since yesterday." +- "Find where we agreed on the delivery date with Max." +- "Draft a reply to Anna's last message, and show it to me before sending." + +When the assistant wants to send, a form appears with the chat and the exact text. Allow it, or decline and nothing is sent. [Writing requests](./prompting.md) has more on asking well. + +## Stopping and revoking + +- **Stop for now:** press Ctrl-C in both windows. Nothing stays reachable once the tunnel is closed. +- **Next time:** run the same two commands again; the apps stay logged in for 30 days. +- **End every app's access:** + + ```sh + tg mcp --revoke + ``` + + Each app then has to log in again with a new code. Also remove the connector in the app's settings if you no longer want it. + +## Something does not work + +- **The app cannot connect.** Open `https://..ts.net/.well-known/oauth-protected-resource/mcp` in a browser. A short JSON document means the tunnel works; otherwise the tunnel is not running, Funnel is not enabled (step 1), or the port numbers in the two windows differ. +- **"Too many wrong codes."** Five wrong codes lock the login page until you restart the program. If you did not type them, someone found your address: restart, and consider renaming your computer in Tailscale. +- **The code is refused as expired.** Codes last 10 minutes. Try again: the terminal then shows a new code. +- **A change fails with "the owner did not confirm this".** The app did not show the form, or it was declined. Nothing was sent. +- **It connects but shows no tools.** Run `tg chats list --limit 3` in a terminal; an expired login shows there, and [Login](./tg/sessions.md) explains how to renew it. +- **The port is in use.** Pick another with `--port 8766`, and give the tunnel the same number: `tailscale funnel 8766`. + +## Running it all the time + +The steps above use your own computer, which must stay on. To reach your messages from anywhere — a phone, a borrowed laptop — run the same setup on a small always-on server: install `tg` or `max` there, log in (`tg setup --agent none`), install Tailscale, and start the two commands. Your side then needs only a browser. diff --git a/content/docs/browser-apps.ru.mdx b/content/docs/browser-apps.ru.mdx new file mode 100644 index 0000000..65c2705 --- /dev/null +++ b/content/docs/browser-apps.ru.mdx @@ -0,0 +1,146 @@ +--- +title: ChatGPT и Claude в браузере +description: Работайте с перепиской Telegram или MAX из ChatGPT или Claude в браузере — без агента на компьютере, прямо в привычном чате. +--- + +Спрашивайте ChatGPT или Claude о своей переписке в Telegram или MAX прямо в том окне чата, которым уже пользуетесь, — в браузере, на работе, на ноутбуке, где ничего не установлено. «Что Анна писала про договор?», «На какие вопросы в рабочем чате ещё никто не ответил?», «Набросай ответ арендодателю». Ассистент читает нужные сообщения и спрашивает вас, прежде чем что-то отправить. + +> **Доступно со следующего выпуска `tg` и `max`.** Для шагов ниже нужна версия с `mcp --http`; пока её нет в npm, попросите тестовую сборку. + +## Что вы получите + +- **Свой ассистент, своя переписка.** ChatGPT или Claude ищут по чатам, кратко пересказывают непрочитанное, собирают контекст перед звонком и готовят ответы — те же задачи, что в [первых задачах](./first-tasks.md), только из браузера. +- **Ничего не уходит без вас.** Каждое изменение — сообщение, реакция, удаление — сначала показывает форму в чате с тем, что именно произойдёт. Вы разрешаете кнопкой, или ничего не происходит. +- **Посторонний сервис переписку не видит.** Программа работает на вашем компьютере и обращается к Telegram или MAX напрямую. ChatGPT или Claude получают только то, что запрашивают в вашем разговоре. +- **Бесплатно, кроме тарифа ChatGPT или Claude.** Туннель, который мы используем, — — бесплатен для личного пользования. + +## Как это работает + +ChatGPT и Claude в браузере не могут запускать программы на вашем компьютере. Зато они вызывают инструменты в интернете, которые вы добавляете как . Поэтому мы делаем программу на вашем компьютере доступной — безопасно и только пока вы этого хотите. + + + +1. **На вашем компьютере** `tg` (Telegram) или `max` (MAX) работает в особом режиме, `mcp --http`, и говорит на том же языке , которым ассистенты пользуются для инструментов. +2. **** — Tailscale Funnel — даёт этой одной программе публичный адрес https вида `https://laptop.tail1234.ts.net`. Больше ничего на компьютере доступным не становится, а домен и настройка роутера не нужны. +3. **В ChatGPT или Claude** вы добавляете этот адрес как коннектор. В первый раз приложение откроет страницу входа с вашего компьютера, и вы введёте **одноразовый код**, который показывает только ваш терминал. +4. **Дальше просто общаетесь.** Когда ассистенту нужны сообщения, его серверы обращаются к вашему компьютеру через туннель; компьютер спрашивает Telegram или MAX и отвечает. + +Компьютер должен быть включён, а программа — запущена. Чтобы пользоваться откуда угодно, запустите всё на небольшом сервере, который работает всегда, — см. [конец страницы](#если-нужно-всегда). + +## Это безопасно? + +- **Подключить приложение можете только вы.** Каждый вход требует кода из вашего терминала. Код действует один раз и 10 минут; после пяти неверных кодов страница входа закрыта до перезапуска. +- **Страница входа говорит, куда он ведёт.** Прежде чем вводить код, проверьте, что вход уходит на `claude.ai` или `chatgpt.com`. +- **Изменения всегда спрашивают.** Через это подключение каждая запись показывает форму при любых настройках. Приложение, которое не умеет показывать такие формы, может только читать. +- **Можно отключить всех.** `tg mcp --revoke` завершает вход всех приложений сразу. Вход и сам истекает через 30 дней, если приложение им не пользуется. +- **Украденный вход ограничен.** Ключи доступа живут час и продлеваются только через то приложение, которое вошло; программа хранит только их отпечатки, а не сами ключи. +- **Ваши права в настройках действуют.** Профиль только для чтения остаётся таким; [защита от отправки](./security.md#защита-от-отправки) и лимит в час работают и здесь. + +Подробнее: [Безопасность](./security.md). + +## Что понадобится + +- **Установленный `tg` или `max` со входом в аккаунт.** Если ещё нет: [Установка](./installation.mdx). +- **Тариф ChatGPT или Claude со своими коннекторами:** + - **Claude:** любой, включая бесплатный, — [custom connectors](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp). + - **ChatGPT:** Plus, Pro, Business, Enterprise или Education, в режиме разработчика, — [developer mode](https://developers.openai.com/api/docs/guides/developer-mode). +- **Бесплатный аккаунт Tailscale** — его вы создадите в шаге 1. +- **Около 15 минут** в первый раз; дальше — две команды. + +## Шаг 1 · Настроить Tailscale (один раз) + +1. **Создайте аккаунт** на [tailscale.com](https://tailscale.com/) — достаточно войти через Google, Microsoft или GitHub. +2. **Установите Tailscale на компьютер, где работает `tg` или `max`:** + - **macOS или Windows:** скачайте приложение с [tailscale.com/download](https://tailscale.com/download), откройте и войдите. Вам также понадобится его команда `tailscale` в терминале — см. [руководство Tailscale по командной строке](https://tailscale.com/kb/1080/cli). + - **Linux:** в терминале: + + ```sh + curl -fsSL https://tailscale.com/install.sh | sh + sudo tailscale up + sudo tailscale set --operator=$USER + ``` + + Вторая команда печатает ссылку: откройте её и войдите. Третья позволяет запускать `tailscale funnel` без `sudo`. +3. **Включите три переключателя** в [консоли Tailscale](https://login.tailscale.com/admin), один раз: + 1. **DNS → MagicDNS → Enable.** Компьютер получит имя вида `laptop.tail1234.ts.net`. + 2. **DNS → HTTPS Certificates → Enable HTTPS.** Адрес получит сертификат. Имя компьютера и имя сети после этого попадают в открытые журналы сертификатов — [почему](https://tailscale.com/kb/1153/enabling-https). + 3. **Access controls → Funnel → Add Funnel to policy → Save.** Это разрешает Funnel на ваших устройствах — [руководство по Funnel](https://tailscale.com/kb/1223/funnel). + +## Шаг 2 · Запустить + +Нужны два окна терминала; держите оба открытыми, пока пользуетесь ассистентом. + +**Первое окно — туннель:** + +```sh +tailscale funnel 8765 +``` + +Команда печатает ваш публичный адрес, `https://<компьютер>.<сеть>.ts.net`. В самый первый раз она может напечатать ссылку, чтобы разрешить Funnel, — откройте её. + +**Второе окно — программа,** с вашим адресом: + +```sh +tg mcp --http --public-url https://<компьютер>.<сеть>.ts.net +``` + +Для MAX вместо `tg` — `max`. Программа печатает **код входа** вида `K7QP-M2XD`, и новый — после каждого входа. + +## Шаг 3 · Добавить в ChatGPT или Claude + +Адрес для добавления — ваш адрес Tailscale с `/mcp` на конце: `https://<компьютер>.<сеть>.ts.net/mcp`. + +**Claude** ([инструкция](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp)): + +1. Откройте **Customize → Connectors**, нажмите **+ Add**, затем **Add custom connector**. +2. Задайте имя, например `Telegram`, и вставьте адрес. Вход оставьте включённым. +3. Нажмите **Add**, затем подключите: Claude откроет страницу входа с вашего компьютера. + +**ChatGPT** ([инструкция](https://developers.openai.com/api/docs/guides/developer-mode)): + +1. Откройте **Settings → Security and login** и включите **Developer mode**. +2. Создайте приложение режима разработчика для вашего MCP-сервера с этим адресом, как показано в инструкции. +3. Подключите его: ChatGPT откроет страницу входа с вашего компьютера. + +**На странице входа:** проверьте строку о том, куда уходит вход, — там должно быть `claude.ai` или `chatgpt.com`, — введите код из второго окна терминала и нажмите **Allow**. + +## Шаг 4 · Попробовать + +Начните новый чат с включённым коннектором и спросите: + +```text prompt +Покажи пять последних чатов в Telegram и сколько в них непрочитанного. +``` + +Потом что-нибудь полезное: + +- «Кратко расскажи, что я пропустил в рабочем чате со вчерашнего дня». +- «Найди, где мы с Максом договорились о дате поставки». +- «Набросай ответ на последнее сообщение Анны и покажи мне перед отправкой». + +Когда ассистент захочет отправить, появится форма с чатом и точным текстом. Разрешите или отклоните — тогда ничего не уйдёт. Как формулировать запросы — в разделе [Как писать запросы](./prompting.md). + +## Остановить и отозвать + +- **Остановить сейчас:** Ctrl-C в обоих окнах. Когда туннель закрыт, снаружи ничего не доступно. +- **В следующий раз:** снова те же две команды; приложения остаются подключёнными 30 дней. +- **Закрыть доступ всем приложениям:** + + ```sh + tg mcp --revoke + ``` + + Каждому приложению придётся войти заново с новым кодом. Если коннектор больше не нужен, удалите его и в настройках приложения. + +## Если что-то не работает + +- **Приложение не может подключиться.** Откройте в браузере `https://<компьютер>.<сеть>.ts.net/.well-known/oauth-protected-resource/mcp`. Короткий JSON значит, что туннель работает; иначе туннель не запущен, Funnel не включён (шаг 1) или номера портов в двух окнах разные. +- **«Too many wrong codes».** После пяти неверных кодов страница входа закрыта до перезапуска программы. Если вводили не вы, кто-то нашёл ваш адрес: перезапустите и подумайте о новом имени компьютера в Tailscale. +- **Код отклонён как истёкший.** Код действует 10 минут. Попробуйте снова: терминал покажет новый. +- **Изменение падает с «the owner did not confirm this».** Приложение не показало форму, или её отклонили. Ничего не отправлено. +- **Подключилось, но инструментов нет.** Выполните в терминале `tg chats list --limit 3`; истёкший вход будет виден там, а как его обновить — в разделе [Вход](./tg/sessions.md). +- **Порт занят.** Выберите другой через `--port 8766` и дайте туннелю тот же номер: `tailscale funnel 8766`. + +## Если нужно всегда + +Шаги выше используют ваш компьютер, и он должен быть включён. Чтобы добираться до переписки откуда угодно — с телефона, с чужого ноутбука, — запустите то же самое на небольшом сервере, который работает всегда: установите там `tg` или `max`, войдите (`tg setup --agent none`), установите Tailscale и запустите две команды. С вашей стороны тогда нужен только браузер. diff --git a/content/docs/index.es.mdx b/content/docs/index.es.mdx index 7183be8..bdfd691 100644 --- a/content/docs/index.es.mdx +++ b/content/docs/index.es.mdx @@ -50,7 +50,7 @@ Más adelante encontrarás tres términos en la documentación: - **** es un programa que se ejecuta con comandos de texto. El agente puede ejecutarlos por ti; no necesitas aprenderlos para empezar. - **** es un archivo de instrucciones que enseña al agente a usar el programa y sus comandos. -- **** conecta el programa a un agente que no ejecuta comandos directamente, como Claude Desktop. Para ese caso, usa la [guía de conexión por MCP](./mcp.md). +- **** conecta el programa a un agente que no ejecuta comandos directamente, como Claude Desktop. Para ese caso, usa la [guía de conexión por MCP](./mcp.md). Para usar tus mensajes desde ChatGPT o Claude en el navegador, mira [ChatGPT y Claude en el navegador](./browser-apps.mdx). Leer mensajes no los marca como leídos. Enviar una respuesta o modificar un mensaje es una acción aparte que le pides al agente. diff --git a/content/docs/index.mdx b/content/docs/index.mdx index 3f46694..f5f73a0 100644 --- a/content/docs/index.mdx +++ b/content/docs/index.mdx @@ -50,7 +50,7 @@ You will encounter three terms later in the documentation: - **** is a program you run with text commands. Your agent can run them for you; you do not need to learn them to get started. - **** is an instruction file that teaches your agent how to use the program and its commands. -- **** connects the program to an agent that does not run commands directly, such as Claude Desktop. Use the [MCP connection guide](./mcp.md) for that setup. +- **** connects the program to an agent that does not run commands directly, such as Claude Desktop. Use the [MCP connection guide](./mcp.md) for that setup. To use your messages from ChatGPT or Claude in a browser, see [ChatGPT and Claude in the browser](./browser-apps.mdx). Reading messages does not mark them as read. Sending a reply or changing a message is a separate action you ask your agent to perform. diff --git a/content/docs/index.ru.mdx b/content/docs/index.ru.mdx index e3336ca..8c0a1bf 100644 --- a/content/docs/index.ru.mdx +++ b/content/docs/index.ru.mdx @@ -50,7 +50,7 @@ description: "Подключите своего ИИ-помощника к пе - **** — программа, которую запускают текстовыми командами. Агент может выполнять эти команды за вас; для начала учить их не нужно. - **** — инструкция, которая учит агента пользоваться программой и её командами. -- **** — способ подключить программу к агенту, который не запускает команды напрямую, например Claude Desktop. Для него используйте [инструкцию подключения по MCP](./mcp.md). +- **** — способ подключить программу к агенту, который не запускает команды напрямую, например Claude Desktop. Для него используйте [инструкцию подключения по MCP](./mcp.md). Чтобы работать с перепиской из ChatGPT или Claude в браузере, см. [ChatGPT и Claude в браузере](./browser-apps.mdx). Чтение сообщений не отмечает их прочитанными. Отправка ответа или изменение сообщения — отдельное действие, которое вы поручаете агенту. diff --git a/content/docs/mcp.es.md b/content/docs/mcp.es.md index 9a5fece..51f4f76 100644 --- a/content/docs/mcp.es.md +++ b/content/docs/mcp.es.md @@ -16,6 +16,7 @@ nombres, parámetros y resultados estructurados. El servidor viene incluido en ` | CLI | Comandos de terminal con resultados JSON | Tu agente ya tiene una terminal local | | Skill + CLI | Instrucciones de comandos y flujos de trabajo | Usas Codex, Cursor Agent, Claude Code, Gemini CLI o Hermes | | MCP | Herramientas con parámetros directamente en el cliente | Usas Claude Desktop o prefieres su interfaz de herramientas | +| MCP por HTTP | Las mismas herramientas para ChatGPT o Claude en el navegador, tras tu propio túnel | Chateas en el navegador — [ChatGPT y Claude en el navegador](./browser-apps.mdx) | | Markdown | Explicaciones y referencia de comandos | El agente necesita consultar cómo funciona algo | Con una terminal, empieza con [un skill](./agents.md). MCP es opcional y respeta los mismos diff --git a/content/docs/mcp.md b/content/docs/mcp.md index 76b4ea3..ef2e636 100644 --- a/content/docs/mcp.md +++ b/content/docs/mcp.md @@ -16,6 +16,7 @@ parameters and structured results. The MCP server ships inside `tg` and `max`. | CLI | Commands in a terminal, with JSON results | Your agent already has a local terminal | | Skill + CLI | Instructions for using those commands and workflows | You use Codex, Cursor Agent, Claude Code, Gemini CLI or Hermes | | MCP | Named tools and their parameters directly inside your client | You use Claude Desktop, or prefer the client's tool interface | +| MCP over HTTP | The same tools for ChatGPT or Claude in a browser, behind your own tunnel | You chat in a browser — [ChatGPT and Claude in the browser](./browser-apps.mdx) | | Markdown docs | A readable explanation and command reference | You want the agent to look up how something works | For an agent with a terminal, start with [a skill](./agents.md). MCP is optional and follows the diff --git a/content/docs/mcp.ru.md b/content/docs/mcp.ru.md index fb8fc35..2ca16a0 100644 --- a/content/docs/mcp.ru.md +++ b/content/docs/mcp.ru.md @@ -16,6 +16,7 @@ description: "Что даёт MCP, как подключить своего аг | CLI | Команды в терминале с JSON-ответами | У агента уже есть локальный терминал | | Skill + CLI | Инструкцию по командам и сценариям | Используете Codex, Cursor Agent, Claude Code, Gemini CLI или Hermes | | MCP | Инструменты и их параметры прямо в клиенте | Используете Claude Desktop или предпочитаете интерфейс инструментов | +| MCP по HTTP | Те же инструменты для ChatGPT или Claude в браузере, за вашим туннелем | Общаетесь в браузере — [ChatGPT и Claude в браузере](./browser-apps.mdx) | | Markdown-доки | Понятное описание и справку по командам | Агенту нужно узнать, как что-то работает | Для агента с терминалом начните со [skill](./agents.md). MCP необязателен и использует те же diff --git a/content/docs/meta.es.json b/content/docs/meta.es.json index 11d187c..fb3936f 100644 --- a/content/docs/meta.es.json +++ b/content/docs/meta.es.json @@ -9,6 +9,7 @@ "search-architecture", "search-playground", "mcp", + "browser-apps", "bot-api", "security", "---Mensajeros---", diff --git a/content/docs/meta.json b/content/docs/meta.json index 5c0ea46..1bd8755 100644 --- a/content/docs/meta.json +++ b/content/docs/meta.json @@ -9,6 +9,7 @@ "search-architecture", "search-playground", "mcp", + "browser-apps", "bot-api", "security", "---Messengers---", diff --git a/content/docs/meta.ru.json b/content/docs/meta.ru.json index 42c1618..a2e0e5c 100644 --- a/content/docs/meta.ru.json +++ b/content/docs/meta.ru.json @@ -9,6 +9,7 @@ "search-architecture", "search-playground", "mcp", + "browser-apps", "bot-api", "security", "---Мессенджеры---", diff --git a/lib/doc-terms.ts b/lib/doc-terms.ts index da7d667..40fc4c6 100644 --- a/lib/doc-terms.ts +++ b/lib/doc-terms.ts @@ -159,6 +159,66 @@ const terms = { page: "tg/sessions", }, }, + tunnel: { + en: { + title: "Tunnel", + description: + "A service that gives a program on your computer a public https address, so apps on the internet can reach it while your computer stays behind your home router. Nothing else on your computer becomes reachable. We use Tailscale Funnel; it closes when you stop it.", + page: "browser-apps", + }, + ru: { + title: "Туннель", + description: + "Сервис, который даёт программе на вашем компьютере публичный адрес https, чтобы приложения из интернета могли до неё достучаться, хотя компьютер остаётся за домашним роутером. Больше ничего на компьютере доступным не становится. Мы используем Tailscale Funnel; он закрывается, когда вы его останавливаете.", + page: "browser-apps", + }, + es: { + title: "Túnel", + description: + "Un servicio que da a un programa de tu ordenador una dirección https pública, para que las apps de internet lleguen a él aunque tu ordenador siga detrás del router. Nada más de tu ordenador queda accesible. Usamos Tailscale Funnel; se cierra cuando lo detienes.", + page: "browser-apps", + }, + }, + tailscale: { + en: { + title: "Tailscale", + description: + "A free service that connects your devices into a private network. Its Funnel feature publishes one port of your computer at an address like https://laptop.tail1234.ts.net, with a certificate, so no domain or router setup is needed.", + page: "browser-apps", + }, + ru: { + title: "Tailscale", + description: + "Бесплатный сервис, который объединяет ваши устройства в частную сеть. Его функция Funnel открывает один порт компьютера по адресу вида https://laptop.tail1234.ts.net, с сертификатом, поэтому ни домен, ни настройка роутера не нужны.", + page: "browser-apps", + }, + es: { + title: "Tailscale", + description: + "Un servicio gratuito que une tus dispositivos en una red privada. Su función Funnel publica un puerto de tu ordenador en una dirección como https://laptop.tail1234.ts.net, con certificado, así que no hace falta dominio ni configurar el router.", + page: "browser-apps", + }, + }, + connector: { + en: { + title: "Connector", + description: + "What Claude and ChatGPT call a tool you add from outside: you give the app an address, sign in once, and the assistant can then call that tool in your chats. ChatGPT calls it an app in developer mode.", + page: "browser-apps", + }, + ru: { + title: "Коннектор", + description: + "Так Claude и ChatGPT называют инструмент, который вы добавляете извне: даёте приложению адрес, один раз входите, и ассистент может пользоваться этим инструментом в ваших чатах. В ChatGPT это приложение в режиме разработчика.", + page: "browser-apps", + }, + es: { + title: "Conector", + description: + "Así llaman Claude y ChatGPT a una herramienta que añades desde fuera: le das a la app una dirección, inicias sesión una vez y el asistente puede usarla en tus chats. En ChatGPT es una app del modo desarrollador.", + page: "browser-apps", + }, + }, } export type DocTermId = keyof typeof terms diff --git a/lib/docs-sidebar-tree.tsx b/lib/docs-sidebar-tree.tsx index 8b1935d..ac74576 100644 --- a/lib/docs-sidebar-tree.tsx +++ b/lib/docs-sidebar-tree.tsx @@ -33,6 +33,7 @@ const icons = { "search-architecture": Network, "search-playground": FlaskConical, "bot-api": Webhook, + "browser-apps": Globe, usage: MessageSquare, sessions: Users, archive: Archive,