# Use TokPortal from Dify

Source: https://developers.tokportal.com/agents/dify/
Markdown: https://developers.tokportal.com/agents/dify.md

Dify is a workflow / low-code platform: Open-source LLM app platform; MCP servers are registered under Tools → MCP and used by Agent nodes and Agent apps. Connected to the TokPortal MCP server (or the REST API), it can create geo-targeted TikTok and Instagram accounts, schedule videos, warm accounts, read analytics and follow the ban lifecycle — 91 `tokportal_*` tools generated from the [public OpenAPI schema](https://developers.tokportal.com/api-reference).

## Connect TokPortal to Dify

**Tools → MCP → Add MCP Server (HTTP)**:

- **Server URL**: `https://app.tokportal.com/api/ext/mcp`
- **Name**: `TokPortal` · **Server Identifier**: `tokportal` (do not change it later)
- Authentication: complete the OAuth authorization Dify offers, or add a header `X-API-Key: sk_...` if your Dify version exposes custom headers.

Then add the TokPortal tools to an **Agent** node (Chatflow/Workflow) or an Agent app.

Snippet status: **best-effort** — follows Dify's documented pattern ([source](https://docs.dify.ai/en/cloud/use-dify/build/mcp)).

**Try it**

```text
Evaluate this workflow in the TokPortal sandbox only.
Use the remote MCP endpoint https://app.tokportal.com/api/ext/mcp or local tokportal-mcp 1.15.1 or later for write tools.
Verify the installed local version before using its write tools. Version 1.15.0 is unsafe for simulations.
If the local version is older or unknown, use the remote endpoint or authenticated REST
requests with X-TokPortal-Dry-Run: true instead.
For every non-GET MCP tool call, set dry_run: true as a top-level boolean beside body.
For every REST write in a workflow, send the X-TokPortal-Dry-Run: true header.
Use normal read tools for existing real objects. Do not GET or poll synthetic IDs,
and do not upload files to simulated upload URLs. Simulated objects have no cross-call memory.
Show credits_would_charge and verify credits_charged is 0 for each simulated write.
Do not execute any live write. Ask for my explicit GO before the first real write,
including bundle creation, which charges immediately. After GO, repeat creation
without dry_run and use the new real IDs; never reuse synthetic IDs in live requests.

Agent instruction: "You manage TikTok accounts through TokPortal tools.
Always call tokportal_get_credit_costs before create_bundle and
show the user the cost. Ask for confirmation before publish_bundle."
```

## Try the workflow without spending

For this trial, use the remote MCP endpoint `https://app.tokportal.com/api/ext/mcp`, local `tokportal-mcp` **1.15.1 or later**, or the REST API. Upgrade and restart an older local server first. Version 1.15.0 does not forward the dry-run header; do not use its write tools for a simulation. If you cannot verify the installed local version, use the remote endpoint or REST.

Use the [sandbox](https://developers.tokportal.com/sandbox) for the first attempt. MCP write tools accept `dry_run: true` as a top-level argument, beside `body`; REST writes accept the `X-TokPortal-Dry-Run: true` header. Keep your usual authentication and scopes. Each simulated write validates the request and returns `credits_would_charge` with `credits_charged: 0`. Nothing is created or published.

Simulated IDs start with `00000000-0000-4000-8000-`. Use them only in later dry-run writes. GET requests read real data, so skip publish-readiness checks and polling for synthetic IDs. Simulations have no cross-call memory and upload URLs are placeholders: do not upload files to them.

To run for real, review the returned price and confirm **before the first live write**. Bundle creation charges credits immediately; publishing hands the order to a manager. Repeat creation without dry-run mode and use the new real IDs for configuration and publishing. A synthetic ID cannot be reused in a live request.

**Try a free account-creation request**

```text
Evaluate this workflow in the TokPortal sandbox only.
Use the remote MCP endpoint https://app.tokportal.com/api/ext/mcp or local tokportal-mcp 1.15.1 or later for write tools.
Verify the installed local version before using its write tools. Version 1.15.0 is unsafe for simulations.
If the local version is older or unknown, use the remote endpoint or authenticated REST
requests with X-TokPortal-Dry-Run: true instead.
For every non-GET MCP tool call, set dry_run: true as a top-level boolean beside body.
For every REST write in a workflow, send the X-TokPortal-Dry-Run: true header.
Use normal read tools for existing real objects. Do not GET or poll synthetic IDs,
and do not upload files to simulated upload URLs. Simulated objects have no cross-call memory.
Show credits_would_charge and verify credits_charged is 0 for each simulated write.
Do not execute any live write. Ask for my explicit GO before the first real write,
including bundle creation, which charges immediately. After GO, repeat creation
without dry_run and use the new real IDs; never reuse synthetic IDs in live requests.

Use the TokPortal MCP tools. Call tokportal_list_countries, then simulate tokportal_create_bundle with bundle_type account_only, platform tiktok and a country returned as available for new accounts. Show the returned credits_would_charge. If your connector is read-only, explain which scope is missing instead of making a live request.
```

## Jobs you can run from Dify

- [Create TikTok accounts](https://developers.tokportal.com/agents/dify/create-tiktok-accounts) — Create geo-targeted TikTok accounts from Dify with the TokPortal MCP tools: create\_bundle → configure\_bundle\_account → publish\_bundle → list\_accounts.
- [Post 100 TikTok videos a day](https://developers.tokportal.com/agents/dify/post-100-videos-a-day) — Post 100+ TikTok videos a day from Dify: spread slots across ≥34 TokPortal bundles (3 videos/day/bundle cap), batch-configure, publish, track finalization.
- [Run US TikTok accounts from abroad](https://developers.tokportal.com/agents/dify/us-tiktok-accounts-from-abroad) — Operate US TikTok accounts from anywhere with Dify: TokPortal creates and posts on accounts held by US-based managers — no VPN, no US SIM, no per-account OAuth.
- [Warm TikTok & Instagram accounts](https://developers.tokportal.com/agents/dify/warm-accounts) — Warm accounts on niche search terms from Dify: generate\_warming\_terms → configure\_bundle\_warming\_terms / rewarm\_account, verified sessions, warming.\* webhooks.
- [Run a faceless TikTok channel](https://developers.tokportal.com/agents/dify/faceless-channel) — Run a faceless TikTok channel from Dify: AI-generated clips → upload\_video → 3 dated posts a day via batch\_configure\_bundle\_videos, AI label on, human-operated account.
- [Seed UGC across many accounts](https://developers.tokportal.com/agents/dify/ugc-seeding) — Seed UGC from Dify: the same creative on N geo-targeted TikTok/Instagram accounts via create\_bundles\_bulk, disclose\_as\_ads, per-account analytics.
- [Seed a music sound on TikTok](https://developers.tokportal.com/agents/dify/music-sound-seeding) — Seed a TikTok sound from Dify: many geo-targeted accounts posting with tiktok\_sound\_url on the same track, staggered dates, per-video analytics for the label.
- [Launch an app with persona accounts](https://developers.tokportal.com/agents/dify/app-persona-launch) — Launch an app with persona accounts from Dify: several TikTok/Instagram characters, each a managed account with bio link, warming and a 30-day content plan.
- [Run multi-client agency operations](https://developers.tokportal.com/agents/dify/agency-multi-client) — Run an agency's TikTok/Instagram operations from Dify: per-client external\_ref, bulk account fleets, videos\_only reposting, ban webhooks and per-client analytics exports.
- [Get ban alerts via webhooks](https://developers.tokportal.com/agents/dify/ban-webhooks) — Get TikTok/Instagram ban alerts from Dify: create\_webhook\_endpoint for account.banned, ban\_appeal.submitted, ban\_resolution.decided; list\_account\_bans as source of truth.
- [Pull analytics across all accounts](https://developers.tokportal.com/agents/dify/analytics-multi-account) — Pull TikTok/Instagram analytics across every managed account from Dify: get\_analytics\_dashboard, get\_analytics\_series, list\_account\_video\_analytics, CSV/HTML exports.
- [Create Instagram accounts](https://developers.tokportal.com/agents/dify/create-instagram-accounts) — Create geo-targeted Instagram accounts from Dify with TokPortal: create\_bundle platform=instagram → configure\_bundle\_account → publish\_bundle; Reels, posts, carousels.

## Other agents

[Claude](https://developers.tokportal.com/agents/claude) · [Claude Code](https://developers.tokportal.com/agents/claude-code) · [ChatGPT](https://developers.tokportal.com/agents/chatgpt) · [OpenAI Codex](https://developers.tokportal.com/agents/codex) · [Cursor](https://developers.tokportal.com/agents/cursor) · [Windsurf](https://developers.tokportal.com/agents/windsurf) · [Cline](https://developers.tokportal.com/agents/cline) · [OpenClaw](https://developers.tokportal.com/agents/openclaw) · [Hermes Agent](https://developers.tokportal.com/agents/hermes-agent) · [Gemini CLI](https://developers.tokportal.com/agents/gemini-cli) · [Goose](https://developers.tokportal.com/agents/goose) · [Perplexity](https://developers.tokportal.com/agents/perplexity) · [Microsoft Copilot Studio](https://developers.tokportal.com/agents/copilot-studio) · [Factory Droid](https://developers.tokportal.com/agents/factory-droid) · [n8n](https://developers.tokportal.com/agents/n8n) · [Make](https://developers.tokportal.com/agents/make) · [Zapier](https://developers.tokportal.com/agents/zapier) · [Pipedream](https://developers.tokportal.com/agents/pipedream) · [Flowise](https://developers.tokportal.com/agents/flowise) · [Langflow](https://developers.tokportal.com/agents/langflow) · [CrewAI](https://developers.tokportal.com/agents/crewai) · [LangChain](https://developers.tokportal.com/agents/langchain) · [Vercel AI SDK](https://developers.tokportal.com/agents/vercel-ai-sdk) · [Mastra](https://developers.tokportal.com/agents/mastra)

See also: [MCP server](https://developers.tokportal.com/mcp) · [Getting started](https://developers.tokportal.com/getting-started) · [Credits & Pricing](https://developers.tokportal.com/credits).
