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

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.1.1

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.1.1
File Size Uploaded
crewai_tokportal-0.1.1.tar.gz 9.8 kB Details

Built distribution (wheel)

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

Total release size: 20.6 kB

Release files / crewai_tokportal-0.1.1.tar.gz

Download URL crewai_tokportal-0.1.1.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
846d0364c165e8445afa64bd947837e4db26cc10c4e368b5e10db31cb53cb431
BLAKE2b-256 checksum
How to use checksums
8943ab7148840b3ff8fc04b1ca2986a3543fc4ad231d00212e3c08687aed9324
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.1.1-py3-none-any.whl

Download URL crewai_tokportal-0.1.1-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d285279d0f7fab7a396a306d83bff31e013f1f36e1a4a164f47d00aad538ce67
BLAKE2b-256 checksum
How to use checksums
9d78d2b99975bd02ba0cce2f9f47dffb95e00f3bdeeae63399ff086ac9dc092f
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

0.2.0

2 release files

This release

0.1.1 This release

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