tiktok-live-studio-mcp
A local MCP server for Windows that lets stdio MCP clients control TikTok LIVE Studio via its Socket.IO protocol, providing tools for scenes, sources, audio, recording, and LIVE actions.
README
TikTok LIVE Studio MCP
A local Model Context Protocol server for Windows that lets Codex, Claude Code, Claude Desktop, and other stdio MCP clients control TikTok LIVE Studio through its localhost Stream Deck Socket.IO channel.
The server does not use mouse automation, OCR, browser automation, or screen coordinates. It discovers the running LIVE Studio process and its owned port, validates the protocol, acknowledges each action, and verifies readable state changes.
Community project. Not affiliated with TikTok, ByteDance, Elgato, Anthropic, or OpenAI.
Features
- Twelve typed MCP tools for status, scenes, sources, audio, microphone, recording, actions, and LIVE control.
- Official MCP TypeScript SDK with stdio transport.
- Windows process, installed-version, and process-owned port discovery.
- Automatic rediscovery when LIVE Studio restarts on a different port.
- Idempotent scene/source/audio/microphone/recording/LIVE operations.
- Action-result validation plus post-action state verification.
- Cross-process mutation lock for multiple locally configured MCP clients.
- Structured error contract and compact JSONL evidence logs.
- Mock Socket.IO, MCP contract, real safe integration, opt-in full integration, built stdio, packaging, and release gates.
Requirements
- Windows 10 or Windows 11.
- Node.js 20 or newer.
- TikTok LIVE Studio installed. Start it before running doctor or real integration checks.
Quick start
git clone https://github.com/dannguyen9x/tiktok-live-studio-mcp.git
cd tiktok-live-studio-mcp
npm.cmd ci
npm.cmd run build
npm.cmd run doctor
npm.cmd run mcp:smoke
Then connect your MCP client using the client setup guide. For a complete walkthrough, safety model, examples, updates, and uninstall steps, read the full user guide or Vietnamese user guide.
Run the server directly:
npm.cmd start
MCP uses stdout, so ordinary runtime logs are written to artifacts/evidence/runtime.jsonl rather than stdout.
MCP client configuration
Copy the relevant example and replace C:/path/to/tiktok-live-studio-mcp with the absolute clone path:
.mcp.json.exampleconfig/claude-desktop.example.jsonconfig/claude-code.example.jsonconfig/codex.example.toml
The common stdio configuration is:
{
"mcpServers": {
"tiktok-live-studio": {
"command": "node",
"args": [
"C:/path/to/tiktok-live-studio-mcp/dist/src/index.js"
],
"env": {
"TTLS_LOG_PATH": "C:/path/to/tiktok-live-studio-mcp/artifacts/evidence/runtime.jsonl"
}
}
}
}
Restart the MCP client after changing its configuration.
For current Codex and Claude Code CLI commands, Claude Desktop configuration, generic-client setup, and verification steps, see docs/CLIENT_SETUP.md.
Example requests
Once the server is connected, ask your MCP client naturally:
Check whether TikTok LIVE Studio is connected and list my scenes.
Switch LIVE Studio to the exact scene "Gameplay".
Hide source "Starting Soon" in scene "Gameplay".
Mute the microphone in LIVE Studio.
Start a local recording, but do not start LIVE.
For LIVE state changes, explicitly authorize the dedicated tool call:
Start LIVE using studio_start_live with confirm set to true.
Always review account, audience, scene, audio, and recording state before authorizing a LIVE action.
Tools
| Tool | Behavior |
|---|---|
studio_get_status |
Read running, connected, app version, endpoint, active scene, recording state, and LIVE state. |
studio_list_scenes |
List scenes and the active scene. |
studio_switch_scene |
Idempotently switch to an exact scene and verify it. |
studio_list_sources |
List source names, internal IDs, and visibility for the active or named scene. |
studio_set_source_visibility |
Set source visibility without a blind toggle; temporarily switches/restores scene when required. |
studio_set_microphone_mute |
Idempotently set and verify aggregate microphone mute. |
studio_set_audio_mute |
Idempotently set and verify desktop/audio-output mute. |
studio_start_recording |
Start recording only when stopped and verify the state. |
studio_stop_recording |
Stop recording only when active and verify the state. |
studio_trigger_action |
Trigger a verified parameterless Stream Deck action and require LIVE Studio acknowledgement. |
studio_start_live |
Require confirm:true, start LIVE from readable offline state, and verify live state. |
studio_stop_live |
Require confirm:true, stop LIVE, and verify offline state. |
The generic action enum contains live-pause, highlight, recording-gallery, co-host, treasure-box, say-hi, guess-game, play-together, goody-bag, team, game-rewards, live-goal, multi-guest, vote, promote, and viewer-wishes.
Some generic actions are conditional. LIVE Studio returns result code -1 when the verified action exists but the current account, LIVE state, eligibility, or panel state does not permit it. The MCP tool returns that as a structured ACTION_FAILED result rather than pretending the action succeeded.
Verified local protocol
| Field | Value |
|---|---|
| Endpoint | ws://127.0.0.1:<discovered-process-port> |
| Socket.IO path | /socket.io/ |
| Namespace | / |
| Transport | websocket |
| WebSocket subprotocol | streamdeck_ttls_v1 |
| Join | stream_deck/join_room once per connection |
| State | stream_deck/sync_settings |
| Action | stream_deck/action_emit |
| Action result | stream_deck/<unique-context> |
The contract was verified against LIVE Studio 1.33.2. See docs/PROTOCOL.md for payloads, status values, action IDs, and evidence provenance.
Reliability and safety model
- Every mutation acquires
%TEMP%\tiktok-live-studio-mcp.mutation.lock, reads current state, emits at most one action, verifies readable state, and releases the lock. - A crashed lock owner is detected by PID and recovered.
- Source operations restore the original scene in
finally. - Toggle-like mutations are never automatically retried after an uncertain result.
- LIVE start/end requires literal
confirm:true. - Disconnects trigger process and port rediscovery rather than retrying forever against a stale endpoint.
- Malformed settings or action responses produce
PROTOCOL_MISMATCH.
Every tool error contains:
code, message, operation, appVersion, endpoint, socketEvent,
attempt, suggestedFix, evidencePath
Tests
CI-safe checks:
npm.cmd run test:ci
Safe real integration with LIVE Studio open:
npm.cmd run doctor
npm.cmd run test:integration
npm.cmd run mcp:smoke
npm.cmd run smoke
The safe real suite switches/restores a scene, changes/restores source visibility, and changes/restores microphone mute. It never starts LIVE.
For a deliberately opt-in real audio, recording, LIVE, and generic-action gate, read docs/FULL_INTEGRATION.md. It requires explicit environment confirmations and writes a restoration report.
Full local release evidence:
npm.cmd run verify:final
See docs/VERIFICATION.md for what each gate proves.
Protocol research
npm.cmd run protocol:research
This executes npm view ttls-controller --json, downloads the published package with npm pack ttls-controller, records official Elgato Marketplace metadata, and hashes protocol-bearing files from the installed LIVE Studio version. Generated machine-specific evidence is excluded from Git; see artifacts/README.md.
Project layout
src/mcp/ MCP server and schemas
src/domain/ state policy, errors, mutation lock
src/adapters/ttls/ Socket.IO protocol adapter
src/discovery/ Windows process/version/port discovery
src/logging/ structured JSONL logging
tests/unit/ mock Socket.IO and domain tests
tests/contract/ MCP and protocol contract tests
tests/integration/ safe real LIVE Studio integration
scripts/ doctor, smoke, research, full and release gates
docs/ protocol, architecture, and verification guides
Contributing and security
Read CONTRIBUTING.md before submitting a change. Report vulnerabilities through GitHub private vulnerability reporting as described in SECURITY.md. Do not publish raw evidence logs, credentials, recordings, account data, or proprietary LIVE Studio bundles.
Documentation
- Complete user guide
- Hướng dẫn đầy đủ bằng tiếng Việt
- MCP client setup
- Troubleshooting
- Architecture
- Verified protocol
- Verification gates
- Opt-in full integration
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 模型以安全和受控的方式获取实时的网络信息。