Skip to main content
Glama
LamaTok — TikTok MCP

LamaTok — TikTok MCP

lamatok-mcp

npm version npm downloads License: MIT

用于 LamaTok(TikTok 数据 API)的 MCP 服务器。可在 npm 上获取:lamatok-mcp。

在启动时从 LamaTok OpenAPI 规范自动生成 MCP 工具,因此每个非弃用的 GET 端点都无需手动编写包装器即可公开。工具与 REST 端点一一对应(GET /v1/user/by/username → get_v1_user_by_username)。

获取 100 次免费 API 请求

使用此链接注册 即可获得 100 次免费 LamaTok 请求 — 无需信用卡。足以连接 MCP 服务器,在 Claude/Cursor/Codex 中尝试几个提示词,并在承诺使用前评估数据质量。

在此处获取您的 100 次免费请求

Related MCP server: DataLikers — Instagram & TikTok MCP

快速入门

  1. 在 lamatok.com 获取 API 密钥。

  2. 将服务器添加到您的 AI 助手。

  3. 向您的助手询问类似以下内容:

    • “获取 @nasa 的 TikTok 个人资料。”

    • “列出 user_id 6707206320333226502 的最后 10 个视频。”

    • “查找标签 photography 的近期 TikTok 视频。”

Claude Code

claude mcp add lamatok -e LAMATOK_KEY=your-api-key -- npx -y lamatok-mcp

Claude Desktop

添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "lamatok": {
      "command": "npx",
      "args": ["-y", "lamatok-mcp"],
      "env": {
        "LAMATOK_KEY": "your-api-key"
      }
    }
  }
}

Cursor / Windsurf

与 Claude Desktop 格式相同 — 将该块放在应用程序 MCP 配置文件中的 mcpServers 下。

Zed

添加到 ~/.config/zed/settings.json:

{
  "context_servers": {
    "lamatok": {
      "command": "npx",
      "args": ["-y", "lamatok-mcp"],
      "env": {
        "LAMATOK_KEY": "your-api-key"
      }
    }
  }
}

OpenAI Codex

追加到 ~/.codex/config.toml:

[mcp_servers.lamatok]
command = "npx"
args = ["-y", "lamatok-mcp"]

[mcp_servers.lamatok.env]
LAMATOK_KEY = "your-api-key"

工具

工具在启动时从实时 LamaTok OpenAPI 规范 生成,因此列表始终与当前 API 匹配。这些组中共有约 19 个工具(截至撰写本文时的数量):

组

工具

示例

v1/user

9

get_v1_user_by_username, get_v1_user_by_id, get_v1_user_medias

v1/media

8

get_v1_media_info_by_id, get_v1_media_comments

v1/hashtag

2

get_v1_hashtag_medias_recent

每个工具名称都反映了其端点(GET /v1/user/by/username → get_v1_user_by_username)。您的助手可以通过 MCP 调用 tools/list 来获取包含参数模式的完整、最新的列表。默认情况下,/sys、Legacy 和 System 标签组被排除在外。

配置

变量

描述

必需

LAMATOK_KEY

您的 LamaTok 访问密钥(作为 x-access-key 标头发送)

是

LAMATOK_URL

基础 URL。默认:https://api.lamatok.com

否

LAMATOK_SPEC_URL

OpenAPI 规范 URL。默认:${LAMATOK_URL}/openapi.json

否

LAMATOK_TAGS

白名单:仅包含带有这些标签的操作(逗号分隔)

否

LAMATOK_EXCLUDE_TAGS

黑名单:要排除的其他标签(在 Legacy、System、/sys 之上)

否

LAMATOK_TIMEOUT_MS

API 调用的单次请求超时时间。默认:30000

否

LAMATOK_SPEC_TIMEOUT_MS

启动时获取规范的超时时间。默认:60000

否

LAMATOK_MAX_RESPONSE_BYTES

从每个 API 响应中读取的最大字节数。默认:10485760 (10 MB)

否

LAMATOK_MAX_SPEC_BYTES

从 OpenAPI 规范中读取的最大字节数。默认:8388608 (8 MB)

否

Legacy、System 和 /sys 标签默认被排除。已弃用的操作也会被跳过。

如果 LAMATOK_URL 指向 api.lamatok.com 以外的主机,服务器会在启动时打印警告 — 您的密钥将被发送到该地址,因此请仅将其用于自托管或代理的 LamaTok。

工作原理

AI Assistant ←stdio→ lamatok-mcp ──https──> api.lamatok.com
                          │
                          └─ fetches /openapi.json once on startup,
                             builds one MCP tool per GET endpoint

工具参数映射到端点的 query 和 path 参数。响应正文按原样返回(JSON 文本)。非 2xx 响应将作为带有 HTTP 状态和正文的工具错误显示。

开发

git clone https://github.com/subzeroid/lamatok-mcp.git
cd lamatok-mcp
npm install
npm run build
LAMATOK_KEY=your-key node dist/index.js

以监视模式运行:

LAMATOK_KEY=your-key npm run dev

运行测试(针对本地模拟服务器的单元测试 + stdio 冒烟测试,无需网络/API 密钥):

npm test

许可证

MIT

Available Tools

23 tools
get_v1_hashtag_infoA
Read-only

Get a TikTok hashtag (challenge) by name: pass hashtag without #. Use it to get the hashtag id that get_v1_hashtag_medias needs. Live request to TikTok, billed per call. (GET /v1/hashtag/info)

Inputs: hashtag (required).

get_v1_hashtag_mediasA
Read-only

List videos under a TikTok hashtag, one page per call. Pass the hashtag id (from get_v1_hashtag_info, not the name); count sets the page size (default 30) and cursor pages through. Use get_v2_search to search by free text instead. Live request to TikTok, billed per call. (GET /v1/hashtag/medias)

Inputs: id (required), count, cursor.

get_v1_media_by_idA
Read-only

Get a TikTok video by numeric video id. Use it when you have the id from another tool; use get_v1_media_by_url when you have a link. Returns the video object; use get_v1_media_comments_by_id for its comments. Live request to TikTok, billed per call. (GET /v1/media/by/id)

Inputs: id (required).

get_v1_media_by_urlA
Read-only

Get a TikTok video by its link. Use it when you have a tiktok.com URL; use get_v1_media_by_id when you already have the numeric video id. Returns the video object; pass its id to the comment tools. Live request to TikTok, billed per call. (GET /v1/media/by/url)

Inputs: url (required).

get_v1_media_comment_replies_by_idA
Read-only

Get replies under one comment of a TikTok video, one page per call. Use it to read a thread; use get_v1_media_comments_by_id for the top-level comments. Pass media_id and comment_id (both from the comments tool); count sets the page size and cursor pages through. Live request to TikTok, billed per call. (GET /v1/media/comment/replies/by/id)

Inputs: media_id (required), comment_id (required), count, cursor.

get_v1_media_comments_by_idA
Read-only

Get comments on a TikTok video, one page per call. Use get_v1_media_comment_replies_by_id for replies under one comment. Pass the video id; count sets the page size (default 30) and cursor pages through. Live request to TikTok, billed per call. (GET /v1/media/comments/by/id)

Inputs: id (required), count, cursor.

get_v1_media_music_download_by_idA
Read-only

Get a download link for the audio track of a TikTok video, by video id. Returns the file URL and the HTTP headers to send with it; the file itself is not downloaded. Use get_v1_media_music_download_by_url when you have a link and get_v1_media_video_download_by_id for the video file. Live request to TikTok, billed per call. (GET /v1/media/music/download/by/id)

Inputs: id (required).

get_v1_media_music_download_by_urlA
Read-only

Get a download link for the audio track of a TikTok video, by the video's URL. Returns the file URL and the HTTP headers to send with it; the file itself is not downloaded. Use get_v1_media_music_download_by_id when you have the video id and get_v1_media_video_download_by_url for the video file. Live request to TikTok, billed per call. (GET /v1/media/music/download/by/url)

Inputs: url (required).

get_v1_media_video_download_by_idA
Read-only

Get a download link for a TikTok video by video id. Returns the file URL and the HTTP headers to send with it; the file itself is not downloaded. watermark (default true) selects the watermarked version. Use get_v1_media_video_download_by_url when you have a link and get_v1_media_music_download_by_id for the audio track only. Live request to TikTok, billed per call. (GET /v1/media/video/download/by/id)

Inputs: id (required), watermark.

get_v1_media_video_download_by_urlA
Read-only

Get a download link for a TikTok video by its URL. Returns the file URL and the HTTP headers to send with it; the file itself is not downloaded. watermark (default true) selects the watermarked version. Use get_v1_media_video_download_by_id when you have the video id and get_v1_media_music_download_by_url for the audio track only. Live request to TikTok, billed per call. (GET /v1/media/video/download/by/url)

Inputs: url (required), watermark.

get_v1_user_by_usernameA
Read-only

Get a TikTok profile by username (without @). Use it first for any account; if it answers 404 ProfileUnavailable, use get_v3_user_by_username, which also returns profiles TikTok does not serve on the web. Returns the user object; take the user's secUid from it for the by-secUid tools. Live request to TikTok, billed per call. (GET /v1/user/by/username)

Inputs: username (required).

get_v1_user_followers_by_secUidA
Read-only

List a TikTok user's followers by secUid, one page per call. Use it when you already have the secUid from a profile; use get_v1_user_followers_by_username when you only have a handle. For the next page pass next_page_id from the previous response as page_id; count sets the page size (default 30). Live request to TikTok, billed per call. (GET /v1/user/followers/by/secUid)

Inputs: secUid (required), count, page_id.

get_v1_user_followers_by_usernameA
Read-only

List a TikTok user's followers by username, one page per call. Use it when you have a handle; use get_v1_user_followers_by_secUid when you already have the secUid and get_v1_user_following_by_username for accounts the user follows. For the next page pass next_page_id from the previous response as page_id; count sets the page size (default 30). Live request to TikTok, billed per call. (GET /v1/user/followers/by/username)

Inputs: username (required), count, page_id.

get_v1_user_following_by_secUidA
Read-only

List accounts a TikTok user follows by secUid, one page per call. Use it when you already have the secUid from a profile; use get_v1_user_following_by_username when you only have a handle. For the next page pass next_page_id from the previous response as page_id; count sets the page size (default 30). Live request to TikTok, billed per call. (GET /v1/user/following/by/secUid)

Inputs: secUid (required), count, page_id.

get_v1_user_following_by_usernameA
Read-only

List accounts a TikTok user follows by username, one page per call. Use it when you have a handle; use get_v1_user_following_by_secUid when you already have the secUid and get_v1_user_followers_by_username for the user's followers. For the next page pass next_page_id from the previous response as page_id; count sets the page size (default 30). Live request to TikTok, billed per call. (GET /v1/user/following/by/username)

Inputs: username (required), count, page_id.

get_v1_user_playlists_by_secUidA
Read-only

List a TikTok user's playlists by secUid, one page per call. Use it when you already have the secUid from a profile; use get_v1_user_playlists_by_username when you only have a handle. For the next page pass next_page_id from the previous response as page_id; count sets the page size (default 30). Live request to TikTok, billed per call. (GET /v1/user/playlists/by/secUid)

Inputs: secUid (required), count, page_id.

get_v1_user_playlists_by_usernameA
Read-only

List a TikTok user's playlists by username, one page per call. Use it when you have a handle; use get_v1_user_playlists_by_secUid when you already have the secUid, and get_v2_user_medias_by_secUid for all of the user's videos. For the next page pass next_page_id from the previous response as page_id; count sets the page size (default 30). Live request to TikTok, billed per call. (GET /v1/user/playlists/by/username)

Inputs: username (required), count, page_id.

get_v1_user_suggested_by_secUidA
Read-only

List the accounts TikTok suggests as related to a user, by secUid, one page per call. Use it when you already have the secUid from a profile; use get_v1_user_suggested_by_username when you only have a handle. For the next page pass next_page_id from the previous response as page_id; count sets the page size (default 30). Live request to TikTok, billed per call. (GET /v1/user/suggested/by/secUid)

Inputs: secUid (required), count, page_id.

get_v1_user_suggested_by_usernameA
Read-only

List the accounts TikTok suggests as related to a user, by username, one page per call. Use it to find similar accounts when you have a handle; use get_v1_user_suggested_by_secUid when you already have the secUid and get_v2_search to search by keyword instead. For the next page pass next_page_id from the previous response as page_id; count sets the page size (default 30). Live request to TikTok, billed per call. (GET /v1/user/suggested/by/username)

Inputs: username (required), count, page_id.

get_v2_user_likes_by_secUidA
Read-only

List videos a TikTok user has liked, one page per call. Use get_v2_user_medias_by_secUid for the user's own videos. Pass the user's secUid (from the profile tool); count sets the page size and cursor pages through. Live request to TikTok, billed per call. (GET /v2/user/likes/by/secUid)

Inputs: secUid (required), count, cursor.

get_v2_user_medias_by_secUidA
Read-only

List a TikTok user's videos, one page per call. Use it to read an account's content; use get_v2_user_likes_by_secUid for videos the user liked and get_v1_media_by_id for one video's details. Pass the user's secUid (from the profile tool); count sets the page size and max_cursor pages through. Live request to TikTok, billed per call. (GET /v2/user/medias/by/secUid)

Inputs: secUid (required), count, max_cursor.

get_v3_user_by_usernameA
Read-only

Get a TikTok profile by username, including profiles TikTok does not serve on the web (the ones get_v1_user_by_username answers with 404 ProfileUnavailable). Use it as the fallback when the v1 tool fails; the response has the same shape. Live request to TikTok, billed as 1 request per call and 2-3 for a restored profile. (GET /v3/user/by/username)

Inputs: username (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 23 tools

    Disambiguation4/5

    Tools are mostly distinct by resource and identifier type (username vs secUid, id vs url), and descriptions explicitly cross-reference alternatives. However, the many near-duplicate pairs (e.g. following by username vs secUid, download by id vs url) require careful reading to avoid misselection.

    Naming Consistency5/5

    All tool names follow a highly consistent snake_case pattern: get_<version>_<resource>_<action>_<qualifier>. The version prefixes (v1, v2, v3) are the only variation and clearly reflect API endpoints.

    Tool Count3/5

    23 tools is on the heavy side for a single MCP server, falling into the 16-25 borderline range. While each tool maps to a distinct TikTok API endpoint, the set feels large and could overwhelm an agent without strong routing guidance.

    Completeness4/5

    The surface covers user profiles, relationships, playlists, media, downloads, comments, hashtags, and search well. Minor gaps exist, such as no direct user lookup by secUid and no trending/live endpoints, but core read-only TikTok workflows are supported.

    Maintenance

    ActivitySlowing
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      MCP server for HikerAPI — auto-generates 100+ Instagram tools (profiles, posts, reels, stories, comments, hashtags, locations) from the live OpenAPI spec. Local stdio via npx -y hikerapi-mcp, requires only HIKERAPI_KEY.
      44
      143 npm
      9
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for DataLikers — 51 tools for Instagram & TikTok data: Instagram user search by demographics (gender/age/race/country/city), profiles, engagement, posts, comments, hashtags, locations, stories, business accounts; TikTok users, videos, comments, hashtags, playlists. Local stdio via npx -y datalikers-mcp, requires only DATALIKERS_API_KEY.
      53 npm
      10
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server exposing the full CutPro v1 API as 34 tools for AI clients — analyze videos, submit clipping jobs, manage clips, render, and publish posts. Supports stdio, Streamable HTTP, and OAuth 2.1.
      157 npm
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that exposes FortiCNAPP (formerly Lacework) API 2.0 operations as typed, auth-aware tools generated from the API spec at startup, supporting both local stdio and remote Streamable HTTP transports.
      MIT