Skip to main content
Glama
tokportal

tokportal-mcp

Official
by tokportal

tokportal-mcp

npm license

TokPortal 是托管型社交基础设施 API:由来自 16 个以上国家/地区的人工账户管理员创建、预热并运营真实的 TikTok、Instagram 和 YouTube 账户——通过 REST API 和 MCP 服务器暴露。无需每个账户的 OAuth,没有每天 25 条帖子的限制,也无需应用审核。

文档 https://developers.tokportal.com · API 基础地址 https://app.tokportal.com/api/ext · OpenAPI https://developers.tokportal.com/openapi.json · MCP 远程地址 https://app.tokportal.com/api/ext/mcp · 获取 API 密钥 https://app.tokportal.com/developer/api-keys · llms.txt https://developers.tokportal.com/llms.txt


tokportal-mcp 是 TokPortal API 的官方 模型上下文协议 服务器。它将所有公开的 API 操作(91 个工具)暴露给 Claude、Cursor、VS Code、Windsurf、Codex、Gemini CLI 以及任何其他 MCP 客户端——创建包、上传视频、配置和发布账户、读取分析数据、管理 Webhook。

两种使用方式:

模式

传输方式

使用场景

本地npx tokportal-mcp

stdio

桌面客户端、本地代理、从磁盘上传文件

远程https://app.tokportal.com/api/ext/mcp

流式 HTTP

托管代理、无需安装;工具目录相同

本地服务器需要 Node.js 20 或更高版本。在 https://app.tokportal.com/developer/api-keys 获取 API 密钥(格式为 sk_ + 64 个十六进制字符)。

30 秒快速入门

npm install -g tokportal-mcp
TOKPORTAL_API_KEY=sk_your_key_here tokportal-mcp

该服务器通过 stdio 使用 MCP 协议。将任意 MCP 客户端指向它,然后询问,例如:

"在美国创建一个包含 5 个视频的 TikTok 包,上传 ./launch.mp4 作为视频 1,并附上标题 'Day 1',然后发布该包。"

该调用链会依次使用 tokportal_create_bundletokportal_upload_video_directtokportal_configure_bundle_videotokportal_publish_bundle

使用 MCP SDK 进行编程式冒烟测试:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

const client = new Client({ name: "demo", version: "1.0.0" });
await client.connect(
  new StdioClientTransport({
    command: "npx",
    args: ["-y", "tokportal-mcp"],
    env: { ...process.env, TOKPORTAL_API_KEY: process.env.TOKPORTAL_API_KEY },
  }),
);

const { tools } = await client.listTools(); // 91 tools
const me = await client.callTool({ name: "tokportal_get_current_user", arguments: {} });
console.log(tools.length, me.content[0].text);

客户端配置

sk_your_key_here 替换为你的密钥。以下每个片段均为本地 stdio 服务器;远程 URL 变体列在末尾。

Cursor

~/.cursor/mcp.json(或项目中的 .cursor/mcp.json):

{
  "mcpServers": {
    "tokportal": {
      "command": "npx",
      "args": ["-y", "tokportal-mcp"],
      "env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
    }
  }
}

Claude Desktop

claude_desktop_config.json(macOS:~/Library/Application Support/Claude/,Windows:%APPDATA%\Claude\):

{
  "mcpServers": {
    "tokportal": {
      "command": "npx",
      "args": ["-y", "tokportal-mcp"],
      "env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
    }
  }
}

Claude Code

claude mcp add tokportal -e TOKPORTAL_API_KEY=sk_your_key_here -- npx -y tokportal-mcp
# or the remote server:
claude mcp add --transport http tokportal https://app.tokportal.com/api/ext/mcp --header "X-API-Key: sk_your_key_here"

VS Code(GitHub Copilot 代理模式)

.vscode/mcp.json

{
  "servers": {
    "tokportal": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "tokportal-mcp"],
      "env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
    }
  }
}

Windsurf

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "tokportal": {
      "command": "npx",
      "args": ["-y", "tokportal-mcp"],
      "env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
    }
  }
}

OpenAI Codex CLI

~/.codex/config.toml

[mcp_servers.tokportal]
command = "npx"
args = ["-y", "tokportal-mcp"]
env = { TOKPORTAL_API_KEY = "sk_your_key_here" }

Gemini CLI

~/.gemini/settings.json

{
  "mcpServers": {
    "tokportal": {
      "command": "npx",
      "args": ["-y", "tokportal-mcp"],
      "env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
    }
  }
}

远程服务器(流式 HTTP)

任何支持远程 MCP 服务器的客户端都可以连接到 https://app.tokportal.com/api/ext/mcp,并附带 X-API-Key: sk_... 标头 或 Authorization: Bearer sk_...。使用 url 形式的客户端示例:

{
  "mcpServers": {
    "tokportal": {
      "url": "https://app.tokportal.com/api/ext/mcp",
      "headers": { "X-API-Key": "sk_your_key_here" }
    }
  }
}

环境变量

变量

必需

描述

TOKPORTAL_API_KEY

API 密钥(sk_ + 64 个十六进制字符)。服务器端仅存储 SHA-256 哈希。

TOKPORTAL_BASE_URL

默认为 https://app.tokportal.com/api/ext

工具工作原理

该服务器将 TokPortal API 操作作为 MCP 工具通过 stdio 暴露。它是根据公开的 API 模式生成的,并使用与 HTTP API 相同的 X-API-Key 身份验证。

  • 工具名称格式为 tokportal_<操作名_蛇形命名>tokportal_create_bundletokportal_list_accounts 等)。路径和查询参数是顶级输入;JSON 正文放在 body 中。

  • 每个工具都带有 MCP 注解:titlereadOnlyHint(GET)、destructiveHint(DELETE / 取消 / 取消发布 / 重置 / 取消调度 / 撤销)、idempotentHint(GET/PUT/DELETE)以及 openWorldHint: false,以便客户端可以在破坏性调用时请求确认。

  • 多部分上传工具也是从 OpenAPI 生成的。二进制字段作为本地路径输入暴露,例如 file_path,其余表单字段按其模式名称暴露。

  • 变更操作接受可选的 idempotency_key(作为 Idempotency-Key 发送),但涉及机密的操作(凭证揭示、验证码、Webhook 创建、签名上传 URL、报告创建)除外,这些操作从不重放。

MCP 服务器在 API 请求中发送 X-TokPortal-Client: tokportal-mcp/1.12.1,用于可观测性和支持诊断。

工具调用失败会返回一个包含 diagnostics 对象的错误结果,该对象在可用时包含 request_idretry_after_secondsrate_limit

使用全局安装的二进制文件的旧配置仍然有效:

{
  "mcpServers": {
    "tokportal": {
      "command": "tokportal-mcp",
      "env": {
        "TOKPORTAL_API_KEY": "sk_your_key_here"
      }
    }
  }
}

事实来源

此包是根据 TokPortal 公开的 OpenAPI 模式 (https://developers.tokportal.com/openapi.json)在私有 TokPortal 单体仓库中生成的。src/generated.ts 在每次发布时都会重新生成——请勿手动编辑。 关于我们接受的 PR,请参阅 CONTRIBUTING.md; 关于漏洞报告,请参阅 SECURITY.md

链接

MIT © TokPortal

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

  • Official MCP server for Lovable, the AI-powered full-stack app builder.

  • This MCP server provides seamless access to Malaysia's government open data, including datasets, w…

  • MCP server for NanoBanana AI image generation and editing

View all MCP Connectors

Latest Blog Posts

MCP directory API

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

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

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