Skip to main content
Glama
PPiai

tiktok-mcp

by PPiai

TikTok MCP Server

Model Context Protocol (MCP) server for TikTok. Provides tools for searching videos, users, hashtags, getting trending content, user profiles, video details, and more.

Features

  • Video Search - Search TikTok videos by keyword

  • Trending Hashtags - Get currently trending hashtags by region

  • Trending Videos - Get popular/trending videos

  • User Info - Get user profile details (followers, following, likes, bio, etc.)

  • User Videos - Get videos from a specific user's profile

  • Video Details - Get detailed video information (stats, description, etc.)

  • Hashtag Search - Get videos for a specific hashtag

  • User Search - Search for TikTok users

Related MCP server: TikTok MCP Server

API Access

This server supports two modes:

  1. Official TikTok API (recommended) - Requires approved developer access with:

    • TIKTOK_CLIENT_KEY

    • TIKTOK_CLIENT_SECRET

    • TIKTOK_ACCESS_TOKEN

  2. Public Scraping (fallback) - Works without API credentials but may be rate-limited or break if TikTok changes their frontend.

Transport

The server runs over streamable-HTTP by default, exposing the MCP endpoint at /mcp so it can be hosted as a network service (Easypanel/Docker). Set MCP_TRANSPORT=stdio to run over stdio for local subprocess use instead.

Configuration

Environment variables:

Variable

Default

Description

MCP_TRANSPORT

streamable-http

streamable-http (hosted) or stdio (local)

HOST

0.0.0.0

Bind address

PORT

8000

Listen port

TIKTOK_CLIENT_KEY

Official API key (optional)

TIKTOK_CLIENT_SECRET

Official API secret (optional)

TIKTOK_ACCESS_TOKEN

Official API token (optional)

Get credentials from TikTok Developers and set the three TIKTOK_* variables. If they are not set, the server falls back to public scraping.

Local Development

# Install (editable) with uv
uv pip install -e .

# Run (streamable-HTTP on http://0.0.0.0:8000/mcp)
tiktok-mcp

# Or over stdio
MCP_TRANSPORT=stdio tiktok-mcp

Docker

docker build -t tiktok-mcp .
docker run -p 8000:8000 \
  -e TIKTOK_CLIENT_KEY=... \
  -e TIKTOK_CLIENT_SECRET=... \
  -e TIKTOK_ACCESS_TOKEN=... \
  tiktok-mcp

The MCP endpoint will be available at http://localhost:8000/mcp.

Deploy on Easypanel

  1. Create an App service pointing to this repository (or the GHCR image built by the included CI workflow).

  2. Build method: Dockerfile (already in the repo root).

  3. Set the exposed/container port to 8000 and add a domain (Easypanel handles SSL).

  4. Add the TIKTOK_* environment variables under the service's Environment tab (leave them empty to use public scraping).

  5. Deploy. The MCP endpoint will be served at https://<your-domain>/mcp.

Connecting an MCP client

For a hosted HTTP server, connect via URL (not a spawned command). The exact config file depends on the client; the shape is the same:

{
  "mcpServers": {
    "tiktok": {
      "url": "https://<your-domain>/mcp"
    }
  }
}
  • Claude Desktop / Claude Code: add the block above to the MCP config and restart.

  • Hermes Agent: point the tiktok server at the same url.

Once connected, the tools appear to the model (e.g. mcp_tiktok_search_videos) and can be triggered with natural language — see Example Queries.

Verify the endpoint

After running locally or deploying, confirm the server is up with a raw MCP handshake. The streamable-HTTP endpoint requires both application/json and text/event-stream in the Accept header:

curl -i -X POST http://localhost:8000/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}'

A healthy server returns HTTP/1.1 200 OK and an SSE data: line containing "serverInfo":{"name":"tiktok-mcp",...}.

Available Tools

All tools return a JSON text payload. When scraping is used (no official API credentials), responses include a "source": "scraping" field.

Tool

Parameters

Description

search_videos

query (str, required), max_results (int, default 20)

Search videos by keyword

get_trending_hashtags

region (str, default US)

Get trending hashtags by region

get_trending_videos

region (str, default US), max_results (int, default 20)

Get trending videos

get_user_info

username (str, required — with or without @)

Get user profile details

get_user_videos

username (str, required), max_results (int, default 20)

Get a user's videos

get_video_details

video_id (str, required)

Get video details by ID

search_hashtag

hashtag (str, required — with or without #), max_results (int, default 20)

Get videos for a hashtag

search_users

query (str, required), max_results (int, default 20)

Search for users

Example Queries

  • "Search for videos about AI automation"

  • "Get trending hashtags in Brazil"

  • "Find trending videos in the US"

  • "Get profile info for @username"

  • "Get videos from @username's profile"

  • "Search for #marketing hashtag videos"

  • "Find users about 'dark fantasy art'"

Development

# Install with dev dependencies
uv pip install -e ".[dev]"

Note: an automated test suite is not included yet. Use the Verify the endpoint handshake to smoke-test changes.

Important Notes

  • Rate Limits: Public scraping is subject to TikTok's rate limits. Use official API for production.

  • Legal: Respect TikTok's Terms of Service and robots.txt

  • Stability: Public scraping may break if TikTok changes their frontend structure

  • Official API: Requires TikTok developer approval - apply at developers.tiktok.com

License

MIT

Available Tools

8 tools
get_user_infoB

Get TikTok user profile information

ParametersJSON Schema
NameRequiredDescriptionDefault
usernameYesTikTok username (with or without @)

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description must convey all behavioral traits. It only states 'Get', implying a read operation, but does not disclose authentication needs, rate limits, or what specific fields are returned. This is insufficient for a tool without annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no filler. Every word serves the purpose of stating the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite the tool being simple with one parameter and no output schema, the description does not indicate what the profile information includes (e.g., followers count, bio). This leaves the agent uncertain about the return value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with the parameter 'username' having a description. The tool description adds no additional meaning beyond the schema, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'TikTok user profile information'. It distinguishes from sibling tools like search_users, which finds users rather than retrieving details for a specific user.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, such as when to use search_users instead. No exclusions, prerequisites, or context are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_user_videosC

Get videos from a TikTok user's profile

ParametersJSON Schema
NameRequiredDescriptionDefault
usernameYesTikTok username (with or without @)
max_resultsNoMaximum number of results

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only says 'get videos' and omits critical details like authentication requirements, pagination behavior, error handling, or what happens when a user is not found.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, concise and direct. However, it could be slightly expanded without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description does not explain the return format, pagination, or constraints. For a simple but nontrivial tool, this leaves significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both parameters (username, max_results), so the description adds no additional meaning beyond the schema. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get videos from a TikTok user's profile' clearly states the action (get), resource (videos), and scope (user's profile). It is unambiguous but does not explicitly differentiate from siblings like get_video_details or search_videos.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as search_videos or get_trending_videos. Lacks context about prerequisites or limitations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_video_detailsA

Get detailed information about a specific TikTok video

ParametersJSON Schema
NameRequiredDescriptionDefault
video_idYesTikTok video ID

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description does not disclose behavioral traits such as whether it requires authentication, rate limits, or what 'detailed information' includes. It is a simple read operation, but lacks explicit transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence of 10 words, efficiently conveying the tool's purpose with no redundant information. It is well front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description is minimally adequate. However, it could provide more context about what fields are returned or any constraints, especially lacking annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with a clear 'TikTok video ID' description for the video_id parameter. The tool description adds no extra meaning beyond the schema, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'get' and resource 'detailed information about a specific TikTok video'. This distinguishes it from sibling tools like get_trending_videos or search_videos which focus on lists or searches.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a specific video ID, but no explicit guidance on when to choose this over alternatives like search_videos. No exclusions or prerequisites mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_hashtagB

Search videos by hashtag

ParametersJSON Schema
NameRequiredDescriptionDefault
hashtagYesHashtag (with or without #)
max_resultsNoMaximum number of results

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full responsibility for behavioral disclosure. The description only states it searches videos, implying a read operation, but does not mention any potential side effects, rate limits, result limits beyond the default, or permissions required. Minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence with no redundant words. It is concise and front-loaded. However, some information that could improve clarity (like usage guidance) is missing, which slightly lowers the score from 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with 2 parameters and no output schema, the description is somewhat complete in stating the core functionality. However, it lacks context about the return format, pagination, or how it differs from sibling tools like search_videos. A more complete description would help the agent understand the scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for both parameters (hashtag, max_results), and the description adds no additional semantic information beyond what is in the schema. According to guidelines, baseline is 3 when coverage is high, and the description does not provide extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Search videos by hashtag' clearly states the verb (Search), the resource (videos), and the specific filter (by hashtag). This distinguishes it from sibling tools like search_videos (which may search by other criteria) and get_trending_hashtags (which lists trending hashtags, not videos).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no information on when to use this tool versus alternatives like search_videos. It does not mention any exclusions, prerequisites, or comparative advantage. The agent is left without guidance on selecting this tool over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_usersC

Search for TikTok users

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
max_resultsNoMaximum number of results

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and description does not disclose behavioral traits such as authentication requirements, rate limits, or pagination. Agent is left uninformed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is only four words, which is too terse. While concise, it lacks essential details and feels underspecified rather than efficiently written.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, no annotations, and only 2 simple params. Description fails to mention result format, usage of max_results, or any edge cases. Incomplete for a search tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema already describes both parameters (query and max_results) with 100% coverage. Description adds no extra meaning, so baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb 'search' and resource 'TikTok users'. It distinguishes from siblings like search_videos and search_hashtag. Could be more specific (e.g., by username or keyword), but adequate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use search_users vs alternatives like get_user_info or search_hashtag. Agent must infer context from tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_videosC

Search for TikTok videos by keyword

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
max_resultsNoMaximum number of results

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description must disclose behavior. It only states the basic function, omitting details on pagination, rate limits, result ordering, or error handling. The parameter max_results is specified in the schema, but behavioral nuances are absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that directly states the tool's purpose. No unnecessary words or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, and the description does not specify return format (e.g., list of video objects). For a basic search tool, it is somewhat complete but could be improved by noting typical response structure or potential limitations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters documented. The description adds no extra meaning beyond 'by keyword', which aligns with the query parameter. Baseline 3 is appropriate as the schema already explains parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Search for TikTok videos by keyword', specifying the action and resource. However, it does not distinguish from sibling tools like search_hashtag or get_trending_videos, which search different entities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives (e.g., search_hashtag for hashtags, get_trending_videos for trending content). The description lacks context for appropriate usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.4/5.0
Disambiguation4/5

Most tools have clearly distinct purposes (trending, user info, search, video details). The main potential confusion is between get_trending_videos and search_videos, as both return videos but one is specifically trending; descriptions help disambiguate.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in snake_case (get_*, search_*), making them predictable and easy to understand.

Tool Count5/5

8 tools is appropriate for a TikTok MCP server, covering trending, user, video details, and search without being overwhelming or too sparse.

Completeness4/5

The tool set covers core read operations (trending, user, video, search) for TikTok. Minor gaps exist (e.g., no hashtag metadata, no posting or interaction tools), but they are reasonable given typical read-only MCP servers.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables interaction with the YouTube Data API, allowing users to search videos, get video and channel details, analyze trends, and fetch video transcripts.
  • A
    license
    B
    quality
    Not graded
    maintenance
    A comprehensive MCP server that enables AI assistants to search, download, and analyze TikTok content while also performing active tasks like publishing videos and interacting with posts. It provides full automation capabilities for TikTok through browser session management and anti-detection features.
    12
    2
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for crawling social media platforms (e.g., Bilibili) by keywords, video IDs, or creator IDs, with support for MySQL, JSON, and CSV storage.
    39
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    Free MCP server to automate TikTok viral marketing — search trending videos, analyze hashtags, and draft video scripts. Premium features powered by DeepSeek AI unlock AI-driven optimal posting times, hashtag strategies, and script generation.
    5

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PPiai/tiktok-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server