Skip to main content

crewai-tokportal

PyPI CI License: MIT

CrewAI integration for TokPortal.

TokPortal is the managed social infrastructure API: real TikTok and Instagram accounts created, warmed and operated by human account managers in 16+ countries — exposed as a REST API and an MCP server. No OAuth per account, no 25-posts/day cap, no app review.

Two ways to give your crew TokPortal super-powers:

Mode What you get When to use
Native tools (tokportal_tools()) 6 crewai.tools.BaseTool subclasses wrapping the tokportal Python SDK: credit balance, create bundle, configure video, publish bundle, get bundle, list accounts Lightweight, no MCP dependency
MCP (tokportal_mcp_server() / tokportal_mcp_adapter()) Every tool of the remote TokPortal MCP server (90+ operations: uploads, warming, analytics, webhooks, comments, bans…) Full API surface

Installation

pip install crewai-tokportal
# for the MCP variants:
pip install "crewai-tokportal[mcp]"     # == crewai-tools[mcp]

Get an API key at https://app.tokportal.com/developer:

export TOKPORTAL_API_KEY=sk_...

Crew example (native tools)

from crewai import Agent, Crew, Task

from crewai_tokportal import tokportal_tools

operator = Agent(
    role="TokPortal operator",
    goal="Order and schedule managed social accounts for the marketing team",
    backstory=(
        "You operate TokPortal, a managed social infrastructure API. You always check the "
        "credit balance first, create a bundle, configure its videos, then publish it so a "
        "human account manager can start."
    ),
    tools=tokportal_tools(),          # reads TOKPORTAL_API_KEY; or tokportal_tools("sk_...")
    llm="gpt-4.1",
    verbose=True,
)

order = Task(
    description=(
        "Order one new TikTok account in the US with 3 video slots and advanced warming on "
        "'home workout', 'protein snacks', 'gym motivation'. Publish the bundle and report "
        "its id and status."
    ),
    expected_output="The bundle id, its status, and the remaining credit balance.",
    agent=operator,
)

crew = Crew(agents=[operator], tasks=[order])
print(crew.kickoff())

Every tool returns a JSON string: the TokPortal data envelope, or {"error": {"status", "code", "message", "request_id", "retryable"}} so the agent can self-correct.

Full MCP tool set

Recommended: Agent(mcps=[...]) (CrewAI ≥ 1.x)

from crewai import Agent
from crewai_tokportal import tokportal_mcp_server

agent = Agent(
    role="TokPortal operator",
    goal="...",
    backstory="...",
    mcps=[tokportal_mcp_server()],   # MCPServerHTTP, streamable HTTP + Bearer auth
    llm="gpt-4.1",
)

tokportal_mcp_server() accepts MCPServerHTTP kwargs such as tool_filter= or cache_tools_list=True.

Legacy: MCPServerAdapter context manager

from crewai import Agent
from crewai_tools import MCPServerAdapter
from crewai_tokportal import tokportal_mcp_adapter

with MCPServerAdapter(tokportal_mcp_adapter(), connect_timeout=60) as mcp_tools:
    agent = Agent(role="...", goal="...", backstory="...", tools=mcp_tools, llm="gpt-4.1")
    ...

tokportal_mcp_adapter() returns {"url": "https://app.tokportal.com/api/ext/mcp", "transport": "streamable-http", "headers": {"Authorization": "Bearer sk_..."}}.

Tool reference (native)

Tool REST operation
tokportal_get_credit_balance GET /credits/balance
tokportal_create_bundle POST /bundles
tokportal_configure_bundle_video PUT /bundles/{id}/videos/{position}
tokportal_publish_bundle POST /bundles/{id}/publish
tokportal_get_bundle GET /bundles/{id}
tokportal_list_accounts GET /accounts

Individual classes are exported too (TokPortalCreateBundle(api_key=...), …).

Resources

License

MIT

Metadata

Release files for crewai-tokportal 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crewai-tokportal 0.2.0
File Size Uploaded
crewai_tokportal-0.2.0.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crewai-tokportal 0.2.0
File Interpreter ABI Platform
crewai_tokportal-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 kB

Release files / crewai_tokportal-0.2.0.tar.gz

Download URL crewai_tokportal-0.2.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cd8bfd0743f63701e3b74bf4a98119a2ec6c56bb8706f90966dc0d0e50f0e0f9
BLAKE2b-256 checksum
How to use checksums
6d615d89fb905fb7d265d2be8316a94380fd2f4c10691457ec0ce6684b531a96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / crewai_tokportal-0.2.0-py3-none-any.whl

Download URL crewai_tokportal-0.2.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56c8cece8384be345a2aa379f99f5a2a9f3a7f2a0755446e4d824771dd1feb8c
BLAKE2b-256 checksum
How to use checksums
00deeb8a67ab6c4a42c988895485634b71095dd9369f7f9437189aa3633d3b06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page