TikTok MCP Server
This server lets an AI agent read public TikTok data and transcribe videos via your own speech-to-text endpoint, with no TikTok API key or OAuth required.
Get a user's profile (
get_profile): nickname, bio, verified status, follower/following/like/video counts, avatar URLList a user's recent videos (
get_videos): id, caption, URL, view count (default 10, max 50)Get a video's top-level comments (
get_comments): author, text, likesSearch videos by keyword or hashtag (
search_videos): id, caption, URL, creator, viewsDiscover creators by topic/hashtag (
discover_creators): unique creators with profile URL and the video that surfaced themTranscribe a video's speech (
transcribe_video): full text, language, duration, and word-level timestamps via any OpenAI-compatible speech-to-text API
All tools are read-only, return structured output, accept @-optional usernames and full/short/@user/video/<id>/numeric video IDs, are rate-limit aware with caching and cooldowns, and return a note (not an error) when TikTok hides data.
Provides tools for reading public TikTok data, including searching videos and hashtags, fetching user profiles, listing a user's recent videos, discovering creators by topic, retrieving video comments, and transcribing video speech.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TikTok MCP Server search TikTok for #booktok and show me the top 5 videos"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TikTok MCP Server
A Model Context Protocol server that lets an AI agent read public TikTok data: search, profiles, videos, discovery, comments, and transcription.
There is no TikTok developer account to apply for and no OAuth flow. Everything comes off public pages, so the only credential you might enter is a key for your own transcription endpoint.
It runs on any MCP client (Claude, Cursor, opencode, Codex) and returns structured output (structuredContent + outputSchema) from every tool. Transcription works against any OpenAI-compatible speech-to-text endpoint: Groq, OpenAI, or a Whisper server you host yourself.
Quick start
Paste this into your MCP client config. There is nothing to install first: uvx fetches the package and runs it on the initial launch.
{
"mcpServers": {
"tiktok": {
"type": "stdio",
"command": "uvx",
"args": ["tiktok-mcp-server"],
"env": {
"TRANSCRIBE_API_URL": "https://api.groq.com/openai/v1/audio/transcriptions",
"TRANSCRIBE_API_KEY": "your-key",
"TRANSCRIBE_MODEL": "your-model"
}
}
}
}Things worth knowing before the first call:
The
envblock exists only fortranscribe_video. Write"env": {}if you want the other five tools and nothing else.TRANSCRIBE_API_URLis used exactly as written, so give the provider's full speech-to-text endpoint: an OpenAI-compatible multipartPOST(the/audio/transcriptionsroute) backed by a speech-to-text model such aswhisper-large-v3.The first tool call downloads Playwright Chromium once, about 150 MB. ffmpeg ships with the package (
imageio-ffmpeg); setFFMPEG_PATHif you'd rather use your own binary.You need uv on the machine, since it provides
uvx. Python 3.11+ comes along with it; uv installs that itself.Linux only: headless Chromium needs system libraries that
uvxcan't install for you. On a fresh machine or Docker image, run this once (it may prompt forsudo):uvx --from playwright playwright install-deps chromiumWindows and macOS don't need this step.
Running from a checkout (before PyPI)
Not on PyPI yet? Point uvx at a local checkout or at the git repo (use whichever fits):
"args": ["--from", "C:\\path\\to\\tiktokmcp", "tiktok-mcp-server"]"args": ["--from", "git+https://github.com/<you>/tiktokmcp", "tiktok-mcp-server"]Related MCP server: tiktok-scraper
MCP tools
Tool | Description | Parameters |
| Profile info: bio, follower/following/like/video counts, verified status, avatar |
|
| A user's recent videos with id, caption, URL, view count |
|
| Top-level comments: author, text, likes |
|
| Search by keyword or hashtag ( |
|
| Creators posting about a topic/hashtag |
|
| Download, extract audio, and transcribe via your speech-to-text API (reports progress) |
|
What the tools have in common:
countis validated to 1–50 by the input schema;usernameaccepts handles with or without@Video tools accept a full URL (including
vm.tiktok.com/vt.tiktok.comshort links),@user/video/<id>, or a bare numeric idEvery tool is annotated
readOnlyHint,idempotentHint,openWorldHint,destructiveHint: falseAnticipated failures (bad input, user not found, missing
TRANSCRIBE_API_URL, TikTok timeouts) come back asisError: truewith a readable messageWhen TikTok blocks or hides data, tools return an empty list plus a
noteinstead of failing, and requests are paced so repeat calls wait rather than pile onEach browser call takes several seconds;
transcribe_videocan take up to a minute. Counts like views/likes are TikTok's display strings (e.g.1.2M)
Configuration
Your MCP client injects configuration as environment variables. The server never reads a .env file of its own.
Variable | Required | Description |
| For transcription | Full speech-to-text endpoint, used verbatim ( |
| For transcription | API key for that endpoint (omit for keyless local servers) |
| No | Model name (default |
| No | Path to an ffmpeg binary (default: |
| No |
|
| No |
|
Request pacing (defaults follow a person browsing; raise them if you see blocks, lower them if calls feel slow):
Variable | Default | Description |
|
| Minimum seconds between TikTok requests |
|
| Requests allowed per window |
|
| Length of that window |
|
| First cooldown after a block; doubles on each further block |
|
| Ceiling for that doubling |
|
| How long a page is given to finish rendering |
|
| How long a read is reused instead of re-requested ( |
Browser identity and footprint:
Variable | Default | Description |
|
| Reuse one browser profile so TikTok's cookies survive restarts |
| OS cache dir | Where that profile lives ( |
| auto | Force |
|
| Drop TikTok's ad and telemetry calls |
Built-in safety limits: 100 MB download cap, 120 s ffmpeg timeout, 600 s transcription timeout, 30 s navigation timeout.
Client setup
Every client launches the same command, uvx tiktok-mcp-server. Only the config format differs.
Claude Desktop / Claude Code / Cursor
{
"mcpServers": {
"tiktok": {
"type": "stdio",
"command": "uvx",
"args": ["tiktok-mcp-server"],
"env": {
"TRANSCRIBE_API_URL": "https://api.groq.com/openai/v1/audio/transcriptions",
"TRANSCRIBE_API_KEY": "your-key"
}
}
}
}Claude Code one-liner:
claude mcp add tiktok -e TRANSCRIBE_API_URL=... -e TRANSCRIBE_API_KEY=... -- uvx tiktok-mcp-serveropencode (~/.config/opencode/opencode.json → mcp)
"tiktok": {
"type": "local",
"command": ["uvx", "tiktok-mcp-server"],
"environment": {
"TRANSCRIBE_API_URL": "https://api.groq.com/openai/v1/audio/transcriptions",
"TRANSCRIBE_API_KEY": "your-key"
},
"enabled": true,
"timeout": 120000
}Codex (~/.codex/config.toml)
[mcp_servers.tiktok]
command = "uvx"
args = ["tiktok-mcp-server"]
[mcp_servers.tiktok.env]
TRANSCRIBE_API_URL = "https://api.groq.com/openai/v1/audio/transcriptions"
TRANSCRIBE_API_KEY = "your-key"Running manually
uvx tiktok-mcp-server # stdio (what MCP clients launch)
uvx tiktok-mcp-server --transport streamable-http --host 127.0.0.1 --port 8000Inspect it interactively with the MCP Inspector:
npx @modelcontextprotocol/inspector uvx tiktok-mcp-serverHow it works
A real browser (Playwright Chromium) opens TikTok's public pages, just like you would — no API keys or developer accounts
Profiles are read from the page's built-in data; search, discovery, and comments are read after the page finishes loading
Transcription: download the video → trim it to a small audio file → send it to your speech-to-text API → return the text
Logs go to stderr so the connection to your AI client stays clean
Not getting rate-limited
TikTok blocks scraping clients that look like bots and that hammer the site. The server is built to avoid both, without any hidden tricks:
Paced, never bursty. Every TikTok request — the warm-up visit, each scrape, each media download — takes a slot from one server-wide gate: a minimum gap between requests plus a sliding-window budget. Tools called in parallel queue up instead of landing at once.
One identity, not a new one per call. A persistent browser profile keeps TikTok's cookies (
ttwid,msToken) across calls and restarts, the homepage is warmed up once per session rather than before every page, and the headless fingerprint (HeadlessChrome,navigator.webdriver) is replaced with an installed Chrome's real version.Repeats are free. Identical reads are served from a short-lived cache, and simultaneous identical requests share one page load, so a retry or a re-plan costs TikTok nothing.
Blocks are respected. A rate-limit response (HTTP 429/403, or TikTok's error copy) starts a cooldown that every later call waits out, doubling on each repeat — the opposite of retrying into a longer ban. The tool tells you how long to wait instead of failing silently.
Defaults are deliberately conservative (a request every 4 s, 24 per 5 minutes). Tune them with the pacing variables above.
Architecture
src/tiktokmcp/
├── __main__.py # python -m tiktokmcp
├── server.py # create_server() factory, instructions, CLI (--transport/--host/--port)
├── app.py # lifespan + AppContext (throttle, cache, browser, scraper, transcriber)
├── config.py # Settings.from_env()
├── models.py # Pydantic result models -> outputSchema / structuredContent
├── errors.py # domain errors -> ToolError translation
├── validation.py # username / video-reference normalization
├── throttle.py # request pacing, sliding window, block cooldowns
├── cache.py # TTL cache with single-flight de-duplication
├── browser.py # BrowserManager: persistent Playwright profile, owned by the lifespan
├── scraper.py # TikTokScraper: profile JSON, video grids, search, comments
├── transcribe.py # Transcriber: yt-dlp -> ffmpeg -> speech-to-text API
└── tools/ # one module per tool, each exposing register(mcp)
├── _params.py # shared Annotated parameter types + ToolAnnotations
├── profile.py videos.py comments.py
└── search.py discover.py transcript.py
tests/ # pytest, in-memory MCP client (no network)Tool functions are thin: they validate input, pull shared services from the lifespan context, and return a typed model. Scraping and transcription logic lives in services that know nothing about MCP.
Development
uv sync # install deps
uv run playwright install chromium # browser for the scraper
uv run pytest # offline test suite
uv run ruff check src tests && uv run ruff format src testsLimitations
Read-only: no posting, liking, or any other write actions
TikTok still rate-limits some IPs and some accounts. When that happens tools return an empty result plus a
notesaying how long to wait, and the server stops requesting for that long instead of retryingget_commentscan return nothing when TikTok hides comments from logged-out browsersTranscription requires your own speech-to-text endpoint; nothing is relayed through third parties
License
MIT
Available Tools
6 toolsdiscover_creatorsARead-onlyIdempotent
Find TikTok creators posting about a topic. Searches the topic as a hashtag and returns unique creators with their profile URL and the video that surfaced them.
Inputs: topic (required), count. Returns: note, count, topic, creators
get_commentsARead-onlyIdempotent
Get top-level comments on a TikTok video (author, text, likes). An empty list comes with a note when TikTok hides comments from logged-out browsers.
Inputs: video_id (required), count. Returns: note, count, comments, video_url
get_profileARead-onlyIdempotent
Get a TikTok user's public profile: nickname, bio, verified status, follower, following, like, and video counts, and avatar URL.
Inputs: username (required). Returns: bio, nickname, username, verified, +5 more
get_videosARead-onlyIdempotent
List a TikTok user's most recent public videos with id, caption, URL, and view count. Returns an empty list with a note if the account is private or TikTok blocks the request.
Inputs: username (required), count. Returns: note, count, videos, username
search_videosBRead-onlyIdempotent
Search TikTok videos by keyword or hashtag. Returns id, caption, URL, creator, and view count.
Inputs: query (required), count. Returns: note, count, query, results
transcribe_videoARead-onlyIdempotent
Transcribe a TikTok video's speech with the server's speech-to-text API. Returns the full text, language, duration, and word-level timestamps when the API supports them. Takes 10-60 seconds.
Inputs: video_url (required), language. Returns: text, model, words, duration, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Most tools target distinct resources and actions: profile, videos, comments, search, creators, and transcription. The only mild overlap is between search_videos and discover_creators, since both search by topic/hashtag, but their output focus is clearly different (videos vs. creators).
All tool names follow a consistent verb_noun snake_case pattern: get_profile, get_videos, get_comments, search_videos, discover_creators, transcribe_video. The convention is predictable and readable throughout.
Six tools is well-scoped for a read-only TikTok data server, covering core retrieval and analysis needs without redundant operations. Each tool earns its place and the set is easy to navigate.
The surface covers profiles, user videos, comments, keyword search, creator discovery, and transcription, which handles most public TikTok research workflows. Minor gaps remain, such as no single-video lookup by ID or reply-level comments, but agents can work around these.
Maintenance
Related MCP Connectors
TikTok research for AI agents. Ask ChatGPT, Claude, Cursor, Codex or any MCP client what people search, watch, say and buy on TikTok, and get real numbers back. 34 tools: weekly TikTok search volume and 7-day trends, content gaps, videos, creators, comments and caption transcripts, hashtags and sounds, TikTok Shop sales estimates for products, shops, creators, videos and LIVE streams, TikTok’s Top Ads library with CTR and retention, places, and a fair comment-giveaway picker. 17 markets. Built for marketers, agencies, TikTok Shop sellers and creators. Sign in with OAuth or an API key; 50 free credits, no card.
Real-time TikTok profile, video feed, comments, search & HD media metadata API for AI agents.
Real-time TikTok videos, profiles, comments, trends & Creative Center ads MCP. OAuth or API key.
TikTok search demand, videos, creators, comments and captions for AI agents. OAuth or API key.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to extract TikTok video and soundtrack media, metadata, covers, and manifests from public URLs or IDs through verified downloads and schema access via MCP tools.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients and skill-aware agents to retrieve structured TikTok videos, profiles, hashtags, comments, followers, and related feeds without login. It supports natural-language requests for filtering, transcripts, downloads, and AI labels such as brand safety and sentiment.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to query public social media data across TikTok, Instagram, YouTube, X, Douyin and Xiaohongshu through ten unified business-level tools covering creator and post search, comments, trending topics, and comment insights. Ships one normalized schema over MCP, SSE, REST and stdio, with per-call pricing and cost/balance reported in every response.1038 PyPIMIT
- AlicenseNot gradedqualityBmaintenanceEnables users to research TikTok Shop products, generate AI videos, images, and scripts, and manage social accounts from Claude, ChatGPT, Cursor, Codex, and other MCP-compatible assistants.MIT