Voice Assistant Mcp Demo — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Voice Assistant Mcp Demo (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Ba service Python chạy độc lập, kết nối qua URL env vars.
api_server → mcp_server → gateway ← Android app / curlpip install -r requirements.txt
cp .env.example .env # điền GEMINI_API_KEY và GATEWAY_SHARED_TOKEN
# Terminal 1
python api_server.py # :8000
# Terminal 2
python mcp_server.py # :8001 (MCP_BASE_URL=http://localhost:8000 đã có trong .env)
# Terminal 3
python gateway.py # :8002Test bằng curl:
# Không có auth token (để trống GATEWAY_SHARED_TOKEN trong .env khi test local)
curl -X POST http://localhost:8002/command \
-H "Content-Type: application/json" \
-d '{"text": "việc hôm nay có gì", "session_id": "test-1"}'
# Kết quả mong đợi:
# {"speech": "Hôm nay bạn có 4 việc, trong đó 3 việc chưa xong...", "session_id": "test-1"}
# Multi-turn — follow-up cùng session
curl -X POST http://localhost:8002/command \
-H "Content-Type: application/json" \
-d '{"text": "đánh dấu xong việc gọi khách hàng", "session_id": "test-1"}'git init && git add . && git commit -m "init phase 1"
git remote add origin <your-github-repo-url>
git push -u origin maintask-apipip install -r requirements.txtpython api_server.pyPORT → để Render tự điềnSau khi deploy xong, copy URL dạng https://task-api-xxxx.onrender.com.
task-mcppython mcp_server.pyAPI_BASE_URL → URL của Service 1 (bước 2)Sau khi deploy, copy URL: https://task-mcp-xxxx.onrender.com.
task-gatewaypython gateway.pyMCP_BASE_URL → URL của Service 2 (bước 3)GEMINI_API_KEY → key từ Google AI StudioGATEWAY_SHARED_TOKEN → chuỗi ngẫu nhiên (dùng openssl rand -hex 16)GATEWAY_URL=https://task-gateway-xxxx.onrender.com
TOKEN=your_shared_token
curl -X POST $GATEWAY_URL/command \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $TOKEN" \
-d '{"text": "việc hôm nay có gì", "session_id": "s1"}'Lưu ý cold-start: Render free tier ngủ sau 15 phút idle. Request đầu tiên mất ~30s. Chấp nhận được cho demo.
| Service | Biến | Bắt buộc | Ghi chú |
|---|---|---|---|
| api_server | PORT | auto | Render tự set |
| mcp_server | PORT | auto | |
| mcp_server | API_BASE_URL | ✓ | URL của api_server |
| gateway | PORT | auto | |
| gateway | MCP_BASE_URL | ✓ | URL của mcp_server |
| gateway | GEMINI_API_KEY | ✓ | Google AI Studio |
| gateway | GATEWAY_SHARED_TOKEN | khuyến nghị | Bảo vệ endpoint public |
POST `/command`
Headers: X-Auth-Token: <token> (nếu có GATEWAY_SHARED_TOKEN)
Body:
{
"text": "lệnh giọng nói đã chuyển thành text",
"session_id": "uuid-từ-app"
}Response:
{
"speech": "Câu trả lời tiếng Việt tự nhiên để đọc lên",
"session_id": "uuid-từ-app"
}Session tự reset sau 30 phút không có request.
curl POST /command {"text": "việc hôm nay có gì"}
→ {"speech": "Hôm nay bạn có ..."}android/
├── app/src/main/java/com/demo/voiceassistant/
│ ├── Config.kt ← URL gateway + auth token
│ ├── MainActivity.kt ← 1 nút "Nói", quản lý luồng
│ ├── SpeechController.kt ← STT vi-VN (SpeechRecognizer)
│ ├── ApiClient.kt ← POST /command qua OkHttp
│ └── SpeakController.kt ← TTS đọc kết quả
└── app/src/main/res/
└── layout/activity_main.xmlandroid/Nếu dùng máy ảo (AVD): chọn image có Google Play để SpeechRecognizer hoạt động với vi-VN.Bấm nút "Nói"
→ SpeechRecognizer (vi-VN) nghe ~5 giây
→ text → POST https://task-gateway-0le7.onrender.com/command
header: X-Auth-Token: <token>
→ {"speech": "..."} → TextToSpeech đọc lênLưu ý cold-start: Request đầu tiên sau 15 phút idle mất ~30s (Render free tier). Timeout của ApiClient đã set 90s.
Sửa android/app/src/main/java/com/demo/voiceassistant/Config.kt:
object Config {
const val GATEWAY_URL = "https://task-gateway-xxxx.onrender.com"
const val AUTH_TOKEN = "your_token_here"
}Bấm nút → nói "việc hôm nay có gì" → app đọc lại danh sách bằng giọng tiếng Việt.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.