MCP Server

MCP Server – AI Integration for Cursor & Claude

Connect Cursor, Claude Desktop, or any MCP-compatible AI tool to TokPortal for automated campaign management.

Model Context Protocol (MCP)

Connect your AI tools to TokPortal using MCP

The Model Context Protocol (MCP) is a standard for connecting Large Language Models (LLMs) to platforms like TokPortal. Once connected, your AI assistant can create bundles, configure accounts and videos, track analytics, and manage your entire TokPortal workflow — all through natural language.

TIP: Using claude.ai (web or mobile)? Skip the config file. Add TokPortal as a one-click Remote Connector with OAuth login — no API key to paste. This page covers the local npm package for Cursor, Claude Desktop, Windsurf and agents.

Quick Setup

Step 1: Get an API key

Generate an API key from the Developer Portal. Your key starts with sk_ and is shown only once.

Step 2: Configure your AI tool

Add TokPortal MCP to Cursor

Or manually add to .cursor/mcp.json:

{
  "mcpServers": {
    "tokportal": {
      "command": "npx",
      "args": ["-y", "tokportal-mcp"],
      "env": {
        "TOKPORTAL_API_KEY": "sk_your_key_here"
      }
    }
  }
}

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "tokportal": {
      "command": "npx",
      "args": ["-y", "tokportal-mcp"],
      "env": {
        "TOKPORTAL_API_KEY": "sk_your_key_here"
      }
    }
  }
}

Windsurf / Other MCP clients

Use the same configuration format. The MCP server runs via npx tokportal-mcp — no installation required.

Step 3: Verify the connection

After setup, verify the connection by asking your AI assistant:

"What is my TokPortal credit balance? Use MCP tools."

If connected, the assistant will call the get_credit_balance tool and return your current balance.

Available Tools

The TokPortal MCP server is generated from the public OpenAPI schema. The full generated surface currently exposes 78 operations, but most workflows only need a small subset: auth, credits, bundles, videos, webhooks, uploads, and analytics.

Error Diagnostics

When an API request fails, MCP tool output includes the original API payload plus diagnostics:

{
  "payload": {
    "error": {
      "code": "RATE_LIMIT_EXCEEDED",
      "message": "Rate limit exceeded."
    }
  },
  "diagnostics": {
    "request_id": "req_...",
    "retry_after_seconds": 1,
    "rate_limit": {
      "limit": 120,
      "remaining": 0,
      "reset": 1779724800
    }
  }
}

Use request_id when contacting support. Use retry_after_seconds before retrying a rate-limited tool call.

ToolDescription
tokportal_get_current_userGet authenticated user
tokportal_list_countriesList available countries
tokportal_list_platformsList available platforms
tokportal_get_credit_costsGet credit pricing
tokportal_get_credit_balanceGet credit balance
tokportal_list_credit_transactionsList credit transactions
tokportal_list_bundlesList bundles
tokportal_create_bundleCreate a bundle
tokportal_create_bundles_bulkCreate bundles in bulk
tokportal_get_bundleGet a bundle
tokportal_publish_bundlePublish a bundle
tokportal_get_bundle_publish_readinessCheck bundle publish readiness
tokportal_unpublish_bundleUnpublish a bundle
tokportal_add_video_slotsAdd video slots to a bundle
tokportal_add_edit_slotsAdd edit slots to a bundle
tokportal_get_bundle_accountGet bundle account configuration
tokportal_configure_bundle_accountConfigure bundle account profile
tokportal_get_bundle_videoGet video slot configuration
tokportal_configure_bundle_videoConfigure a video slot
tokportal_patch_bundle_videoPatch video references
tokportal_batch_configure_bundle_videosConfigure video slots in bulk
tokportal_publish_all_bundle_videosPublish all configured videos on an active bundle
tokportal_list_accountsList delivered accounts
tokportal_get_accountGet a delivered account
tokportal_list_account_bundlesList bundles for a delivered account
tokportal_retrieve_account_verification_codeRetrieve latest account verification code
tokportal_reveal_account_credentialsReveal delivered account credentials
tokportal_get_account_edit_requestGet active account edit request
tokportal_create_account_edit_requestRequest profile edits for a delivered account
tokportal_list_webhook_endpointsList webhook endpoints
tokportal_create_webhook_endpointCreate a webhook endpoint
tokportal_get_webhook_endpointGet a webhook endpoint
tokportal_update_webhook_endpointUpdate a webhook endpoint
tokportal_delete_webhook_endpointDelete a webhook endpoint
tokportal_list_webhook_deliveriesList webhook deliveries
tokportal_test_webhook_endpointSend a test webhook
tokportal_get_analytics_dashboardGet analytics dashboard
tokportal_get_analytics_seriesGet analytics time series
tokportal_get_analytics_accountGet account analytics drilldown
tokportal_get_account_analyticsGet account analytics compatibility view
tokportal_list_account_video_analyticsList post analytics for an account
tokportal_get_video_analyticsGet single video analytics
tokportal_get_comment_pulseGet comment pulse analytics
tokportal_list_analytics_account_commentsList comments for an account post
tokportal_list_comment_tasksList comment tasks
tokportal_create_comment_tasksCreate comment tasks
tokportal_get_comment_taskGet a comment task
tokportal_delete_comment_taskDelete a comment task
tokportal_approve_comment_taskApprove a manually confirmed comment task
tokportal_dispute_comment_taskDispute a manually confirmed comment task
tokportal_list_comment_task_verificationsList comment task verification events

Usage Examples

Once connected, you can use natural language to interact with TokPortal:

Create a campaign:

"Create a TikTok bundle in the US with 10 videos and niche warming for gaming content"

Configure videos:

"Configure videos 1-5 on my latest bundle with these descriptions and schedule them one day apart starting March 15"

Check analytics:

"Show me the analytics for all my US TikTok accounts, sorted by engagement rate"

Manage workflow:

"List all my published bundles and show me which ones have videos pending review"

Get verification codes:

"Get the verification code for my account @mybrand_us"

npm Package

The MCP server is published as tokportal-mcp on npm.

npx tokportal-mcp

No installation required — npx downloads and runs it automatically.

Security

  • Your API key is stored locally in your MCP configuration file and is never sent anywhere except to the TokPortal API.
  • The MCP server runs locally on your machine as a stdio process.
  • All communication with TokPortal uses HTTPS.
  • We recommend using separate API keys for MCP and other integrations.
  • You can revoke API keys at any time from the Developer Portal.