Skip to main content

crewai-tokportal

PyPI CI License: MIT

CrewAI integration for TokPortal.

TokPortal is the managed social infrastructure API: real TikTok, Instagram and YouTube 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crewai_tokportal-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crewai_tokportal-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file crewai_tokportal-0.1.0.tar.gz.

File metadata

  • Download URL: crewai_tokportal-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.12

File hashes

Hashes for crewai_tokportal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60c330993eabc6758160e27693591121f0d2eec23a71cd001e50f3461adae988
MD5 7f1cb34c949448ed36c35fce9de20c24
BLAKE2b-256 ccf6af497affb931c48f2f247ac73abccf27c5ddae0621411a4728c213a9e47a

See more details on using hashes here.

File details

Details for the file crewai_tokportal-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crewai_tokportal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25f3e310a614534fb5ec0e0c4560084a146c04cb37b733c28322fb25c4215f2d
MD5 e1f95c40b81620fe28fffab18267da68
BLAKE2b-256 f6c83fa5f4f4f60e88b06c0e4c6b78e4bdffd2824074351a8e75a17988dfd7ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page