AgentComms 公司
      
一个MCP插件,为AI编码助手提供语音通话和聊天消息。开始一项任务,走开。当人工智能完成、卡住或需要做出决定时,你的手机会响。或者通过Discord、Slack、Telegram、WhatsApp、Gmail或IRC收到通知。
支持: Claude Code、AWS Kiro CLI、Gemini CLI
采用plexusone堆栈构建 -在Go中展示了完整的语音和聊天AI架构。
特性
- 📞 打电话:通过Twilio与您的手机进行真正的语音通话——适用于智能手机、智能手表、固定电话或VoIP
- 💬 聊天消息:通过Discord、Slack、Telegram、WhatsApp或IRC发送消息
- 🔄 多回合对话:来回讨论,而不仅仅是单向通知
- ⚡ 智能触发器:当你被困或工作完成时,建议打电话/发消息的钩子
- 🔀 混搭:根据您的需要使用语音、聊天或两者兼而有之
- 🧠 并行执行:AI在等待您的响应的同时继续工作——搜索代码、运行测试、准备下一步
运作原理
AgentComms提供 双向通信 人类和人工智能代理之间:
AgentComms
┌────────────────────┐
│ │
┌──────────┐ │ ┌────────────┐ │ ┌──────────┐
│ AI Agent │ ────▶│ │ MCP Server │ │◀──── │ Human │
│ Claude / │ │ │ (OUTBOUND) │ │ │ (Discord │
│ Codex │ ◀────│ └────────────┘ │────▶ │ Phone) │
└──────────┘ │ │ └──────────┘
│ ┌────────────┐ │
│ │ Daemon │ │
│ │ (INBOUND) │ │
│ └────────────┘ │
│ │ │
│ ┌────┴─────┐ │
│ │ tmux │ │
│ │ pane │ │
│ └──────────┘ │
│ │
└────────────────────┘两种通信模式:
| 模式 | 方向 | 用例 |
|---|---|---|
| 出站 | 代理商→ 人工智能需要输入,报告完成情况,升级拦截器 | |
| 入站 | 人类→ Agent | 中断Agent,发送指令,协调多个Agent |
OUTBOUND(MCP服务器)
- AI需要输入 → 拨打电话或发送聊天信息
- 你回答 → 语音转录,聊天直接阅读
- AI继续 → 使用您的输入来完成任务
INBOUND(守护进程)-预览
- 您发送了一条消息 → 键入Discord频道或发送短信
- 守护进程接收 → 通过tmux路由到正确的代理
- 特工看到了 → 消息出现在代理的终端中
建筑
┌─────────────────────────────────────────────────────────────────────────────┐
│ AgentComms │
├─────────────────────────────────────────────────────────────────────────────┤
│ OUTBOUND (MCP Server) - Agent → Human │
│ ├── Voice Tools - initiate_call, continue_call, speak_to_user, end_call │
│ ├── Chat Tools - send_message, list_channels, get_messages │
│ ├── Voice Manager - Orchestrates calls via omnivoice │
│ └── Chat Manager - Routes messages via omnichat │
├─────────────────────────────────────────────────────────────────────────────┤
│ INBOUND (Daemon) - Human → Agent │
│ ├── Router - Actor-style event dispatcher (goroutine per agent) │
│ ├── AgentBridge - Adapters for tmux, process, etc. │
│ ├── Event Store - SQLite database via Ent ORM │
│ └── Transports - Discord, Twilio (receives human messages) │
├─────────────────────────────────────────────────────────────────────────────┤
│ Shared Infrastructure │
│ ├── omnivoice - Voice abstraction (TTS, STT, Transport, CallSystem) │
│ ├── omnichat - Chat abstraction (Discord, Telegram, WhatsApp, IRC) │
│ ├── mcpkit - MCP server with ngrok integration │
│ └── Ent - Database ORM with SQLite/PostgreSQL support │
├─────────────────────────────────────────────────────────────────────────────┤
│ Provider Implementations │
│ ├── Voice - ElevenLabs, Deepgram, OpenAI, Twilio │
│ └── Chat - Discord, Slack, Telegram, WhatsApp, Gmail, IRC │
└─────────────────────────────────────────────────────────────────────────────┘plexusone堆栈
该项目演示了plexusone语音和聊天AI堆栈:
| 包 | 角色 | 描述 |
|---|---|---|
| 全语音 | 语音摘要 | 电池包括TTS/STT,具有基于注册表的提供商查找功能 |
| 全聊天 | 聊天摘要 | 与提供商无关的聊天消息界面 |
| 十一个实验室 | 语音提供商 | ElevenLabs流媒体TTS和STT |
| 全语音深度图 | 语音提供商 | Deepgram流媒体TTS和STT |
| 全语音openai | 语音提供商 | OpenAI TTS和STT |
| omnivoice twilio | 电话提供商 | Twilio传输和呼叫系统 |
| 麦普基特 | 服务器 | MCP服务器运行时,具有ngrok和多种传输模式 |
安装
先决条件
- 转到1.25+
- 语音:Twilio账户+ngrok账户
- 聊天:Discord/Slack/Telegram机器人令牌(可选)
构建
cd /path/to/agentcomms
go mod tidy
go build -o agentcomms ./cmd/agentcomms配置
AgentComms使用一个统一的JSON配置文件,该文件结合了所有设置。
快速设置
# Generate configuration file
./agentcomms config init
# Or generate minimal config (chat only, no voice)
./agentcomms config init --minimal
# Set environment variables for secrets
export DISCORD_TOKEN=your_discord_bot_token
export SLACK_BOT_TOKEN=xoxb-your-bot-token
export SLACK_APP_TOKEN=xapp-your-app-token
export TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export TWILIO_AUTH_TOKEN=your_auth_token
export ELEVENLABS_API_KEY=your_elevenlabs_key
export DEEPGRAM_API_KEY=your_deepgram_key
export NGROK_AUTHTOKEN=your_ngrok_authtoken
# Validate configuration
./agentcomms config validate配置文件
配置文件位于 ~/.agentcomms/config.json 支持环境变量替换:
{
"version": "1",
"server": { "port": 3333 },
"agents": [
{ "id": "claude", "type": "tmux", "tmux_session": "claude-code" }
],
"voice": {
"phone": {
"account_sid": "${TWILIO_ACCOUNT_SID}",
"auth_token": "${TWILIO_AUTH_TOKEN}",
"number": "+15551234567",
"user_number": "+15559876543"
},
"tts": { "provider": "elevenlabs", "api_key": "${ELEVENLABS_API_KEY}" },
"stt": { "provider": "deepgram", "api_key": "${DEEPGRAM_API_KEY}" },
"ngrok": { "auth_token": "${NGROK_AUTHTOKEN}" }
},
"chat": {
"discord": { "enabled": true, "token": "${DISCORD_TOKEN}" },
"channels": [
{ "channel_id": "discord:YOUR_CHANNEL_ID", "agent_id": "claude" }
]
}
}看 配置指南 获取完整文档。
用法
命令
AgentComms提供两个主要命令:
# Run MCP server (OUTBOUND - spawned by AI assistant)
./agentcomms serve
# Run daemon (INBOUND - background service for human messages)
./agentcomms daemon跑步 ./agentcomms 如果没有子命令,则默认为 serve 为了向后兼容性。
运行MCP服务器(OUTBOUND)
./agentcomms serve输出:
Starting agentcomms MCP server...
Using plexusone stack:
- omnivoice (voice abstraction)
- omnichat (chat abstraction)
- mcpkit (MCP server)
Voice providers: tts=elevenlabs stt=deepgram
Chat providers: [discord telegram]
MCP server ready
Local: http://localhost:3333/mcp
Public: https://abc123.ngrok.io/mcp运行守护进程(INBOUND)-预览
该守护进程支持人与代理之间的通信。它作为后台服务运行,并将消息从Discord/Twilio路由到在tmux中运行的代理。
./agentcomms daemon输出:
INFO starting daemon data_dir=/Users/you/.agentcomms socket=/Users/you/.agentcomms/daemon.sock
INFO database initialized path=/Users/you/.agentcomms/data.db
INFO router initialized
INFO daemon started数据存储: ~/.agentcomms/
config.json-统一配置文件data.db-SQLite数据库(事件、代理)daemon.sock-用于CLI/API的Unix套接字
Daemon CLI命令
守护进程运行后,使用以下CLI命令与之交互:
# Check daemon status
./agentcomms status
# List configured agents
./agentcomms agents
# Send a message to an agent (appears in tmux pane)
./agentcomms send "Your message here"
# Send an interrupt (Ctrl-C) to an agent
./agentcomms interrupt
# View recent events for an agent
./agentcomms events --limit 20
# Send a reply to a chat channel (outbound from agent)
./agentcomms reply discord:123456789 "Task completed!"
# List configured chat channels
./agentcomms channels
# Validate configuration
./agentcomms config validate
# Show current configuration
./agentcomms config show守护程序配置
生成并编辑配置:
# Generate config file
./agentcomms config init
# Edit ~/.agentcomms/config.json with your settings
# Validate configuration
./agentcomms config validate请参阅 配置指南 了解全部细节。
多工具支持
agentcomms支持多种AI编码助手。为您的首选工具生成配置文件:
# Generate for a specific tool
go run ./cmd/generate-plugin claude . # Claude Code
go run ./cmd/generate-plugin kiro . # AWS Kiro CLI
go run ./cmd/generate-plugin gemini . # Gemini CLI
# Generate for all tools
go run ./cmd/generate-plugin all ./pluginsClaude代码集成
选项1:使用生成的插件文件
go run ./cmd/generate-plugin claude .这将创建:
.claude-plugin/plugin.json-插件清单skills/phone-input/SKILL.md-语音通话技巧skills/chat-messaging/SKILL.md-聊天消息技巧commands/call.md-/call斜杠命令commands/message.md-/message斜杠命令.claude/settings.json-生命周期挂钩
选项2:手动MCP配置
增添 ~/.claude/settings.json 或 .claude/settings.json:
{
"mcpServers": {
"agentcomms": {
"command": "/path/to/agentcomms",
"env": {
"TWILIO_ACCOUNT_SID": "ACxxx",
"TWILIO_AUTH_TOKEN": "xxx",
"NGROK_AUTHTOKEN": "xxx",
"DISCORD_TOKEN": "xxx",
"ELEVENLABS_API_KEY": "xxx",
"DEEPGRAM_API_KEY": "xxx",
"AGENTCOMMS_AGENT_ID": "claude"
}
}
}
}MCP工具
语音工具
initiate_call
向用户发起新呼叫。
{
"message": "Hey! I finished implementing the feature. Want me to walk you through it?"
}退货:
{
"call_id": "call-1-1234567890",
"response": "Sure, go ahead and explain what you built."
}继续通话
用另一条消息继续当前通话。
{
"call_id": "call-1-1234567890",
"message": "I added authentication using JWT. Should I also add refresh tokens?"
}speak_to_user
无需等待回复即可发言(适用于状态更新)。
{
"call_id": "call-1-1234567890",
"message": "Let me search for that in the codebase. Give me a moment..."
}end_call
以可选的再见消息结束通话。
{
"call_id": "call-1-1234567890",
"message": "Perfect! I'll get started on that. Talk soon!"
}聊天工具
send_message
向聊天频道发送消息。
{
"provider": "discord",
"chat_id": "123456789",
"message": "I've finished the PR! Here's the link: https://github.com/..."
}list_channels
列出可用的聊天频道及其状态。
{}退货:
{
"channels": [
{"provider_name": "discord", "status": "connected"},
{"provider_name": "telegram", "status": "connected"}
]
}获取消息
从聊天对话中获取最新消息。
{
"provider": "telegram",
"chat_id": "987654321",
"limit": 5
}入站工具
这些工具允许Claude Code轮询人类通过守护进程发送的消息。
check_message
检查人类通过聊天发送到此代理的新消息。
{
"agent_id": "claude",
"limit": 10
}退货:
{
"messages": [
{
"id": "evt_01ABC123",
"channel_id": "discord:123456789",
"provider": "discord",
"text": "Hey, can you also add unit tests?",
"timestamp": "2024-01-15T10:30:00Z",
"type": "human_message"
}
],
"agent_id": "claude",
"has_more": false
}获取代理事件
获取代理的所有最近事件(消息、中断、状态更改)。
{
"agent_id": "claude",
"since_id": "evt_01ABC123",
"limit": 20
}守护进程状态
检查agentcomms守护进程是否正在运行。
{}退货:
{
"running": true,
"started_at": "2024-01-15T09:00:00Z",
"agents": 1,
"providers": ["discord", "telegram"]
}多代理工具
这些工具使代理之间能够进行通信,以进行任务委托和协调。
列表_代理
列出所有可用的代理及其状态。
{
"include_offline": false
}退货:
{
"agents": [
{"id": "backend", "type": "tmux", "status": "online", "target": "tmux:dev:0"},
{"id": "frontend", "type": "tmux", "status": "online", "target": "tmux:dev:1"}
]
}send_agent_消息
向另一个代理发送消息。
{
"to_agent_id": "backend",
"message": "Can you help me with the API implementation?"
}消息以源前缀到达目标代理:
[from: frontend] Can you help me with the API implementation?用例
电话是以下情况的理想选择:
- 报告重大任务完成情况
- 被阻止时请求紧急澄清
- 讨论复杂决策
- 浏览代码更改
- 需要来回执行的多步骤流程
聊天消息非常适合:
- 异步状态更新
- 共享链接、代码或格式化内容
- 非紧急通知
- 后续总结
发展
项目结构
agentcomms/
├── cmd/
│ └── agentcomms/
│ ├── main.go # CLI entry point (serve, daemon)
│ └── commands.go # CLI commands (send, interrupt, reply, etc.)
├── internal/ # INBOUND infrastructure
│ ├── daemon/
│ │ ├── daemon.go # Background daemon service
│ │ ├── server.go # Unix socket server
│ │ ├── client.go # Client library for IPC
│ │ ├── protocol.go # JSON-RPC style protocol
│ │ └── config.go # Daemon configuration (YAML)
│ ├── router/
│ │ ├── router.go # Event dispatcher
│ │ └── actor.go # Per-agent actor (goroutine)
│ ├── bridge/
│ │ ├── adapter.go # Agent adapter interface
│ │ └── tmux.go # tmux adapter
│ ├── transport/
│ │ └── chat.go # Chat transport (omnichat)
│ └── events/
│ └── id.go # Event ID generation
├── ent/ # Database schema (Ent ORM)
│ └── schema/
│ ├── event.go # Event entity
│ └── agent.go # Agent entity
├── pkg/ # OUTBOUND infrastructure
│ ├── voice/
│ │ └── manager.go # Voice call orchestration
│ ├── chat/
│ │ └── manager.go # Chat message routing
│ ├── config/
│ │ ├── config.go # Legacy configuration
│ │ └── unified.go # Unified JSON configuration
│ └── tools/
│ └── tools.go # MCP tool definitions
├── examples/
│ └── config.json # Example JSON configuration
├── docs/
│ └── design/ # Architecture documentation
│ ├── FEAT_INBOUND_PRD.md
│ ├── FEAT_INBOUND_TRD.md
│ └── FEAT_INBOUND_PLAN.md
├── go.mod
└── README.md依赖项
github.com/plexusone/omnivoice-电池包括语音提取github.com/plexusone/omnichat-聊天消息抽象github.com/plexusone/omnivoice-twilio-Twilio运输和呼叫系统github.com/plexusone/mcpkit-MCP服务器运行时github.com/modelcontextprotocol/go-sdk-MCP协议SDKentgo.io/ent-Go的实体框架(数据库ORM)modernc.org/sqlite-纯Go SQLite驱动程序
成本估算
| 服务 | 成本 |
|---|---|
| Twilio出站电话 | ~0.014美元/分钟 |
| Twilio电话号码 | 约1.15美元/月 |
| ElevenLabs TTS | 约0.30美元/千个字符(约0.03美元/分钟语音) |
| ElevenLabs STT | ~0.10美元/分钟(手写) |
| 深度克TTS | 约0.015/1K字符 |
| Deepgram STT | ~0.0043美元/分钟(Nova-2) |
| OpenAI TTS | 约0.015/1K字符 |
| OpenAI STT | ~0.006美元/分钟(耳语) |
| Discord/Telegram/Slack/IRC | 免费 |
| Gmail API | 免费(每天500封电子邮件) |
| ngrok(免费套餐) | 0美元 |
供应商建议:
| 优先级 | TTS提供商 | STT提供商 | 总成本/分钟 | 备注 |
|---|---|---|---|---|
| 最低成本 | 深克 | 深克 | ~0.03美元 | 性价比最高,质量上乘 |
| 最佳质量 | ElevenLabs | Deepgram | 约0.05美元 | 高级语音,快速转录 |
| 平衡 | OpenAI | OpenAI | ~$0.04 | 单个API密钥,质量稳定 |
*费用为近似值,不包括Twilio电话费(约0.014美元/分钟)。*
许可证
麻省理工学院
学分
灵感源自 ZeframLou/打电话给我 (TypeScript)。
使用plexusone堆栈构建:
