Managed TikTok/Instagram/YouTube accounts + video posting at scale, operated by human managers.
TokPortal is the managed social infrastructure API: real TikTok and Instagram brand accounts created, warmed and operated by human account managers in 16+ countries, exposed as a REST API and an MCP server. Run geo-sharding across markets without connecting every social account through OAuth. YouTube bundle creation is not available through this API.
Upgrade before using the sandbox: local tokportal-mcp requires 1.15.1 or newer for dry_run. Version 1.15.0 advertised the argument but did not send the sandbox header, so a preview could execute a real operation. Upgrade and restart an older local server first. If you cannot verify the running local version, use the remote connector or REST with X-TokPortal-Dry-Run: true.
Docs https://developers.tokportal.com · API base https://app.tokportal.com/api/ext · OpenAPI https://developers.tokportal.com/openapi.json · MCP remote https://app.tokportal.com/api/ext/mcp · Get an API key https://app.tokportal.com/developer/api-keys?utm_source=npm&utm_medium=readme&utm_campaign=tokportal-mcp · llms.txt https://developers.tokportal.com/llms.txt
tokportal-mcp is the official Model Context Protocol server for the TokPortal API. It exposes every public API operation (91 tools) to Claude, Cursor, VS Code, Windsurf, Codex, Gemini CLI and any other MCP client — create bundles, upload videos, configure and publish accounts, read analytics, manage webhooks.
Two ways to use it:
| Mode | Transport | When to use |
|---|---|---|
Local (npx tokportal-mcp@1.15.1) | stdio | Desktop clients, local agents, file uploads from disk |
Remote (https://app.tokportal.com/api/ext/mcp) | Streamable HTTP | Hosted agents, no install; same tool catalogue |
Requires Node.js 20 or newer. The local server runs on it directly. Get an API key at https://app.tokportal.com/developer/api-keys?utm_source=npm&utm_medium=readme&utm_campaign=tokportal-mcp (format sk_ + 64 hex chars).
npm install -g tokportal-mcp@1.15.1
TOKPORTAL_API_KEY=sk_your_key_here tokportal-mcp
The server speaks MCP over stdio. Point any MCP client at it and ask, for example:
"Read the available countries, credit prices and my balance. Preview a TikTok account-only bundle in the USA with dry_run: true. Show me the immediate and recurring costs, and wait for my GO before any live purchase."
The preview calls tokportal_create_bundle with { "dry_run": true, "body": { "bundle_type": "account_only", "platform": "tiktok", "country": "USA" } }. It validates the request and returns credits_would_charge with credits_charged: 0, without creating work. Creation in live mode is charged immediately. Preview IDs are synthetic and must never be reused in live requests. After GO, create the real resources and use their live IDs. See the sandbox contract.
Programmatic read-only smoke test for local stdio with the MCP SDK (this does not test or use the sandbox):
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@1.15.1"],
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);
The local stdio snippets pin version 1.15.1, which forwards the sandbox header. Restart the server after updating an existing configuration. For a global installation, run npm install --global tokportal-mcp@1.15.1 and restart the server. Replace sk_your_key_here with your key.
~/.cursor/mcp.json (or .cursor/mcp.json in a project):
{
"mcpServers": {
"tokportal": {
"command": "npx",
"args": ["-y", "tokportal-mcp@1.15.1"],
"env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
}
}
}
claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"tokportal": {
"command": "npx",
"args": ["-y", "tokportal-mcp@1.15.1"],
"env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
}
}
}
claude mcp add tokportal -e TOKPORTAL_API_KEY=sk_your_key_here -- npx -y tokportal-mcp@1.15.1
# 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"
.vscode/mcp.json:
{
"servers": {
"tokportal": {
"type": "stdio",
"command": "npx",
"args": ["-y", "tokportal-mcp@1.15.1"],
"env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
}
}
}
~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"tokportal": {
"command": "npx",
"args": ["-y", "tokportal-mcp@1.15.1"],
"env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
}
}
}
~/.codex/config.toml:
[mcp_servers.tokportal]
command = "npx"
args = ["-y", "tokportal-mcp@1.15.1"]
env = { TOKPORTAL_API_KEY = "sk_your_key_here" }
~/.gemini/settings.json:
{
"mcpServers": {
"tokportal": {
"command": "npx",
"args": ["-y", "tokportal-mcp@1.15.1"],
"env": { "TOKPORTAL_API_KEY": "sk_your_key_here" }
}
}
}
Any client that supports remote MCP servers can connect to
https://app.tokportal.com/api/ext/mcp with either an X-API-Key: sk_... header
or Authorization: Bearer sk_.... Example for clients using the url form:
{
"mcpServers": {
"tokportal": {
"url": "https://app.tokportal.com/api/ext/mcp",
"headers": { "X-API-Key": "sk_your_key_here" }
}
}
}
| Variable | Required | Description |
|---|---|---|
TOKPORTAL_API_KEY | yes | API key (sk_ + 64 hex). Only a SHA-256 hash is stored server-side. |
TOKPORTAL_BASE_URL | no | Defaults to https://app.tokportal.com/api/ext. |
The server exposes TokPortal API actions as MCP tools over stdio. It is generated from the public API schema and uses the same X-API-Key authentication as the HTTP API.
tokportal_<operation_id_snake_case> (tokportal_create_bundle, tokportal_list_accounts, ...). Path and query parameters are top-level inputs; JSON bodies go in body.title, readOnlyHint, destructiveHint, idempotentHint and openWorldHint. Read the annotations on each tool: paid operations and irreversible actions can be destructive even when they do not delete anything.dry_run: true, sent as X-TokPortal-Dry-Run: true. It is never placed in the query or request body. Dry runs consume normal rate limits but do not consume an idempotency_key; use the same key for a later live request if its operation supports idempotency.file_path, with the remaining form fields exposed by their schema names.idempotency_key (sent as Idempotency-Key) except for secret-bearing operations (credential reveal, verification codes, webhook creation, signed upload URLs, report creation) which are never replayed.Local version 1.15.1 sends X-TokPortal-Client: tokportal-mcp/1.15.1 on API requests for observability and support diagnostics.
Failed tool calls return an error result with a diagnostics object containing request_id, retry_after_seconds, and rate_limit when those headers are available.
Legacy config using the globally installed binary still works:
{
"mcpServers": {
"tokportal": {
"command": "tokportal-mcp",
"env": {
"TOKPORTAL_API_KEY": "sk_your_key_here"
}
}
}
}
This package is generated from the TokPortal public OpenAPI schema
(https://developers.tokportal.com/openapi.json) in the private TokPortal
monorepo. src/generated.ts is regenerated on every release — do not edit it by
hand. See CONTRIBUTING.md for what we accept as PRs and
SECURITY.md for vulnerability reporting.
@tokportal/node · @tokportal/cli · tokportal (PyPI) · github.com/tokportal/tokportal-goMIT © TokPortal
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y tokportal-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"com-tokportal-mcp": {
"command": "npx",
"args": [
"-y",
"tokportal-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceTokPortal works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.