Skip to main content
Glama
tokportal

tokportal-mcp

Official
by tokportal

langchain-tokportal

PyPI CI License: MIT

TokPortal을 위한 LangChain / LangGraph 통합입니다.

TokPortal은 관리형 소셜 인프라 API입니다. 16개 이상 국가의 인간 계정 관리자가 생성하고, 워밍업하고, 운영하는 실제 TikTok, Instagram, YouTube 계정을 REST API와 MCP 서버로 노출합니다. 계정별 OAuth가 없고, 하루 25개 게시물 상한이 없으며, 앱 검토도 필요 없습니다.

이 패키지는 여러분의 에이전트가 TokPortal을 사용하는 두 가지 방법을 제공합니다:

모드

제공 기능

사용 시기

네이티브 도구 (toolkit.get_tools())

tokportal Python SDK를 감싸는 6개의 직접 작성된 BaseTool: 크레딧 잔액, 번들 생성, 비디오 구성, 번들 게시, 번들 조회, 계정 목록

단순 동기 에이전트, 런타임 시 MCP 의존성 불필요

MCP 도구 (await toolkit.aget_tools("mcp"))

langchain-mcp-adapters를 통해 로드된 원격 TokPortal MCP 서버의 모든 도구(90개 이상의 작업: 업로드, 워밍업, 분석, 웹훅, 댓글, 차단 등…)

전체 API 표면, 비동기 에이전트

설치

pip install langchain-tokportal
# optional, for the LangGraph example below
pip install langchain langchain-openai

https://app.tokportal.com/developer에서 API 키를 받아 내보내세요:

export TOKPORTAL_API_KEY=sk_...

Related MCP server: Outpost

빠른 시작 (네이티브 도구)

from langchain_tokportal import TokPortalToolkit

toolkit = TokPortalToolkit.from_api_key()          # reads TOKPORTAL_API_KEY
tools = toolkit.get_tools()

for tool in tools:
    print(tool.name)
# tokportal_get_credit_balance
# tokportal_create_bundle
# tokportal_configure_bundle_video
# tokportal_publish_bundle
# tokportal_get_bundle
# tokportal_list_accounts

print(tools[0].invoke({}))                          # -> {"data": {"balance": ...}}

모든 도구는 JSON 문자열을 반환합니다(원시 TokPortal data 엔벨로프, 또는 status, code, request_id, retryable 필드가 포함된 {"error": {...}} 객체 — 모델이 스스로 수정할 수 있도록).

LangGraph 에이전트 예제 (langchain.agents.create_agent, LangChain 1.x)

import asyncio

from langchain_openai import ChatOpenAI
from langchain.agents import create_agent

from langchain_tokportal import TokPortalToolkit

SYSTEM = (
    "You operate TokPortal, a managed social infrastructure API. "
    "Always check the credit balance before creating bundles. "
    "A bundle must be published for a human account manager to start working on it."
)


async def main() -> None:
    toolkit = TokPortalToolkit.from_api_key()

    # "native" = 6 SDK tools, "mcp" = full remote MCP tool set, "all" = both
    tools = await toolkit.aget_tools("mcp")

    agent = create_agent(ChatOpenAI(model="gpt-4.1"), tools, system_prompt=SYSTEM)

    result = await agent.ainvoke(
        {
            "messages": [
                (
                    "user",
                    "Order one new TikTok account in the US with 3 video slots and "
                    "advanced warming on the terms 'home workout', 'protein snacks', "
                    "'gym motivation'. Publish it and tell me the bundle id.",
                )
            ]
        }
    )
    print(result["messages"][-1].content)


asyncio.run(main())

동기 전용 코드 경로는 toolkit.get_mcp_tools()를 호출할 수 있습니다(asyncio.run 래핑).

MCP 연결 직접 사용

from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_tokportal import mcp_connection

client = MultiServerMCPClient({"tokportal": mcp_connection("sk_...")})
tools = await client.get_tools()

mcp_connection()https://app.tokportal.com/api/ext/mcp를 가리키며 Authorization: Bearer <api_key>를 포함하는 Streamable-HTTP 연결 딕셔너리를 반환합니다.

도구 참조 (네이티브)

도구

REST 작업

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

일반적인 흐름: get_credit_balancecreate_bundle (초안) → configure_bundle_video × N → publish_bundleget_bundle 폴링 또는 웹훅 구독.

리소스

라이선스

MIT

Install Server
A
license - permissive license
C
quality
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 Servers

  • A
    license
    -
    quality
    C
    maintenance
    Social media API and MCP server for AI agents that enables publishing to X, Instagram, LinkedIn, Reddit, Bluesky, and Threads from a single endpoint.
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server to manage social media accounts from AI assistants, enabling post creation, scheduling, publishing, and media uploads across multiple platforms.
    13
    23
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server for QPost that lets AI agents schedule and publish video/image posts to YouTube, TikTok, and Instagram via QPost's REST API.
    7
    507
    MIT

View all related MCP servers

Related MCP Connectors

  • Connect any AI agent to 11+ social platforms: schedule, publish & track posts via hosted MCP.

  • Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.

  • Hosted MCP with 91 agent tools: X, domains, SEO, Maps, Trends, Search, YouTube, TikTok, and more.

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/langchain-tokportal'

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