Go to App

MCP Server

The CLI includes an MCP (Model Context Protocol) server that gives AI assistants native access to ExportComments tools. Works with Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP-compatible client.

Installation

bash
npm install -g exportcomments-cli

Or use npx for zero-install setup (recommended for MCP clients):

bash
npx -y exportcomments-cli
💡
npm package

The MCP server is part of the exportcomments-cli npm package. Node.js 18+ required.

Setup

Claude Desktop

Add to your claude_desktop_config.json:

json
{
"mcpServers": {
"exportcomments": {
"command": "npx",
"args": ["-y", "exportcomments-cli"],
"env": {
"EXPORTCOMMENTS_API_TOKEN": "your-token-here"
}
}
}
}

Claude Code

bash
claude mcp add exportcomments -- npx -y exportcomments-cli

Then set the environment variable:

bash
export EXPORTCOMMENTS_API_TOKEN="your-token-here"

Cursor

Add to your .cursor/mcp.json in your project root or global settings:

json
{
"mcpServers": {
"exportcomments": {
"command": "npx",
"args": ["-y", "exportcomments-cli"],
"env": {
"EXPORTCOMMENTS_API_TOKEN": "your-token-here"
}
}
}
}

Windsurf

Add to your Windsurf MCP configuration:

json
{
"mcpServers": {
"exportcomments": {
"command": "npx",
"args": ["-y", "exportcomments-cli"],
"env": {
"EXPORTCOMMENTS_API_TOKEN": "your-token-here"
}
}
}
}

Run Directly

bash
EXPORTCOMMENTS_API_TOKEN="your-token" exportcomments-mcp

Authentication

Get your API token from the API dashboard. The MCP server reads it from the EXPORTCOMMENTS_API_TOKEN environment variable.

Available Tools

The MCP server exposes 6 tools to AI assistants:

ToolDescription
export_commentsCreate an export job for a URL with full option support
check_exportCheck job status by GUID, optionally wait for completion
list_exportsList all export jobs with pagination
download_exportDownload raw JSON data for a completed job
detect_platformIdentify platform from a URL and show available options
list_platformsList all 33+ supported platforms

Tool Parameters

export_comments

Create a new export job to extract comments or reviews from a URL. Supports 33+ platforms including Instagram, YouTube, TikTok, Facebook, Twitter/X, Reddit, Amazon, Trustpilot, and more. Returns a job GUID for tracking.

ParameterTypeDescription

urlrequiredstringThe URL to export comments/reviews from repliesbooleanInclude replies to comments limitnumberMaximum number of items to export min_datestringMinimum date filter (ISO 8601, e.g. 2024-01-15) max_datestringMaximum date filter (ISO 8601, e.g. 2024-06-30) vpnstringUse VPN with specified country (e.g. "Norway") cookiesobjectCookies for authenticated access (e.g. {"sessionid": "abc"}) tweetsbooleanInclude tweets (Twitter/X only) followersbooleanExport followers list (Twitter/X only) followingbooleanExport following list (Twitter/X only) likesbooleanExport likes data sharesbooleanInclude shares data advancedbooleanEnable advanced export features facebook_adsbooleanInclude Facebook ads data waitbooleanWait for export to complete before returning (polls every 5s, timeout 10min) realtimebooleanUse WebSocket for real-time updates instead of polling (implies wait=true)

check_export

Check the status of an export job by its GUID. Returns full job details including status, progress, download URLs, and error info. Job statuses: queueingprogressdone | error.

ParameterTypeDescription

guidrequiredstringThe job GUID returned by export_comments waitbooleanWait for export to complete before returning realtimebooleanUse WebSocket for real-time updates instead of polling (implies wait=true)

list_exports

List all export jobs for the authenticated account with pagination.

ParameterTypeDescription

pagenumberPage number (default: 1) limitnumberItems per page (default: 20)

download_export

Download the raw JSON data for a completed export job. Returns the actual exported comments/reviews as structured JSON data. The job must have status done.

ParameterTypeDescription

guidrequiredstringThe job GUID to download data for

detect_platform

Detect which platform a URL belongs to and return supported options. Use this before export_comments to understand what options are available for a URL.

ParameterTypeDescription

urlrequiredstringThe URL to detect the platform for

list_platforms

List all 33+ supported platforms with their URL patterns, export options, and example URLs. No parameters required.

Example Workflows

Export and download comments

An AI agent can chain tools together for a complete workflow:

  1. detect_platform — check what options the URL supports
  2. export_comments with wait=true — create the export and wait for completion
  3. download_export — retrieve the raw JSON data

Monitor an existing job

  1. check_export with wait=true — wait until the job finishes
  2. download_export — get the results

Discover platforms

  1. list_platforms — see all supported platforms and their URL patterns
  2. detect_platform — verify a specific URL is supported before exporting

Response Format

All MCP tool responses return structured JSON:

json
{
"ok": true,
"data": {
"id": 12345,
"guid": "b4219d47-3138-5efd-9762-2ef9f9495084",
"status": "done",
"url": "https://www.instagram.com/p/ABC123/",
"totalComments": 342,
"exportedComments": 342,
"downloadUrl": "https://exportcomments.com/api/v3/job/b4219d47-.../download"
}
}

On error:

json
{
"ok": false,
"error": "Human-readable error message",
"error_code": "MACHINE_READABLE_CODE",
"detail": "Additional context"
}
💡
AI-optimized output

All MCP tool responses return structured JSON, making it easy for AI assistants to parse results and chain multiple operations together. Use wait=true on export_comments and check_export to get final results in a single call.