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
npm install -g exportcomments-cli
Or use npx for zero-install setup (recommended for MCP clients):
npx -y exportcomments-cli
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:
{"mcpServers": {"exportcomments": {"command": "npx","args": ["-y", "exportcomments-cli"],"env": {"EXPORTCOMMENTS_API_TOKEN": "your-token-here"}}}}
Claude Code
claude mcp add exportcomments -- npx -y exportcomments-cli
Then set the environment variable:
export EXPORTCOMMENTS_API_TOKEN="your-token-here"
Cursor
Add to your .cursor/mcp.json in your project root or global settings:
{"mcpServers": {"exportcomments": {"command": "npx","args": ["-y", "exportcomments-cli"],"env": {"EXPORTCOMMENTS_API_TOKEN": "your-token-here"}}}}
Windsurf
Add to your Windsurf MCP configuration:
{"mcpServers": {"exportcomments": {"command": "npx","args": ["-y", "exportcomments-cli"],"env": {"EXPORTCOMMENTS_API_TOKEN": "your-token-here"}}}}
Run Directly
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:
| Tool | Description |
|---|---|
export_comments | Create an export job for a URL with full option support |
check_export | Check job status by GUID, optionally wait for completion |
list_exports | List all export jobs with pagination |
download_export | Download raw JSON data for a completed job |
detect_platform | Identify platform from a URL and show available options |
list_platforms | List 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.
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: queueing → progress → done | error.
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.
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.
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.
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:
- detect_platform — check what options the URL supports
- export_comments with
wait=true— create the export and wait for completion - download_export — retrieve the raw JSON data
Monitor an existing job
- check_export with
wait=true— wait until the job finishes - download_export — get the results
Discover platforms
- list_platforms — see all supported platforms and their URL patterns
- detect_platform — verify a specific URL is supported before exporting
Response Format
All MCP tool responses return structured 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:
{"ok": false,"error": "Human-readable error message","error_code": "MACHINE_READABLE_CODE","detail": "Additional context"}
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.
