gchat-claude-channel
Enables users to interact with their live Claude Code session from Google Chat by injecting messages and receiving replies, bridging terminal and mobile conversations.
README
gchat-claude-channel
Talk to your running Claude Code session from Google Chat — from your phone, from anywhere.
This is a Claude Code channel: messages you send in a Google Chat space are injected into the interactive Claude Code session you already have open, and the agent's replies come back to the same space. One live conversation, shared between your terminal and your phone.
Unlike bots that spawn a fresh headless claude -p per message, this pushes into your live session — full context, same working directory, same tools. It uses the official Claude Code Channels mechanism (a small MCP server that declares the claude/channel capability), plus Google's official Chat and Drive APIs. No scraping, no reverse engineering.
Status: Claude Code Channels is a research preview. The protocol may change between Claude Code versions. Requires Claude Code v2.1.80+.
⚠️ Security — read this first
By default the example supervisor runs the session with --permission-mode bypassPermissions, which means the agent executes commands coming from Google Chat with no per-action approval. That is powerful and dangerous. Before you deploy it:
- The allowlist is the only wall.
GCHAT_ALLOWED_SENDERSgates on the sender's Google user id, never the space. Only listed users' messages are injected; everyone else is silently ignored. Keep it to yourself (and people you fully trust). The server refuses to start with an empty allowlist. - Treat message content as untrusted. Anything you forward into the channel — a web page, a file, a screenshot — could contain hidden instructions (prompt injection). The channel labels senders as verified, but content is still data, not commands. Don't paste unknown content into a session that can run arbitrary code.
- Prefer a dedicated space with only you and the bot account in it, so there is no way for a third party to post.
- Want approvals instead of bypass? Remove
--permission-mode bypassPermissionsfrom the supervisor. The session will then prompt for each risky action — you'll need a channel permission relay to approve remotely, or the session blocks on local input.
This tool ships the bypass example because that is what makes a personal "phone as terminal" flow useful. If that trade-off isn't right for you, don't use bypass mode.
How it works
Google Chat space ──poll──► gchat MCP server ──inject──► your live Claude Code session
▲ (this repo) │
└────────────── reply tool ◄────────────────────────────── ┘
The MCP server polls the space for new messages, verifies the sender against the allowlist, and injects the text (plus any downloaded attachments) as a channel notification. The agent replies with the reply tool, which posts back to the space.
Requirements
- Claude Code v2.1.80+
- Node.js 18+
- A Google Chat space and Google credentials with the Chat + Drive read scopes
- Optional:
whisperandffmpegon PATH (for voice-note transcription and image conversion)
Setup
1. Install
git clone https://github.com/<you>/gchat-claude-channel
cd gchat-claude-channel
npm install
2. Configure
cp .env.example .env
# edit .env — see the comments in that file
You need three things in .env:
GCHAT_SPACE— the space to watch (e.g.spaces/AAAAAAAAAAA; it's in the space URL, or list spaces via the Chat API).GCHAT_ALLOWED_SENDERS— your Google user resource name(s), e.g.users/1234567890. You can find yours by reading one of your own messages via the Chat API (messages.list→sender.name).- Auth — either
GCHAT_TOKEN_COMMAND(a command that prints an access token, e.g.gcloud auth print-access-token) or an OAuth refresh token trio. The token needs thechat.messagesanddrive.readonlyscopes.
3. Register as an MCP server
claude mcp add --scope user gchat -- node "$(pwd)/server.js"
4. Run it
Interactive (loads the channel into your session):
claude --dangerously-load-development-channels server:gchat
(The dev flag is required because self-authored channels aren't on the approved allowlist during the research preview. You'll confirm a warning on first launch.)
Now post in your space — the message appears in the session, and the agent replies back to Chat.
Run it 24/7
See supervisor.sh.example and com.example.gchat-terminal.plist.example for a launchd setup (macOS) that keeps a tmux-hosted session alive, auto-answers the startup confirmations, and restarts on failure. Adapt the label/paths for your machine (or port to systemd on Linux).
Attachments
Images, PDFs, audio, and Drive files sent to the space are downloaded to an inbox; images/PDFs are handed to the agent to Read, Google native docs are exported to text, and audio is transcribed locally with whisper. Configure the whisper model/language via env (see .env.example).
Health checking
The server touches a heartbeat file (in GCHAT_STATE_DIR) on every successful poll. If polling stalls — e.g. the token expires — the heartbeat stops updating even while the process is still alive. Point your monitoring at the heartbeat's mtime to catch that "zombie" state, which a plain process check would miss.
Why this exists
At the time of writing, no channel shipped for Google Chat (the official channels cover Telegram, Discord, and iMessage), and multi-platform Claude Code gateways route to their own managed sessions rather than injecting into your live interactive one. This fills that gap for anyone living in Google Workspace.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。