TikTok MCP Server & CLI
A free, open source TikTok MCP server and CLI that lets Claude Code, Codex, Cursor and other AI agents read your stats, rank your videos and publish to TikTok.
0.0(0 ratings)- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
claude mcp add tiktok \
-e TIKTOK_CLIENT_KEY=your_client_key \
-e TIKTOK_CLIENT_SECRET=your_client_secret \
-e TIKTOK_REFRESH_TOKEN=your_refresh_token \
-- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
In Claude Code, type /mcp. TikTok should show as connected.
/mcp
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
claude mcp add tiktok -e TIKTOK_CLIENT_KEY="your_client_key" -e TIKTOK_CLIENT_SECRET="your_client_secret" -e TIKTOK_REFRESH_TOKEN="your_refresh_token" -- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
In Claude Code, type /mcp. TikTok should show as connected.
/mcp
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
claude mcp add tiktok \
-e TIKTOK_CLIENT_KEY=your_client_key \
-e TIKTOK_CLIENT_SECRET=your_client_secret \
-e TIKTOK_REFRESH_TOKEN=your_refresh_token \
-- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
In Claude Code, type /mcp. TikTok should show as connected.
/mcp
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2Download the extension
Download the Claude Desktop extension.
- 3
Double-click it, and Claude Desktop installs it.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2Download the extension
Download the Claude Desktop extension.
- 3
Double-click it, and Claude Desktop installs it.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2Download the extension
Download the Claude Desktop extension.
- 3
Double-click it, and Claude Desktop installs it.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
codex mcp add tiktok \
--env TIKTOK_CLIENT_KEY=your_client_key \
--env TIKTOK_CLIENT_SECRET=your_client_secret \
--env TIKTOK_REFRESH_TOKEN=your_refresh_token \
-- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
Check that Codex lists it.
codex mcp list
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
codex mcp add tiktok --env TIKTOK_CLIENT_KEY="your_client_key" --env TIKTOK_CLIENT_SECRET="your_client_secret" --env TIKTOK_REFRESH_TOKEN="your_refresh_token" -- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
Check that Codex lists it.
codex mcp list
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
codex mcp add tiktok \
--env TIKTOK_CLIENT_KEY=your_client_key \
--env TIKTOK_CLIENT_SECRET=your_client_secret \
--env TIKTOK_REFRESH_TOKEN=your_refresh_token \
-- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
Check that Codex lists it.
codex mcp list
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open Cursor's settings, go to the MCP tab, and click Add new global MCP server.
- 3
Add the server.
Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Open the MCP tab again. It should show 14 tools.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open Cursor's settings, go to the MCP tab, and click Add new global MCP server.
- 3
Add the server.
Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Open the MCP tab again. It should show 14 tools.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open Cursor's settings, go to the MCP tab, and click Add new global MCP server.
- 3
Add the server.
Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Open the MCP tab again. It should show 14 tools.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open the Command Palette and run MCP: Open User Configuration.
- 3
Add the server to that mcp.json.
If the file already has servers, add only this one inside servers. Put your own key, secret and refresh token in place of the examples.
{
"servers": {
"tiktok": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open the Command Palette and run MCP: Open User Configuration.
- 3
Add the server to that mcp.json.
If the file already has servers, add only this one inside servers. Put your own key, secret and refresh token in place of the examples.
{
"servers": {
"tiktok": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open the Command Palette and run MCP: Open User Configuration.
- 3
Add the server to that mcp.json.
If the file already has servers, add only this one inside servers. Put your own key, secret and refresh token in place of the examples.
{
"servers": {
"tiktok": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
copilot mcp add tiktok \
--env TIKTOK_CLIENT_KEY=your_client_key \
--env TIKTOK_CLIENT_SECRET=your_client_secret \
--env TIKTOK_REFRESH_TOKEN=your_refresh_token \
-- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
Check that Copilot CLI has it.
copilot mcp get tiktok
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
copilot mcp add tiktok --env TIKTOK_CLIENT_KEY="your_client_key" --env TIKTOK_CLIENT_SECRET="your_client_secret" --env TIKTOK_REFRESH_TOKEN="your_refresh_token" -- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
Check that Copilot CLI has it.
copilot mcp get tiktok
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
copilot mcp add tiktok \
--env TIKTOK_CLIENT_KEY=your_client_key \
--env TIKTOK_CLIENT_SECRET=your_client_secret \
--env TIKTOK_REFRESH_TOKEN=your_refresh_token \
-- npx -y @thenavidm/tiktok-mcp-cli@latest - 3
Check that Copilot CLI has it.
copilot mcp get tiktok
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your Gemini CLI settings.
~/.gemini/settings.json - 3
Add the server to settings.json.
If the file already has servers, add only this one inside mcpServers. Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Restart Gemini CLI and type /mcp to check it.
/mcp
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your Gemini CLI settings.
%USERPROFILE%\.gemini\settings.json - 3
Add the server to settings.json.
If the file already has servers, add only this one inside mcpServers. Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Restart Gemini CLI and type /mcp to check it.
/mcp
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your Gemini CLI settings.
~/.gemini/settings.json - 3
Add the server to settings.json.
If the file already has servers, add only this one inside mcpServers. Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Restart Gemini CLI and type /mcp to check it.
/mcp
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your OpenCode config.
~/.config/opencode/opencode.json - 3
Add the server under mcp.
If the file already has servers, add only this one inside mcp. Put your own key, secret and refresh token in place of the examples.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"tiktok": {
"type": "local",
"command": ["npx", "-y", "@thenavidm/tiktok-mcp-cli@latest"],
"enabled": true,
"environment": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Restart OpenCode.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your OpenCode config.
%USERPROFILE%\.config\opencode\opencode.json - 3
Add the server under mcp.
If the file already has servers, add only this one inside mcp. Put your own key, secret and refresh token in place of the examples.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"tiktok": {
"type": "local",
"command": ["npx", "-y", "@thenavidm/tiktok-mcp-cli@latest"],
"enabled": true,
"environment": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Restart OpenCode.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your OpenCode config.
~/.config/opencode/opencode.json - 3
Add the server under mcp.
If the file already has servers, add only this one inside mcp. Put your own key, secret and refresh token in place of the examples.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"tiktok": {
"type": "local",
"command": ["npx", "-y", "@thenavidm/tiktok-mcp-cli@latest"],
"enabled": true,
"environment": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
} - 4
Restart OpenCode.
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
openclaw mcp add tiktok \
--command npx \
--arg -y \
--arg @thenavidm/tiktok-mcp-cli@latest \
--env TIKTOK_CLIENT_KEY=your_client_key \
--env TIKTOK_CLIENT_SECRET=your_client_secret \
--env TIKTOK_REFRESH_TOKEN=your_refresh_token - 3
Check that it starts and lists its tools.
openclaw mcp doctor tiktok --probe
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
openclaw mcp add tiktok --command npx --arg -y --arg @thenavidm/tiktok-mcp-cli@latest --env TIKTOK_CLIENT_KEY="your_client_key" --env TIKTOK_CLIENT_SECRET="your_client_secret" --env TIKTOK_REFRESH_TOKEN="your_refresh_token" - 3
Check that it starts and lists its tools.
openclaw mcp doctor tiktok --probe
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Add it with a single command in a terminal.
Put your own key, secret and refresh token in place of the examples.
openclaw mcp add tiktok \
--command npx \
--arg -y \
--arg @thenavidm/tiktok-mcp-cli@latest \
--env TIKTOK_CLIENT_KEY=your_client_key \
--env TIKTOK_CLIENT_SECRET=your_client_secret \
--env TIKTOK_REFRESH_TOKEN=your_refresh_token - 3
Check that it starts and lists its tools.
openclaw mcp doctor tiktok --probe
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
In the agent panel, click the … menu, then MCP Servers, Manage MCP Servers and View raw config.
- 3
Add the server to mcp_config.json.
If the file already has servers, add only this one inside mcpServers. Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
In the agent panel, click the … menu, then MCP Servers, Manage MCP Servers and View raw config.
- 3
Add the server to mcp_config.json.
If the file already has servers, add only this one inside mcpServers. Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
In the agent panel, click the … menu, then MCP Servers, Manage MCP Servers and View raw config.
- 3
Add the server to mcp_config.json.
If the file already has servers, add only this one inside mcpServers. Put your own key, secret and refresh token in place of the examples.
{
"mcpServers": {
"tiktok": {
"command": "npx",
"args": ["-y", "@thenavidm/tiktok-mcp-cli@latest"],
"env": {
"TIKTOK_CLIENT_KEY": "your_client_key",
"TIKTOK_CLIENT_SECRET": "your_client_secret",
"TIKTOK_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your Hermes config.
~/.hermes/config.yaml - 3
Add the server under mcp_servers.
If the file already has mcp_servers, add only this one under it. Put your own key, secret and refresh token in place of the examples.
mcp_servers:
tiktok:
command: "npx"
args: ["-y", "@thenavidm/tiktok-mcp-cli@latest"]
env:
TIKTOK_CLIENT_KEY: "your_client_key"
TIKTOK_CLIENT_SECRET: "your_client_secret"
TIKTOK_REFRESH_TOKEN: "your_refresh_token"
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your Hermes config.
%USERPROFILE%\.hermes\config.yaml - 3
Add the server under mcp_servers.
If the file already has mcp_servers, add only this one under it. Put your own key, secret and refresh token in place of the examples.
mcp_servers:
tiktok:
command: "npx"
args: ["-y", "@thenavidm/tiktok-mcp-cli@latest"]
env:
TIKTOK_CLIENT_KEY: "your_client_key"
TIKTOK_CLIENT_SECRET: "your_client_secret"
TIKTOK_REFRESH_TOKEN: "your_refresh_token"
- 1
Get your refresh token once in a terminal, with your app's key and secret.
It prints a sign-in link, then a refresh token that lasts about 365 days. That token goes in the next step. Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli@latest login - 2
Open your Hermes config.
~/.hermes/config.yaml - 3
Add the server under mcp_servers.
If the file already has mcp_servers, add only this one under it. Put your own key, secret and refresh token in place of the examples.
mcp_servers:
tiktok:
command: "npx"
args: ["-y", "@thenavidm/tiktok-mcp-cli@latest"]
env:
TIKTOK_CLIENT_KEY: "your_client_key"
TIKTOK_CLIENT_SECRET: "your_client_secret"
TIKTOK_REFRESH_TOKEN: "your_refresh_token"
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Claude Code the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Claude Code what each command does and which ones ask first.
mkdir -p ~/.claude/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.claude/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Claude Code to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Claude Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Claude Code the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Claude Code what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.claude\skills\tiktok" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\tiktok-mcp-cli\SKILL.md" "$HOME\.claude\skills\tiktok\" - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Claude Code to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Claude Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Claude Code the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Claude Code what each command does and which ones ask first.
mkdir -p ~/.claude/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.claude/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Claude Code to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Claude Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Codex the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Codex what each command does and which ones ask first.
mkdir -p ~/.agents/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.agents/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Codex to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Codex finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Codex the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Codex what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.agents\skills\tiktok" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\tiktok-mcp-cli\SKILL.md" "$HOME\.agents\skills\tiktok\" - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Codex to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Codex finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Codex the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Codex what each command does and which ones ask first.
mkdir -p ~/.agents/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.agents/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Codex to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Codex finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Cursor to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Cursor finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Cursor to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Cursor finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Cursor to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Cursor finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask VS Code to use tiktok-cli.
Running tiktok-cli on its own lists every command, so VS Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask VS Code to use tiktok-cli.
Running tiktok-cli on its own lists every command, so VS Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask VS Code to use tiktok-cli.
Running tiktok-cli on its own lists every command, so VS Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Copilot CLI the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Copilot CLI what each command does and which ones ask first.
mkdir -p ~/.copilot/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.copilot/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Copilot CLI to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Copilot CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Copilot CLI the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Copilot CLI what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.copilot\skills\tiktok" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\tiktok-mcp-cli\SKILL.md" "$HOME\.copilot\skills\tiktok\" - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Copilot CLI to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Copilot CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give Copilot CLI the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Copilot CLI what each command does and which ones ask first.
mkdir -p ~/.copilot/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.copilot/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask Copilot CLI to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Copilot CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Gemini CLI to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Gemini CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Gemini CLI to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Gemini CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Gemini CLI to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Gemini CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give OpenCode the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenCode what each command does and which ones ask first.
mkdir -p ~/.config/opencode/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.config/opencode/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask OpenCode to use tiktok-cli.
Running tiktok-cli on its own lists every command, so OpenCode finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give OpenCode the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenCode what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.config\opencode\skills\tiktok" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\tiktok-mcp-cli\SKILL.md" "$HOME\.config\opencode\skills\tiktok\" - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask OpenCode to use tiktok-cli.
Running tiktok-cli on its own lists every command, so OpenCode finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give OpenCode the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenCode what each command does and which ones ask first.
mkdir -p ~/.config/opencode/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.config/opencode/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask OpenCode to use tiktok-cli.
Running tiktok-cli on its own lists every command, so OpenCode finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give OpenClaw the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenClaw what each command does and which ones ask first.
mkdir -p ~/.openclaw/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.openclaw/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask OpenClaw to use tiktok-cli.
Running tiktok-cli on its own lists every command, so OpenClaw finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give OpenClaw the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenClaw what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.openclaw\skills\tiktok" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\tiktok-mcp-cli\SKILL.md" "$HOME\.openclaw\skills\tiktok\" - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask OpenClaw to use tiktok-cli.
Running tiktok-cli on its own lists every command, so OpenClaw finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Give OpenClaw the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenClaw what each command does and which ones ask first.
mkdir -p ~/.openclaw/skills/tiktok
cp "$(npm root -g)/@thenavidm/tiktok-mcp-cli/SKILL.md" ~/.openclaw/skills/tiktok/ - 3
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 4
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 5
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 6
Ask OpenClaw to use tiktok-cli.
Running tiktok-cli on its own lists every command, so OpenClaw finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Antigravity to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Antigravity finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Antigravity to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Antigravity finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Antigravity to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Antigravity finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Hermes to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Hermes finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Hermes to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Hermes finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
Ask Hermes to use tiktok-cli.
Running tiktok-cli on its own lists every command, so Hermes finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.zshrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.zshrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
List every command, then try one.
tiktok-cli
tiktok-cli get-profile
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
$env:TIKTOK_CLIENT_KEY = "your_client_key"
$env:TIKTOK_CLIENT_SECRET = "your_client_secret"
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
setx TIKTOK_CLIENT_KEY "your_client_key"
setx TIKTOK_CLIENT_SECRET "your_client_secret"
setx TIKTOK_REFRESH_TOKEN "your_refresh_token" - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
List every command, then try one.
tiktok-cli
tiktok-cli get-profile
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/tiktok-mcp-cli@latest - 2
Get your refresh token once.
Put your own key, secret and refresh token in place of the examples.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
tiktok-cli login - 3
Save your TikTok details, so every new session has them.
Put your own key, secret and refresh token in place of the examples.
echo 'export TIKTOK_CLIENT_KEY=your_client_key' >> ~/.bashrc
echo 'export TIKTOK_CLIENT_SECRET=your_client_secret' >> ~/.bashrc
echo 'export TIKTOK_REFRESH_TOKEN=your_refresh_token' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
tiktok-cli doctor - 5
List every command, then try one.
tiktok-cli
tiktok-cli get-profile
Needs Node 22 or newer and a TikTok app of your own, with its client key and secret. Set it up.
It's free and open source. If it saves you time, star it on GitHub, so more people find it.
This free TikTok MCP server and CLI gives your AI real access to your TikTok account. It reads your videos and stats, ranks what worked, and publishes videos, photo carousels and drafts.
It's one install with two ways in. Claude, Codex, Cursor or any other MCP app calls its 14 tools for you, and the same tools work as a CLI that agents like Claude Code, Codex and OpenCode run, or that you type yourself.
In this guide, I'll show you:
- What the TikTok MCP server & CLI is, and what you can ask it
- How to install it and check that it works
- When to use the MCP server, and when the CLI
- Every tool, and how to keep your account safe
Every tool on this page comes from the server itself, and every cost was measured in Claude Code.
Key takeaways
What is the TikTok MCP server & CLI?
The TikTok MCP server & CLI is a free, open source program that lets AI agents work with your TikTok account for you, in two ways. The MCP server is what an AI app like Claude, Codex or Cursor connects to, through MCP (Model Context Protocol), the open standard AI apps use to call outside tools.
You ask in plain language. Your AI picks the right tool, and the server makes the call to TikTok's official API.
The CLI is the same program as commands. tiktok-cli top-videos runs the same code your AI runs when you ask which videos travelled, whether an agent like Claude Code runs it or you do.
In an AI OS, the layer that connects your AI to your context, your data and your tools, a server like this is how your AI reaches TikTok. My guide to building an AI operating system names TikTok among the tools it reaches, and here's how I use AI myself.
What can you ask it?
Once it's set up, you ask the way you'd ask an assistant. These are real prompts it handles:
Try askingWhich of my TikToks beat my median view count, and what do they have in common?
What is my real engagement rate per post, not the number the app shows me?
Rank my last 200 posts by shares rather than views.
Draft a TikTok from this MP4 and put it in my inbox, so I can review it on my phone.
Publish this photo carousel with the first image as the cover and comments off.
Did the video I posted 20 minutes ago clear moderation yet?
The third one shows why this is useful. TikTok's app sorts your videos by date, and here your AI can rank 200 of them by shares, the posts that actually travelled.
It works well next to my ScrapeCreators MCP server and YouTube MCP server, so your AI can study what other creators post and manage your YouTube videos in the same chat. Every server I've made is on my MCP servers page.
For the videos themselves, my free TikTok script generator and TikTok post analyzer help too. TikTok Shop is one of the ways I cover in ways to make money on your phone.
How to install the TikTok MCP server
Pick your app in the box at the top of this page. You get a refresh token once in a terminal, then add the server to your app with a single command or a pasted block.
Windsurf, Zed and Cline take the same server, though they don't have a tab in the box yet. Follow the box's Cursor tab, and put its block here instead:
| App | Where the block goes |
|---|---|
| Windsurf | In the Cascade panel, open the Actions menu (…) and choose Open MCP config file, then paste the block. |
| Cline | Click the MCP Servers icon in the Cline panel, open the Configure tab, click Configure MCP Servers, and paste the block. |
| Zed | Go to Settings, then AI, then MCP Servers, and choose Add Server, then Add Local Server. Enter the block's command, arguments and variables, and Zed saves them under context_servers. |
Pro tip: Use Sandbox mode while you set this up. A sandbox app works right away with no review, for TikTok accounts you add to it yourself.
Set up your TikTok app
TikTok has no personal access tokens, so everyone makes a small app of their own. It's more work than most platforms, and it's the same for everybody.
Get your refresh token
Run the login step with your app's key and secret. It prints a sign-in link, and once you approve, it prints a refresh token that lasts about 365 days.
export TIKTOK_CLIENT_KEY=your_client_key
export TIKTOK_CLIENT_SECRET=your_client_secret
npx -y @thenavidm/tiktok-mcp-cli loginAdd --publish to that command if you added the publishing scopes. Those three values go in your app's config, as the box at the top shows.
Watch out: Only ask for scopes your app actually has. One scope TikTok hasn't approved fails the sign-in completely, not just that permission.
Publishing needs a verified domain
TikTok pulls your video or photos from a link, and only from a domain you've proved you own. Verify it under URL properties on the app page, or skip this if you only read your stats or use drafts.
Check that it works
Run the doctor. It tests every connected account, names the scopes it was given, and says which tools are unavailable and why.
npx -y @thenavidm/tiktok-mcp-cli doctorA "token rejected" means the refresh token ran out or was revoked, so run the login step again.
In Claude Code, /mcp also shows whether the TikTok server is connected. It's one of the Claude Code commands worth knowing.
Use the TikTok CLI
The CLI is the same 14 tools as commands. AI agents that run commands, like Claude Code, Codex and OpenCode, use it on their own, and you can type the same commands in a terminal or a script.
Every tool name becomes a command with dashes, so top_videos runs as tiktok-cli top-videos.
npm install -g @thenavidm/tiktok-mcp-cli
tiktok-cli
tiktok-cli get-profile
tiktok-cli top-videosThe bare tiktok-cli lists every command, tiktok-cli which <words> finds the command for a task, and tiktok-cli <command> --help shows what a command takes. Publishing and revoking need --confirm, the terminal's version of your approval.
tiktok-cli install <app> adds the server to Claude Code, Codex, Claude Desktop, Cursor, VS Code or Gemini CLI, in each app's own format.
These are the flags you'll use most:
| Flag | What it does |
|---|---|
--json | Prints JSON |
--compact | Prints the JSON on one line |
--select a,b.c | Keeps only those fields, and a dotted path goes deeper |
--agent | Machine mode: compact JSON, no prompts, and it never confirms anything |
--confirm | Lets a write that asks first go ahead |
--dry-run | Shows what a write would do, without doing it |
A script can branch on the exit code:
| Exit code | What it means |
|---|---|
| 0 | It worked |
| 1 | Something unexpected went wrong |
| 2 | The command was typed wrong, or a write needed --confirm |
| 3 | It wasn't found |
| 4 | TikTok rejected the credentials |
| 5 | TikTok failed or couldn't be reached |
| 7 | You hit a rate limit, so wait and try again |
| 10 | Nothing is set up yet |
MCP server or CLI: which one?
Both are the same program with the same 14 tools. The difference is when your AI pays for them, in the tokens it reads.
- MCP server
- 5,400 tokens
- CLI
- Nothing
- MCP server
- 720 tokens
- CLI
- Nothing
- MCP server
- Nothing more, or in Claude Code the tools it picks
- CLI
- 3,200 tokens, once
- MCP server
- 108,000 tokens
- CLI
- 3,200 tokens
- MCP server
- Yes
- CLI
- No, there's no terminal there
- MCP server
- No
- CLI
- Yes
An app that loads every tool up front sends the full list with every message, whether you mention TikTok or not. Claude Code doesn't by default: its tool search sends only the tool names and the server's instructions, and loads a tool's full definition when your AI reaches for it.
The CLI costs nothing until TikTok comes up. Then your agent reads its skill file once and runs the commands it needs. With the skill added, Claude Code also lists its one-line description with every message, about 160 tokens.
When the whole conversation is about TikTok, the gap closes. Then the MCP server is the better experience, because you ask in plain language and your AI never has to look up a command.
How to spend less
In Claude Code, leave tool search on, which it is unless you've set ENABLE_TOOL_SEARCH=false.
Turn the server off when you aren't using TikTok. In Claude Code that's the /mcp panel, and every AI app has its own switch. TIKTOK_READ_ONLY=1 cuts it to the nine reading tools.
Or install the CLI and connect the server later, on the days it earns its place. Every tool stays in reach, and the standing cost drops to nothing.
Every number here was measured on October 5, 2026 in Claude Code 2.1.286 with Claude Opus 5.5. It's the same one-line prompt with and without the server connected, once with tool search off so every tool loads, and once with Claude Code's default. The skill was measured the same way, and other apps and models count tokens a little differently.
What TikTok's API can and can't do
TikTok's official API only sees your own account. There's no endpoint for anyone else's profile, videos, comments, hashtags or search, so no tool here can study a competitor or a trend.
There's no comments API either, even for your own posts. And until TikTok audits your app, every post goes up as private, whatever privacy you ask for.
Publishing returns a job, not a post. get_post_status follows it, and a public post has no post ID until moderation clears it, which usually takes a minute and sometimes hours.
Every TikTok tool
The tables below list all 14 tools, grouped the way the repo groups them. Of these, nine only read, and five change something on your account.
Your videos
list_videos- What it does
- Your public TikTok posts, newest first, with views, likes, comments, shares and a computed engagement rate.
- Kind
- Reads
get_videos- What it does
- Fetch up to 20 of your videos by id, with full stats.
- Kind
- Reads
top_videos- What it does
- Your best posts, ranked.
- Kind
- Reads
search_my_videos- What it does
- Find your posts whose title or description matches a query.
- Kind
- Reads
stats_summary- What it does
- Aggregate stats over your recent posts: total and mean views, the median and 90th percentile, mean engagement rate, and how many days apart you post.
- Kind
- Reads
Publishing
get_creator_info- What it does
- What this account is allowed to post: which privacy levels are available, whether comments, duet or stitch are switched off, and the longest video it may upload.
- Kind
- Reads
post_video- What it does
- Publish a video straight to the account from a public URL.
- Kind
- Asks first
post_photos- What it does
- Publish a photo carousel of up to 35 images from public URLs.
- Kind
- Asks first
send_video_to_drafts- What it does
- Send a video to the account's TikTok inbox instead of publishing it.
- Kind
- Writes
send_photos_to_drafts- What it does
- Send photos to the account's TikTok inbox for the creator to finish in the app.
- Kind
- Writes
get_post_status- What it does
- Track a post created by post_video, post_photos or either drafts tool.
- Kind
- Reads
Account
list_accounts- What it does
- Every TikTok account this server can act as, with the name to pass as
accounton any other tool. - Kind
- Reads
get_profile- What it does
- Profile and audience for a connected account: username, display name, bio, verified flag, follower and following counts, total likes across all videos, and how many videos are public.
- Kind
- Reads
revoke_access- What it does
- Hands the token back to TikTok and removes your app from the account's connected-apps list.
- Kind
- Asks first
Is the TikTok MCP server safe?
Publishing is the point of the tool, so writes work from the start. The three things you can't take back from a chat window ask first. They're the ones marked "Asks first" in the tool tables above.
Drafts don't ask, because they land in your own TikTok inbox and go nowhere until you finish them.
When your AI calls one of them, the call needs a yes first. Where you use it decides who gives it:
- Claude Code (2.1.246 and later) asks you before every call, in every one of its permission modes.
- An app that can show forms asks you in a form.
- Any other app takes your AI's
confirm: trueas the yes, so tell your AI to check with you first. - An agent with no person to ask needs
TIKTOK_CONFIRM=model, so itsconfirm: truecounts in every app. - In a terminal, you add
--confirmto the command.
If the answer is no, nothing reaches TikTok.
Make it read-only
Set TIKTOK_READ_ONLY=1 and every write disappears from the tool list, leaving nine reading tools. TIKTOK_ALLOW_DESTRUCTIVE=0 is the middle setting: drafts still work, and publishing and revoking don't.
Keep a log of every write
Set TIKTOK_AUDIT_LOG to a file path. The server writes one line per attempted write, allowed or blocked, with what it was about to do and who approved it.
Watch out: Captions and bios are text other people wrote, and one can try to give your AI orders. The server labels them as someone else's words, but TIKTOK_READ_ONLY=1 is the real defense for an agent working on its own.
Your data
Nothing goes anywhere but TikTok's API. Your key, secret and refresh token stay in your app's config or your shell, and there's no tracking of any kind.
To disconnect, call the revoke_access tool, or remove the app in TikTok under Settings, then Security and permissions, then Manage app permissions.
Connect more than one TikTok account
Run the login step once per account, then list them together in TIKTOK_ACCOUNTS as name:token,name:token. Every tool that acts as you takes an optional account, so you can say which one posts.
TikTok MCP server settings
Every setting is an environment variable, in your app's config or your shell.
TIKTOK_CLIENT_KEY- Default
- none
- What it does
- Holds your app's client key
TIKTOK_CLIENT_SECRET- Default
- none
- What it does
- Holds your app's client secret
TIKTOK_REFRESH_TOKEN- Default
- none
- What it does
- Holds what the login step printed, for one account
TIKTOK_ACCOUNTS- Default
- none
- What it does
- Lists several accounts as name:token pairs
TIKTOK_READ_ONLY- Default
0- What it does
1hides every write
TIKTOK_ALLOW_DESTRUCTIVE- Default
1- What it does
0keeps drafts and blocks publishing and revoking
TIKTOK_AUDIT_LOG- Default
- none
- What it does
- Logs every attempted write to a file
TIKTOK_SURFACE- Default
full- What it does
searchlists three tools that find, describe and run the rest
TIKTOK_TOOL_TIMEOUT_MS- Default
- none
- What it does
- Gives up on any tool after this many milliseconds
TIKTOK_CONFIRM- Default
human- What it does
modellets your AI'sconfirm: trueapprove on its own, for an agent with no person to ask
TIKTOK_HTTP_PORT- Default
8000- What it does
- Sets the port for
--http
TIKTOK_HTTP_HOST- Default
127.0.0.1- What it does
- Sets the address for
--http, and any other needs a token
TIKTOK_HTTP_TOKEN- Default
- none
- What it does
- Sets the bearer token every
--httprequest needs
TIKTOK_HTTP_ALLOWED_ORIGINS- Default
- none
- What it does
- Lists other websites allowed to call
--http, comma separated
TIKTOK_DEBUG- Default
- off
- What it does
1prints debug lines
Troubleshooting
Run the doctor first. It names the step that failed and the fix.
| What you see | What to do |
|---|---|
scope_not_authorized | The account never granted that scope. Run the login step again, with --publish for posting |
| The token is rejected on every call | The refresh token ran out after 365 days, or you revoked the app. Run the login step again |
A redirect_uri error during login | Your app's URI isn't exactly http://127.0.0.1:8481/callback/, usually the trailing slash |
| Login hangs and never returns | Port 8481 is taken. Run login --port 9000 and add that URI to your app too |
url_ownership_unverified | The media's domain isn't verified under URL properties |
| Everything posts as private | That's expected before TikTok audits your app. Post as private, or apply for the audit |
| Only nine tools appear | TIKTOK_READ_ONLY=1 is on, so the writes are hidden |
If the server doesn't show up in your app at all, run the command your app runs, in a terminal, and read the error.
More free TikTok tools
Check a caption's length before your AI posts it, or turn a post into an image to share.
Free tools
FAQs about the TikTok MCP server & CLI
Here are the questions people ask most about the TikTok MCP server and CLI.
The TikTok MCP server & CLI is a free, open source program that lets an AI app like Claude, Codex or Cursor work with your TikTok account.
It has 14 tools for your profile, video stats, top posts, publishing videos and photo carousels, drafts and post status, and the same tools run as a CLI that agents like Claude Code and Codex use, or that you type yourself.
An MCP server is a standard way to give an AI app real access to a tool, so it can act instead of guessing.
MCP stands for Model Context Protocol, and Claude, Codex, Cursor and many other AI apps speak it.
Every server I've made is on my MCP servers page.
The TikTok CLI is the same program as the TikTok MCP server, run as commands.
AI agents like Claude Code, Codex and OpenCode run them for you, and you can type them in a terminal or a script.
One npm package installs both.
Use the TikTok MCP server in an AI app with no terminal, like Claude Desktop's chat, and the CLI in a terminal, a script or a cron job.
In an AI app that can run commands, like Claude Code, Codex or Cursor, the CLI is the lighter choice, because it costs nothing until it runs.
Yes, the TikTok MCP server is free and open source under the MIT license.
TikTok's API is free too, so the only thing you pay for is your own AI app.
You need your own TikTok app because TikTok has no personal access tokens.
Every integration goes through an app you make at developers.tiktok.com, and Sandbox mode works right away with no review.
No, the TikTok MCP server only sees your own account.
TikTok's official API has no endpoint for anyone else's profile, videos, comments or search.
Everything posts as private until TikTok audits your app, whatever privacy level you ask for.
A sandbox app can't post publicly at all.
The TikTok MCP server posts when you ask it to.
Publishing and revoking wait for your approval in an app that can ask, like Claude Code, and read-only mode removes every write.
The TikTok refresh token lasts about 365 days, and the server renews the short access token for you.
When the refresh token runs out, run the login step again.
The TikTok MCP server works with any app that speaks MCP.
That includes Claude Code, Claude Desktop, Codex, Cursor, VS Code, Windsurf, Zed, Cline, GitHub Copilot CLI, Gemini CLI, OpenCode, OpenClaw, Antigravity and Hermes.
I did.
I'm Navid Moazzez, and I made the TikTok MCP server & CLI as one of my free tools on navid.me.
You can read more about me.
The code is on GitHub under the MIT license, and the package is on npm.
More MCP servers & CLIs
Related free tools
Navid.me is reader-supported. When you buy through links on this site, I may earn an affiliate commission. Read the affiliate disclaimer.
On this page
The most actionable AI newsletter for founders
Every week, get proven AI strategies, curated tools, and step-by-step systems to grow your audience, create better content, and build a profitable creator business.
No fluff, no filler, no BS. Just five minutes each week that might level up your online business and life.
P.S. Sign up now to get free access to my ultimate AI tools guide for creators.
