Asterisk S2S MCP Server 是一个用于自动语音通话的 MCP 服务器,借助 Asterisk 实现语音到语音的交互,让电话沟通变得像输入提示一样简单! 📞✨
本项目支持两种安装方式,推荐使用 NPX 方式进行快速安装。
# 一键安装,立即使用! 🚀
npx @grec0/mcp-s2s-asterisk@latest
npm install -g @grec0/mcp-s2s-asterisk
mcp-s2s-asterisk
安装前请确保满足以下要求:
快速搭建步骤如下:
# 📥 克隆仓库
git clone
cd mcp-s2s-asterisk
# 📦 安装依赖
npm install
# 🔨 构建项目
npm run build
# 🚀 启动服务器
npm run start
以下是一个医疗预约确认的完整使用示例:
// 1️⃣ 用户告知 Claude:
"Call María González at 555-0123 to confirm her appointment tomorrow at 3pm"
// 2️⃣ Claude 自动调用:
phone_make_call({
usuario: "María González",
telefono: "555-0123",
proposito: "Confirm medical appointment for tomorrow 3pm",
timeout: 60
})
// 3️⃣ 自动返回结果:
"✅ Call completed. María confirmed her appointment for tomorrow at 3pm.
She also asked to change the time to 2:30pm if possible."
graph TB
subgraph "MCP Client"
A[Claude Desktop] --> B[MCP Client]
end
subgraph "MCP Server"
B --> C[Asterisk S2S MCP]
C --> D[Phone Tools]
C --> E[Real-time Assistant]
end
subgraph "Backend Services"
D --> F[Asterisk Server]
E --> G[Speech-to-Speech API]
F --> H[Phone Network]
end
subgraph "Monitoring"
C --> I[Health Check]
C --> J[Metrics & Logs]
C --> K[Call History]
end
style A fill:#e1f5fe
style C fill:#f3e5f5
style F fill:#fff3e0
style G fill:#e8f5e8
sequenceDiagram
participant U as User
participant C as Claude/MCP
participant S as MCP Server
participant A as Asterisk API
participant P as Phone
U->>C: "Call John to remind about appointment"
C->>S: phone_make_call()
S->>A: POST /make-call
A->>P: Initiate call
P-->>A: Connection established
A-->>S: CallID + Status
S-->>C: Call initiated ✅
C-->>U: "📞 Call started with John"
Note over A,P: Real-time S2S conversation
A->>S: Callback with result
S->>S: Process transcript
U->>C: "How did the call go?"
C->>S: phone_get_last_result()
S-->>C: Detailed result
C-->>U: "✅ John confirmed the appointment"
mindmap
root((Asterisk S2S MCP))
Core Tools
phone_make_call
phone_get_status
phone_cancel_call
Monitoring
phone_health_check
phone_get_metrics
phone_get_logs
History
phone_get_conversation_history
phone_get_active_calls
phone_get_last_result
Configuration
Environment Variables
MCP Client Config
Asterisk Integration
graph LR
subgraph "Automation"
A[Appointment
Reminders]
B[Booking
Confirmations]
C[Automated
Surveys]
end
subgraph "Support"
D[Customer
Service]
E[Ticket
Follow-up]
F[Data
Verification]
end
subgraph "Sales"
G[Automated
Prospecting]
H[Lead
Follow-up]
I[Customer
Qualification]
end
style A fill:#ffcdd2
style B fill:#f8bbd9
style C fill:#e1bee7
style D fill:#c5cae9
style E fill:#bbdefb
style F fill:#b3e5fc
style G fill:#b2dfdb
style H fill:#c8e6c9
style I fill:#dcedc8
stateDiagram-v2
[*] --> Starting
Starting --> Connecting: API Request
Connecting --> Speaking: Connection OK
Connecting --> Failed: No answer
Speaking --> Completed: Conversation OK
Speaking --> Cancelled: User Cancel
Completed --> [*]
Failed --> [*]
Cancelled --> [*]
note right of Speaking : Real-time
Speech-to-Speech
note right of Completed : Result processed
and saved
pie title Call Distribution by Status
"Completed" : 65
"In Progress" : 15
"Failed" : 12
"Cancelled" : 8
xychart-beta
title "Daily Calls (Last Week)"
x-axis [Mon, Tue, Wed, Thu, Fri, Sat, Sun]
y-axis "Number of Calls" 0 --> 50
bar [23, 34, 28, 41, 38, 15, 8]
脚本 | 描述 | 命令 |
---|---|---|
🔨 | 编译 TypeScript | npm run build |
👀 | 开发模式 | npm run dev |
🧪 | 运行测试 | npm run test |
🔍 | MCP 检查器 | npm run inspector |
📦 | 发布补丁 | npm run release:patch |
graph TB
subgraph "Response Time"
A[Connection: ~2s]
B[Establishment: ~3s]
C[Conversation: Variable]
D[Processing: ~1s]
end
subgraph "Success Rates"
E[Connection: 95%]
F[Completed: 87%]
G[Satisfaction: 92%]
end
style E fill:#c8e6c9
style F fill:#c8e6c9
style G fill:#c8e6c9
如果你喜欢这个项目,欢迎贡献代码或提出反馈!
由 @grec0 用心打造
借助对话式 AI 变革电话通信