tokportal-mcp
Officiallangchain-tokportal
Integración con LangChain / LangGraph para TokPortal.
TokPortal es la API de infraestructura social gestionada: cuentas reales de TikTok, Instagram y YouTube creadas, calentadas y operadas por gestores de cuentas humanos en más de 16 países, expuestas como una API REST y un servidor MCP. Sin OAuth por cuenta, sin límite de 25 publicaciones/día, sin revisión de aplicación.
Este paquete ofrece a tus agentes dos formas de utilizar TokPortal:
Modo | Qué obtienes | Cuándo usarlo |
Herramientas nativas ( | 6 | Agentes síncronos simples, sin dependencia MCP en tiempo de ejecución |
Herramientas MCP ( | Todas las herramientas del servidor MCP remoto de TokPortal (más de 90 operaciones: subidas, calentamiento, analíticas, webhooks, comentarios, baneos…) cargadas a través de | Superficie API completa, agentes asíncronos |
Instalación
pip install langchain-tokportal
# optional, for the LangGraph example below
pip install langchain langchain-openaiObtén una clave API en https://app.tokportal.com/developer y expórtala:
export TOKPORTAL_API_KEY=sk_...Related MCP server: Outpost
Inicio rápido (herramientas nativas)
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": ...}}Cada herramienta devuelve una cadena JSON (el envoltorio data de TokPortal, o un
objeto {"error": {...}} con status, code, request_id y retryable
para que el modelo pueda autocorregirse).
Ejemplo de agente 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())Las rutas de código solo síncronas pueden llamar a toolkit.get_mcp_tools() (envuelve asyncio.run).
Usando la conexión MCP directamente
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() devuelve un diccionario de conexión Streamable-HTTP que apunta a
https://app.tokportal.com/api/ext/mcp con Authorization: Bearer <api_key>.
Referencia de herramientas (nativas)
Herramienta | Operación REST |
|
|
|
|
|
|
|
|
|
|
|
|
Flujo típico: get_credit_balance → create_bundle (borrador) → configure_bundle_video × N → publish_bundle → consultar get_bundle o suscribirse a webhooks.
Recursos
Documentación de la API: https://developers.tokportal.com
Servidor MCP: https://developers.tokportal.com/mcp (remoto
https://app.tokportal.com/api/ext/mcp, stdionpx -y tokportal-mcp)SDK de Python: https://github.com/tokportal/tokportal-python
Soporte: team@tokportal.com
Licencia
MIT
Maintenance
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
- Flicense-qualityCmaintenanceEnables AI agents to create, schedule, and manage social media posts across 10 platforms via a unified API.
- Alicense-qualityCmaintenanceSocial media API and MCP server for AI agents that enables publishing to X, Instagram, LinkedIn, Reddit, Bluesky, and Threads from a single endpoint.1MIT
- AlicenseAqualityBmaintenanceMCP server to manage social media accounts from AI assistants, enabling post creation, scheduling, publishing, and media uploads across multiple platforms.13231MIT
- AlicenseAqualityCmaintenanceMCP server for QPost that lets AI agents schedule and publish video/image posts to YouTube, TikTok, and Instagram via QPost's REST API.7507MIT
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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