MCP Server
ExportComments ships an MCP (Model Context Protocol) server that gives AI assistants native access to your account — exports, the comment picker, webhooks, scheduled exports, usage info. Works with Claude Desktop, Claude Code, Claude on the web, Cursor, Windsurf, and any MCP-compatible client.
Two ways to use it:
| Hosted (recommended) | Self-installed (stdio) | |
|---|---|---|
| URL / command | https://mcp.exportcomments.com/mcp | npx -y exportcomments-cli |
| Auth | OAuth 2.0 (browser sign-in) or API token | API token or OAuth JWT in env var |
| Installation | None — paste the URL | Node.js 18+ on your machine |
| Best for | Claude on the web, Cursor, hosted clients | Claude Desktop, automation scripts |
Both expose the same 23 tools.
Opening https://mcp.exportcomments.com directly in a browser bounces to exportcomments.com — the host is an MCP JSON-RPC endpoint, not a website. Point your MCP client at https://mcp.exportcomments.com/mcp (note the path) for the actual service.
Hosted — Claude Desktop, Cursor, Claude web
Point your MCP client at https://mcp.exportcomments.com/mcp and let the OAuth flow handle credentials. On the first tool call you'll be redirected to exportcomments.com, sign in (same email/password you use today), click Authorize, and you're done. No tokens to copy.
Claude Desktop / Cursor — mcp_servers config
{"mcpServers": {"exportcomments": {"url": "https://mcp.exportcomments.com/mcp"}}}
On the first request the client sees a 401 Unauthorized with a WWW-Authenticate header pointing at our OAuth discovery doc, opens your browser to https://exportcomments.com/oauth/authorize, you approve, and the access token is stored in the client.
Claude on the web
Add a remote MCP server in Settings → Connections → Add custom MCP and paste https://mcp.exportcomments.com/mcp. Claude walks the OAuth flow automatically.
Already have an API token? Skip OAuth
If you'd rather use your existing API token instead of OAuth:
{"mcpServers": {"exportcomments": {"url": "https://mcp.exportcomments.com/mcp","headers": {"Authorization": "Bearer YOUR_API_TOKEN_HERE"}}}}
OAuth tokens are tied to your user and expire — convenient and revocable. API tokens are tied to your account, don't expire for 1 year, and are best for automation. Either one works with every tool.
Self-installed (stdio) — Claude Desktop
If you'd rather run the MCP server locally (Claude Desktop spawns the binary on your machine and talks to it over stdio), install the CLI:
npm install -g exportcomments-cli
Or use npx for zero-install (auto-updates):
npx -y exportcomments-cli
Then add to 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-cliexport EXPORTCOMMENTS_API_TOKEN="your-token-here"
Run directly
EXPORTCOMMENTS_API_TOKEN="your-token" exportcomments-mcp
OAuth flow (hosted)
The hosted MCP server speaks standard OAuth 2.0 with PKCE. Most clients handle this automatically — you'll only see this section if you're building your own MCP client.
Discovery — your client fetches
https://exportcomments.com/.well-known/oauth-authorization-serverand reads:json{"issuer": "https://exportcomments.com","authorization_endpoint": "https://exportcomments.com/oauth/authorize","token_endpoint": "https://exportcomments.com/oauth/token","scopes_supported": ["read", "write"],"code_challenge_methods_supported": ["S256"],"token_endpoint_auth_methods_supported": ["none"]}Authorize — open the user's browser at:
bashhttps://exportcomments.com/oauth/authorize?response_type=code&client_id=mcp&redirect_uri=<your_callback>&scope=read+write&state=<random>&code_challenge=<base64url(sha256(code_verifier))>&code_challenge_method=S256If the user isn't signed in, they're redirected to
/login?redirect=<this_URL>. After signing in they see the consent screen, click Authorize, and are sent toredirect_uri?code=...&state=....Token exchange — POST to
/oauth/token:bashgrant_type=authorization_codecode=<from callback>client_id=mcpredirect_uri=<same as step 2>code_verifier=<original verifier>Returns:
json{"access_token": "eyJ0eXA…","token_type": "Bearer","expires_in": 3600,"scope": "read write"}Use — send
Authorization: Bearer <access_token>on each MCP request tomcp.exportcomments.com.
Access tokens are JWTs that expire after 1 hour. When you get a 401, restart the OAuth flow (most clients do this automatically). Refresh tokens are coming in a future release.
Allowed redirect URIs
The mcp OAuth client accepts these redirect_uri values:
http://127.0.0.1:*(any port — for native loopback flows per RFC 8252)http://localhost:*https://claude.ai/api/mcp/auth_callback
If you're building a client that needs a different redirect URI, open a ticket and we'll add it to the allow-list.
Tools
The MCP server exposes 23 tools covering the full account surface — exports, the random comment picker, webhooks, scheduled exports, account info. See the tool reference for parameters and examples.
| Category | Tools |
|---|---|
| Exports | export_comments, check_export, list_exports, download_export |
| Discovery | detect_platform, list_platforms |
| Account | get_my_profile, get_my_quota, get_my_limits |
| Picker | pick_random_winners |
| Webhooks | list_webhooks, create_webhook, update_webhook, delete_webhook, toggle_webhook, test_webhook |
| Schedules | list_schedules, create_schedule, update_schedule, delete_schedule, run_schedule, pause_schedule, resume_schedule |
Example workflows
Export and download
An AI assistant can chain tools for a full workflow:
detect_platform— check what options the URL supports.export_commentswithwait=true— create the export, return when done.download_export— retrieve the raw JSON.
Pick giveaway winners
export_commentswithwait=true— get every comment on the giveaway post.pick_random_winnerswithcount=5, require_mention="@brand"— pick 5 random commenters who tagged the brand, deduped by username.
Recurring weekly export to a webhook
create_webhookwithevent="export.finished",url="https://your-app.com/hook"— set up the delivery channel.create_schedulewithurl=…,frequency="weekly",options.replies=true— schedule the export.
Every Monday the export runs, finishes, and your webhook gets the result.
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 tool responses are JSON, making it trivial for AI assistants to parse results and chain operations. Use wait=true on export_comments and check_export to get final results in a single round-trip.
Troubleshooting
"Unauthorized: missing or invalid Bearer token"
You're hitting the hosted MCP without auth. Either complete the OAuth flow or include Authorization: Bearer <token> in your MCP client config.
Hosted MCP responds 503 / connection refused
The hosted service is at mcp.exportcomments.com. Check status: curl -s https://mcp.exportcomments.com/health should return {"ok":true,…}. If not, check the status page or contact support.
npx exportcomments-mcp fails on Claude Desktop
Make sure Node.js 18+ is on your PATH. Claude Desktop sometimes can't see system Node — point command at the absolute path instead (e.g. /usr/local/bin/node + args: ["/path/to/node_modules/exportcomments-cli/dist/mcp.js"]).
Token expired (401 after an hour)
Hosted MCP access tokens currently expire after 1 hour. Most clients re-run the OAuth flow automatically. If yours doesn't, sign in again from your MCP client's settings.
