Skip to main content
Glama
lanternrow

tiktok-organic-mcp

by lanternrow

tiktok-organic-mcp

npm version License: MIT

MCP server for TikTok organic analytics — video performance, engagement metrics, and profile insights via the TikTok Developer API.

Built for Claude Code and any MCP-compatible AI tool. Gives your AI assistant direct access to your TikTok account data — videos, views, likes, comments, shares, and follower stats.

Part of The SEO Engine toolkit by Rex Jones — AI-powered SEO and social media tooling for agencies and businesses.

Why this exists

  • No open-source TikTok organic MCP existed. Ads MCPs exist. Organic analytics? Nobody built one.

  • Paid alternatives cost money. The commercial options require monthly subscriptions. This is free and open source.

  • Your AI should see your TikTok data. Ask "how are my TikTok videos performing?" and get a real answer.

Related MCP server: TikTok Complete MCP Server

Quick start

Option 1: npx (no install)

Single account:

{
  "mcpServers": {
    "tiktok-organic": {
      "command": "npx",
      "args": ["-y", "tiktok-organic-mcp"],
      "env": {
        "TIKTOK_ACCESS_TOKEN": "your_access_token"
      }
    }
  }
}

Multiple accounts:

{
  "mcpServers": {
    "tiktok-organic": {
      "command": "npx",
      "args": ["-y", "tiktok-organic-mcp"],
      "env": {
        "TIKTOK_ACCOUNTS": "[{\"name\":\"mybrand\",\"access_token\":\"act.xxx\",\"client_key\":\"abc123\",\"refresh_token\":\"rft.xxx\"},{\"name\":\"otherbrand\",\"access_token\":\"act.yyy\",\"client_key\":\"def456\",\"refresh_token\":\"rft.yyy\"}]"
      }
    }
  }
}

Option 2: Clone and build

git clone https://github.com/lanternrow/tiktok-organic-mcp.git
cd tiktok-organic-mcp
npm install
npm run build

Then add to your Claude Code MCP settings:

{
  "mcpServers": {
    "tiktok-organic": {
      "command": "node",
      "args": ["/path/to/tiktok-organic-mcp/dist/index.js"],
      "env": {
        "TIKTOK_ACCESS_TOKEN": "your_access_token"
      }
    }
  }
}

Getting your TikTok Access Token

Step 1: Create a TikTok Developer App

  1. Go to the TikTok Developer Portal and log in

  2. Click Manage appsConnect an app

  3. Fill in your app details and submit for review

Step 2: Add Login Kit and request scopes

  1. In your app dashboard, add the Login Kit product

  2. Request these scopes:

    • user.info.basic — profile name, avatar

    • user.info.profile — bio, verification status

    • user.info.stats — follower/following counts, total likes

    • video.list — access to video listing and metrics

Step 3: Complete the OAuth flow

  1. Direct users to TikTok's authorization URL:

    https://www.tiktok.com/v2/auth/authorize/
      ?client_key={your_client_key}
      &scope=user.info.basic,user.info.profile,user.info.stats,video.list
      &response_type=code
      &redirect_uri={your_redirect_uri}
  2. Exchange the authorization code for tokens:

    POST https://open.tiktokapis.com/v2/oauth/token/
    Content-Type: application/x-www-form-urlencoded
    
    client_key={client_key}
    &client_secret={client_secret}
    &code={auth_code}
    &grant_type=authorization_code
    &redirect_uri={redirect_uri}
  3. Save the access_token and refresh_token from the response

Tip: Access tokens expire after 24 hours. Use the refresh_token tool or set TIKTOK_REFRESH_TOKEN to enable automatic renewal.

Multi-account support

Monitor multiple TikTok accounts from a single MCP server. Set the TIKTOK_ACCOUNTS environment variable as a JSON array:

[
  {
    "name": "mybrand",
    "access_token": "act.xxx",
    "client_key": "abc123",
    "refresh_token": "rft.xxx"
  },
  {
    "name": "otherbrand",
    "access_token": "act.yyy",
    "client_key": "def456",
    "refresh_token": "rft.yyy"
  }
]

Each account object requires:

  • name — a unique label you pick (used in tool calls)

  • access_token — the OAuth access token

Optional:

  • client_key — needed for token refresh

  • refresh_token — needed for token refresh

Using accounts in tools: Every tool accepts an optional account parameter. If omitted, the first account in the array is used as default.

get_user_info(account: "mybrand")
get_videos(account: "otherbrand", max_count: 10)

Backward compatible: If you only have one account, the legacy single-env-var format (TIKTOK_ACCESS_TOKEN) still works. It creates a default account named "default".

Tools

Account tools

Tool

Description

list_accounts

List all configured TikTok accounts and the default

Read tools

Tool

Description

get_user_info

Profile metadata: username, bio, follower/following counts, total likes, video count, verification status

get_videos

Paginated list of public videos with engagement metrics (views, likes, comments, shares)

get_video_details

Detailed metrics for specific video IDs (batch up to 20)

Utility tools

Tool

Description

refresh_token

Exchange refresh token for a new access token (requires client_key and refresh_token in account config)

All read and utility tools accept an optional account parameter to target a specific account.

Architecture

src/
  index.ts          # MCP server entry point, tool registration
  accounts.ts       # Multi-account resolution and configuration
  client.ts         # TikTok API HTTP client (native fetch, no dependencies)
  types.ts          # TypeScript interfaces for API responses
  tools/
    user.ts         # get_user_info
    videos.ts       # get_videos, get_video_details
    utils.ts        # refresh_token
  • Zero external HTTP dependencies — uses Node 18+ native fetch

  • Multi-account support — monitor multiple TikTok accounts from one server

  • Backward compatible — single-token env var still works

  • Cursor-based pagination — video listing supports pagination via cursor

  • Zod validation — all tool inputs validated with descriptive error messages

  • Batch video queries — get details for up to 20 videos in one request

Environment variables

Variable

Required

Description

TIKTOK_ACCOUNTS

Yes

JSON array of account objects (see Multi-account support section)

Single account (legacy)

Variable

Required

Description

TIKTOK_ACCESS_TOKEN

Yes

OAuth access token from Login Kit flow

TIKTOK_CLIENT_KEY

For refresh

App Client Key (needed for token refresh)

TIKTOK_REFRESH_TOKEN

For refresh

Refresh token (needed for token refresh)

Development

npm run dev    # Watch mode — recompiles on save
npm run build  # Production build
npm start      # Run the server

Contributing

Issues and PRs welcome. If TikTok changes their API, please open an issue.

License

MIT — see LICENSE.


Built as part of The SEO Engine by Rex Jones.

Available Tools

5 tools
get_user_infoA

Get a TikTok user's profile info: username, bio, follower/following counts, total likes, video count, and verification status.

ParametersJSON Schema
NameRequiredDescriptionDefault
accountNoAccount name to query. Use list_accounts to see available options. Defaults to the first configured account.

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description bears the full burden. It lists the returned fields (behavioral output) but does not disclose read-only nature, authentication requirements, or rate limits. It is adequate but minimal.

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, front-loaded sentence that efficiently conveys the tool's purpose and return fields. No unnecessary words, earning high marks for conciseness.

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 is simple with one parameter and no output schema. The description covers the return fields adequately but omits error handling, account existence requirements, or other contextual details that could be helpful.

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 the single parameter, so the description adds no extra meaning beyond the schema's 'Account name to query...'. This meets the baseline of 3.

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 specifies the resource 'a TikTok user's profile info', listing specific fields like username, bio, follower/following counts, etc. This distinguishes it from sibling tools such as list_accounts and get_videos.

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 for retrieving user profile data but does not explicitly state when to use it over alternatives. The parameter description hints at using list_accounts for available accounts, but no when-not-to-use guidance is given.

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 performance metrics for specific TikTok videos by ID. Returns views, likes, comments, shares, duration, and more. Max 20 video IDs per request.

ParametersJSON Schema
NameRequiredDescriptionDefault
accountNoAccount name to query. Use list_accounts to see available options. Defaults to the first configured account.
video_idsYesArray of TikTok video IDs to query (max 20)

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description must disclose behavior. It states the tool returns metrics and limits to 20 IDs, but does not explicitly indicate it is read-only or discuss rate limits. This is adequate but could be clearer.

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?

Two sentences, front-loaded with purpose, no wasted words. Every sentence adds key information: what the tool does, what it returns, and a constraint.

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

Completeness4/5

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

Given no output schema, the description lists return metrics (views, likes, etc.) and the ID limit. It covers the tool's core behavior and constraints. Missing explicit read-only mention but otherwise complete for a simple read tool.

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

Parameters4/5

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

Schema coverage is 100%, but the description adds value by specifying the max 20 IDs (reinforcing schema) and advising to use list_accounts for the account parameter. This goes beyond the schema's descriptions.

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 tool gets detailed performance metrics for specific TikTok videos by ID, listing specific metrics (views, likes, comments, shares, duration) and a limit of 20 IDs. This distinguishes it from siblings like list_accounts or get_user_info.

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

Usage Guidelines4/5

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

The description implies when to use (need metrics for specific videos) and mentions a batch limit, but does not explicitly state when not to use or provide alternatives. The sibling tools offer some context.

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

get_videosA

Get a paginated list of the user's public TikTok videos with engagement metrics (views, likes, comments, shares). Returns up to 20 videos per page.

ParametersJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor (UTC Unix timestamp in ms). Pass the cursor from the previous response to get the next page.
accountNoAccount name to query. Use list_accounts to see available options. Defaults to the first configured account.
max_countNoNumber of videos to return (1-20, default 10)

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, and the description does not explicitly state idempotency or side effects. However, the read-only nature is implied by 'Get a paginated list', and the description covers return limits and metrics.

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 that efficiently conveys purpose, result details, and constraints with no wasted words.

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

Completeness4/5

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

The description effectively covers the main functionality for a list tool, but lacks mention of error handling or edge cases. Without an output schema, it provides adequate context for an AI agent.

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% and the description adds minimal new meaning beyond the schema definitions (e.g., 'Returns up to 20 videos per page' aligns with max_count). Baseline score applies.

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 tool gets a paginated list of user's public TikTok videos with engagement metrics, distinguishing it from sibling tools like get_video_details (single video) or list_accounts.

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 for listing videos with pagination and engagement data, but does not explicitly guide when to use this tool versus alternatives or mention exclusions.

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

list_accountsA

List all configured TikTok accounts available for querying.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

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

No annotations provided. Description simply states the action, no disclosure of authentication, rate limits, or read-only nature. Adequate for a trivial listing but could be more explicit.

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?

Single sentence with no wasted words, directly states purpose.

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?

No output schema exists, and description does not specify what attributes are returned for each account. Lacks completeness for an agent to understand the result format.

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

Parameters4/5

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

No parameters in schema. Baseline score of 4 for 0 parameters as per rubric.

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?

Description clearly states it lists all configured TikTok accounts, a specific verb and resource. Differentiates from sibling tools which focus on user info or 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 like get_user_info. Implied usage but no explicit context or prerequisites.

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

refresh_tokenA

Refresh the TikTok access token for an account using its stored refresh token. Returns new access and refresh tokens. Requires client_key and refresh_token in the account config.

ParametersJSON Schema
NameRequiredDescriptionDefault
accountNoAccount name to refresh. Use list_accounts to see available options. Defaults to the first configured account.

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description should disclose behavioral traits. It mentions the stored refresh token and required config, but does not discuss rate limits, token invalidation side effects, or error scenarios (e.g., expired refresh token). This is adequate but could be more thorough.

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?

Three sentences front-load the purpose and key details. No extraneous information; every sentence serves a purpose (action, return value, requirements).

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

Completeness4/5

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

For a simple one-parameter tool with no output schema, the description covers what it does, what it needs, and what it returns. It could mention potential failure modes (e.g., invalid refresh token), but defaults are covered.

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

Parameters4/5

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

The single parameter 'account' is described beyond the schema: it explains its purpose (which account to refresh), refers to list_accounts for discovery, and notes default behavior. Schema coverage is 100%, so the description adds meaningful guidance.

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 tool refreshes the TikTok access token using a stored refresh token and returns new tokens. This verb-resource pairing is distinct from sibling tools like get_user_info or get_videos.

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

Usage Guidelines4/5

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

The description includes prerequisite requirements (client_key and refresh_token in account config) and references list_accounts for account selection. It does not explicitly state when not to use the tool, but the purpose is self-explanatory.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv1.1.1
    • First observedget_user_info
    • First observedget_video_details
    • First observedget_videos
    • First observedlist_accounts
    • First observedrefresh_token

TDQS

A4.1/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a distinct purpose: account listing, user profile, video list, video details, and token refresh. No overlap, agents can easily distinguish them.

Naming Consistency5/5

All tools follow a verb_noun pattern (list_accounts, get_user_info, get_videos, get_video_details, refresh_token). Perfectly consistent.

Tool Count5/5

Five tools cover the core operations for TikTok organic data retrieval without being excessive or insufficient. Well-scoped for the server's purpose.

Completeness4/5

Covers user profile, video lists, video details, and token management. Minor gap: no comment or search functionality, but the set is coherent for basic data access.

Maintenance

ActivityStale
ResponsivenessNo issues

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

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI assistants to manage TikTok advertising campaigns through the TikTok Ads API. Supports campaign creation, performance analytics, audience management, creative operations, and custom reporting through natural language interactions.
    49
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants to access YouTube organic analytics, including channel stats, video performance, watch time, and audience engagement, via the YouTube Data API v3 and Analytics API v2.
    6
    40
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Provides TikTok trend data to AI assistants, including hashtag volume, growth rates, and top trending topics for early trend detection.
    3
    1
    MIT