How to Give AI Agents Live Social Media Data (MCP and API Guide for Claude, ChatGPT and Cursor)
How to Give AI Agents Live Social Media Data (MCP and API Guide for Claude, ChatGPT and Cursor)
Social media data for AI agents comes from three places: official platform APIs, scrapers you run yourself, or a read-only data API exposed as an MCP server. The MCP route is the fastest to set up. One API key gives Claude, ChatGPT, Cursor, or any agent public profiles, posts, comments, search, transcripts, and audience data across 17 networks. It never logs in and never reads private data.
This guide covers each path's trade-offs, a fair vendor comparison, verbatim setup for every major client, a live data read taken on December 4, 2026, pricing models, legality, and the failure modes that stop most installs.
The three ways to get social media data into an AI agent
An agent cannot browse Instagram or TikTok reliably on its own. Pages are rendered with JavaScript, gated by login walls, and protected by anti-bot systems. A recent arXiv benchmark on social-media agent tasks found that current LLMs struggle on these tasks without good tool access. The model needs a tool that returns structured data, and there are three ways to give it one.
Official platform APIs
Official APIs are the sanctioned source. When they expose a field, it is usually authoritative. They are also the hardest path for a general-purpose agent:
- Per-platform auth. Each network has its own developer account, app review, OAuth scopes, and token refresh logic. Six networks means six integrations.
- Gating. The TikTok Research API is limited to academic and non-profit researchers, and commercial or agent use is not permitted (TikTok for Developers). LinkedIn's data APIs are effectively partner-gated. The Instagram Graph API requires a business or creator account and returns audience demographics only to the account holder.
- Cost and quotas. The X API moved to pay-per-use as its default in early 2026, after a period of fixed paid tiers. Check their pricing page for current rates. The YouTube Data API v3 gives a default quota of 10,000 units per day, and search calls cost far more units than simple reads (quota cost table). Reddit's Data API has a free non-commercial tier, and its commercial pricing is not public.
- Restrictive terms. Many official terms limit storage, redistribution, or use with AI models.
Choose official APIs when you need to publish (post, reply, upload), when you need data about your own account that only the owner can see, or when your compliance team requires a direct contract with the platform.
Self-run scrapers
You can write your own headless-browser or HTTP scraper, or rent scrapers from a marketplace. You control everything, and at very large volume the per-request cost can be low.
The costs show up elsewhere:
- Breakage. Platforms change markup and internal endpoints often. Someone has to fix the scraper every time.
- Infrastructure. You need proxy rotation, CAPTCHA handling, retries, and rate-limit backoff.
- Schema drift. Every scraper returns its own JSON shape. Your agent needs a separate tool definition per network, and the model has to reason over inconsistent field names.
- Legal exposure. Scraping that logs in, uses cookies, or bypasses technical barriers carries far more risk than reading public pages (see the legality section below).
Choose self-run scrapers when you have a dedicated data engineering team, very high volume on one or two networks, and a lawyer who has reviewed your method.
A read-only data API or MCP server
The third path is a hosted, read-only API that normalizes public data from many networks into one schema, exposed both as REST and as an MCP server. SocialLens works this way: one key, 17 networks, one JSON shape, and an is_exact flag on every count.
The trade-offs, stated plainly:
- It is read-only. It cannot post, like, reply, or send messages. That is deliberate.
- Public data only. It cannot see private accounts, DMs, or anything behind a login.
- Coverage is focused. 17 networks is broad for a single schema, but a scraper marketplace with thousands of community-built scrapers covers more long-tail sites.
- Not the cheapest at extreme volume. If you pull hundreds of millions of records a month from one network, a dedicated pipeline you run yourself can cost less per record.
- A third-party dependency. You rely on a vendor's uptime instead of your own.
Choose this path when you want an agent working in minutes, need consistent data across many networks, and want a design that never touches logged-in sessions. For a deeper look at the one-schema model, see the unified social media data API guide.
Quick decision guide
| Your situation | Best path |
|---|---|
| Agent must publish posts or reply to DMs | Official API for that platform |
| Need your own account's private analytics | Official API with owner OAuth |
| Need public data from several networks in one agent | Read-only data API / MCP server |
| Academic research on TikTok with approval | TikTok Research API |
| Hundreds of millions of records from one network, in-house team | Self-run scraper pipeline |
| Prototype in an afternoon inside Claude or Cursor | MCP server |
What a social media MCP server is and how it works
The Model Context Protocol (MCP) is an open standard for connecting AI applications to external tools and data. An MCP server advertises a list of tools, each with a name, a description, and a JSON input schema. The AI client reads that list, and the model decides when to call a tool and with what arguments. If you are new to the protocol, start with what an MCP server is.
A social media MCP server is an MCP server whose tools read social data. With SocialLens, the primary tool is get_social_profile: the model passes a platform and a username, and the server returns public profile JSON. Other read tools cover posts, comments, search, and transcripts.
MCP supports three transports. stdio runs the server as a local subprocess of the client. Streamable HTTP is the recommended remote transport. HTTP+SSE is the legacy remote transport. SocialLens ships as a local stdio server that you launch with npx. It runs on your machine and calls the SocialLens API over HTTPS with your key.
You: "Compare MrBeast's TikTok and Instagram audiences"
|
v
+-----------------------------------------------+
| AI agent (Claude, Cursor, custom agent) |
+-----------------------------------------------+
|
v
+-----------------------------------------------+
| MCP client (built into the app) |
+-----------------------------------------------+
| stdio, local subprocess
v
+-----------------------------------------------+
| SocialLens MCP server (npx sociallens-mcp) |
| runs on your machine, holds SOCIALLENS_API_KEY|
+-----------------------------------------------+
| HTTPS, Authorization: Bearer key
v
+-----------------------------------------------+
| api.sociallens.dev |
+-----------------------------------------------+
============== READ-ONLY BOUNDARY ===============
public data only | no login | no cookies | no DMs
=================================================
|
v
Public data on 17 networks: TikTok, Instagram, YouTube,
Facebook, X, Reddit, LinkedIn, Threads, Pinterest, Telegram,
Bluesky, Truth Social, Cosmos, SoundCloud, Kwai, GitHub, Spotify
For a longer architecture walkthrough, see the social media MCP server deep dive.
What an agent CAN and CANNOT read
An agent connected to SocialLens can read:
- Public profiles: name, bio, verification, follower and following counts, post counts, links
- Public posts from a profile, and any public post by URL
- Public comments on a post
- Follower and following listings (TikTok)
- Keyword search results
- Video transcripts
- Audience demographics
- An
is_exactflag on every count, so the model knows whether a number is precise
An agent connected to SocialLens cannot:
- Log in to any account, or use your cookies or sessions
- Read private accounts, close-friends lists, or followers-only content
- Read DMs, inboxes, or any message content
- See owner-only analytics such as private impressions or saved counts
- Post, like, follow, comment, or send anything (it has no write tools)
The difference between a read MCP and a publish MCP matters for safety. A publish MCP holds credentials that can act as you, so a prompt-injection attack could make it post. A read-only MCP has no such capability. The worst an injected instruction can do is trigger an extra read.
Comparison: official APIs, data vendors, and SocialLens
This table compares the approaches on the dimensions that matter to an agent builder. Vendor details change often. Figures and features reflect public information as of late 2026, and you should check each vendor's current docs and pricing page. "Not verified" means we found no public first-party MCP server at the time of writing. It does not mean one cannot exist.
| Approach / vendor | Networks covered | Auth complexity | Data precision | Read or publish | Cost model | Has an MCP server |
|---|---|---|---|---|---|---|
| X API (official) | X only | Developer account, OAuth, app setup | Exact for exposed fields | Read and publish | Pay-per-use by default since early 2026 (check pricing) | No first-party MCP found |
| Instagram / Meta Graph API | Instagram, Facebook | Business or creator account, app review, OAuth | Exact; demographics only to the account holder | Read and publish (own assets) | Free API, heavy access requirements | No first-party MCP found |
| TikTok Research API | TikTok | Academic or non-profit application | Exact within scope | Read only | Free within a quota; no commercial use | No |
| YouTube Data API v3 | YouTube | Google Cloud project, API key or OAuth | Subscriber counts rounded by the platform | Read and publish | Free; 10,000 units/day default quota | No first-party MCP found |
| Reddit Data API | OAuth app registration | Exact for exposed fields | Read and publish | Free non-commercial; commercial pricing not public | No first-party MCP found | |
| LinkedIn API | Effectively partner-gated | Exact within scope | Read and publish (approved partners) | Partner agreements | No | |
| Self-run scraper | Whatever you build | You manage proxies, CAPTCHAs, sessions | Whatever you parse | Usually read | Infrastructure plus engineering time | You build it |
| Apify | Many, via separate Actors | One account; each Actor has its own inputs | Varies by Actor | Mostly read | Usage-based, per Actor | Yes, hosted social content MCP |
| Bright Data | Many major networks | One account | Varies by dataset | Read (public posts, hashtags, trends) | Usage-based, with a free tier | Yes, social media MCP |
| EnsembleData | Several networks | One API token | Varies by endpoint | Read | Daily "units" allowance | None found |
| HikerAPI | One API key | Varies by endpoint | Read | Pay-per-request | Not verified | |
| Data365 | Several, per-network plans | One account, per-network plans | Varies | Read | Subscription plus credits; credit cost varies by request type | Not verified |
| RapidAPI | Many, via third-party APIs | Marketplace key, but each API differs | Varies by provider | Varies | Per-API pricing; no unified schema | Not as a unified social MCP |
| Phyllo | Creator-connected platforms | The creator must connect their account | Exact for connected accounts | Read (consented) | Platform pricing; consent-based | Not verified |
| Modash | Major creator platforms | One account | Large index; precision varies | Read (discovery plus metrics) | Enterprise subscription | Not verified |
| HypeAuditor | Major creator platforms | One account | Large index; fraud and authenticity focus | Read | Enterprise subscription | Not verified |
| SocialLens | 17 networks | One API key for all | Exact where the platform allows; is_exact flag on every count |
Read only | One key, simple pricing | Yes, local stdio MCP (dev.sociallens/sociallens-mcp) |
How to read the table:
- Breadth. Apify and RapidAPI reach more total sites through their marketplaces. The cost of that breadth is that every scraper or API returns a different shape. SocialLens covers fewer sites in exchange for one schema across all 17.
- Precision. Few vendors say whether a count is exact or rounded. SocialLens returns
is_exacton every count, so an agent comparing creators never mixes a precise TikTok number with a rounded YouTube one without knowing it. - Discovery. Modash and HypeAuditor maintain very large pre-indexed creator databases. If your core job is filtering millions of influencers by niche, they are built for that. SocialLens reads live and on demand.
- Consent. Phyllo's consent model unlocks owner-only data, including demographics, but only for creators who connect their accounts. SocialLens never requires the creator to connect anything, and it never sees owner-only data.
For the official-API side in more depth, read official social media APIs vs one API. For buyer-focused MCP options, see the best social media MCP server.
Connect SocialLens to your AI agent
Every client below uses the same local stdio server. The client launches npx -y sociallens-mcp as a subprocess and passes your key as an environment variable.
Before you start:
- Install Node.js (it provides
npx). Runnpx --versionin a terminal to confirm it works. - Create an account at sociallens.dev/register.
- Generate a key at sociallens.dev/keys. Live keys start with
sk_live_. - Keep the key out of version control. Treat it like a password.
Full agent documentation lives at sociallens.dev/agents. The server is listed in the MCP registry as dev.sociallens/sociallens-mcp.
Claude Code
- Open a terminal in your project.
- Run this single command, replacing the key:
claude mcp add --env SOCIALLENS_API_KEY=sk_live_YOUR_KEY --transport stdio sociallens -- npx -y sociallens-mcp
- Confirm it registered with
claude mcp list. - Inside a Claude Code session, run
/mcpto see the server's status and tools. - Ask: "Use sociallens to get the TikTok profile for mrbeast and tell me whether the follower count is exact."
Scope matters. By default, claude mcp add uses --scope local, which applies to the current project and only you. --scope user makes the server available in all your projects. --scope project writes it to .mcp.json in the repo root, which is shared via version control. If you use project scope, do not commit a raw key. Claude Code's .mcp.json supports ${VAR} expansion in env, so you can reference an environment variable instead. The official reference is at code.claude.com. For prompts and workflows, see the Claude social media data guide.
Claude Desktop
- Open Claude Desktop, then go to Settings > Developer > Edit Config. This opens
claude_desktop_config.json:- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/
- macOS:
- Add this block. If the file already has an
mcpServersobject, add only thesociallensentry inside it:
{
"mcpServers": {
"sociallens": {
"command": "npx",
"args": ["-y", "sociallens-mcp"],
"env": { "SOCIALLENS_API_KEY": "sk_live_YOUR_KEY" }
}
}
}
- Save the file.
- Fully quit Claude Desktop and reopen it. Closing the window is not enough. On macOS use Cmd+Q, and on Windows quit from the system tray.
- Check that the SocialLens tools appear in the tools menu, then ask a question that needs live data.
Cursor
- Choose a scope:
- Project:
.cursor/mcp.jsonin your repo - Global:
~/.cursor/mcp.jsonfor all projects
- Project:
- Paste the same block used for Claude Desktop:
{
"mcpServers": {
"sociallens": {
"command": "npx",
"args": ["-y", "sociallens-mcp"],
"env": { "SOCIALLENS_API_KEY": "sk_live_YOUR_KEY" }
}
}
}
- Alternatively, add it through Settings > Tools and Integrations > New MCP Server.
- Confirm the server shows as enabled with its tools listed, then use it from Agent mode.
If the same server name exists in both files, the project file wins. Cursor-specific tips are in the Cursor social media data guide.
ChatGPT (Custom GPT Actions)
ChatGPT Custom GPTs call HTTP APIs through Actions defined by an OpenAPI spec. That makes the REST API the right path here, not the local stdio server.
- In ChatGPT, create a GPT and open Configure > Actions > Create new action.
- Choose Import from URL and enter
https://sociallens.dev/openapi.json. - Under Authentication, select API Key, auth type Bearer, and paste your
sk_live_key. - Save, then test in the preview pane: "Get the Instagram profile for instagram."
The full walkthrough, including instructions text for the GPT, is in the ChatGPT Custom GPT guide.
Raw HTTP and function calling
Any model with function calling can use the REST endpoint directly:
curl -s "https://api.sociallens.dev/v1/profile?platform=tiktok&username=mrbeast" \
-H "Authorization: Bearer YOUR_KEY"
A minimal tool definition you can hand to a function-calling model:
{
"name": "get_social_profile",
"description": "Read a public social media profile. Returns followers, following, bio, verification and an is_exact flag. Read-only, public data only.",
"parameters": {
"type": "object",
"properties": {
"platform": { "type": "string", "description": "e.g. tiktok, instagram, youtube, x, bluesky" },
"username": { "type": "string" }
},
"required": ["platform", "username"]
}
}
Your code receives the tool call, makes the GET request, and returns the JSON to the model. For no-code builders and tool-definition patterns, see social media data for AI agents without code.
Agent frameworks
- MCP-capable frameworks. Spawn the server as a stdio subprocess with command
npx, args["-y", "sociallens-mcp"], andSOCIALLENS_API_KEYin the environment. The tool list is discovered automatically. - OpenAPI-based agents. Import
https://sociallens.dev/openapi.jsonand set a Bearer auth header. - Headless runs. The Claude Agent SDK and
claude -pcannot complete interactive OAuth flows. SocialLens uses an environment key rather than OAuth, so headless runs work as long as the variable is set.
A real live read (worked example)
The following responses were read live through SocialLens on December 4, 2026. They are unedited apart from formatting.
Example A: Instagram's official account
{
"exists": true,
"username": "instagram",
"platform": "instagram",
"nickname": "Instagram",
"verified": true,
"private": false,
"followers": 684224272,
"is_exact": true,
"following": 182,
"videos": 8666,
"bio": "Discover what's new on Instagram",
"id": "25025320",
"external_link": "http://help.instagram.com",
"fetched_at": "2026-12-04T06:17:45Z",
"cached": false
}
fetched_at is 2026-12-04T06:17:45Z, and cached is false, so this was a fresh read rather than a stored copy. is_exact is true, so 684,224,272 is a precise count, not a display figure like "684M".
Example B: the same schema on TikTok
{
"exists": true,
"username": "mrbeast",
"platform": "tiktok",
"nickname": "MrBeast",
"verified": true,
"private": false,
"followers": 149191425,
"followers_rounded": 149200000,
"is_exact": true,
"following": 346,
"likes": 1589270586,
"videos": 494,
"bio": "Checkout my new video",
"created_at": "2018-10-20T19:26:16Z",
"fetched_at": "2026-12-04T06:17:50Z",
"cached": false
}
TikTok's app shows a rounded figure. followers_rounded (149,200,000) is what a human sees on the page. followers (149,191,425) is the exact count. The difference here is 8,575 followers. When an agent tracks daily growth, a rounded figure would hide that kind of movement entirely.
Same schema, two networks
| Field | Instagram (instagram) |
TikTok (mrbeast) |
|---|---|---|
exists |
true | true |
platform |
tiktok | |
verified |
true | true |
private |
false | false |
followers |
684224272 | 149191425 |
is_exact |
true | true |
following |
182 | 346 |
videos |
8666 | 494 |
| Network-specific extras | id, external_link |
followers_rounded, likes, created_at |
fetched_at |
2026-12-04T06:17:45Z | 2026-12-04T06:17:50Z |
The core fields share names and types. Network-specific extras are added rather than renamed. An agent prompt like "compare followers across platforms" works without per-network parsing logic.
Exact vs rounded follower counts by network
This is original first-party data. Of the 13 networks read, 12 returned an exact count. Only YouTube returned a rounded figure, because YouTube itself only exposes rounded subscriber counts.
| Network | Example account | Followers | is_exact |
|---|---|---|---|
| 684,224,272 | true | ||
| YouTube | MrBeast | 529,000,000 | false (platform exposes rounded only) |
| 154,884,697 | true | ||
| TikTok | mrbeast | 149,191,425 | true |
| X | x | 60,553,777 | true |
| Bluesky | bsky.app | 35,999,975 | true |
| Truth Social | realDonaldTrump | 13,216,045 | true |
| Telegram | durov | 9,810,719 | true |
| 6,274,022 | true | ||
| Threads | zuck | 5,791,538 | true |
| Cosmos | cosmos | 5,246,157 | true |
| SoundCloud | soundcloud | 2,381,300 | true |
| GitHub | github | 98,011 | true |
Methodology: each account was read live through the SocialLens profile endpoint on 2026-12-04. The followers value and is_exact flag are reported exactly as returned.
Why the flag matters: if an agent subtracts yesterday's YouTube figure from today's and gets zero, the true answer may be "unknown at this precision," not "no growth." With is_exact: false, the model can say so instead of stating a false certainty.
Fetch a live number without a key
Humans and AI crawlers can check a current, dated figure without an API key at:
https://sociallens.dev/lookup?username=USERNAME&platform=PLATFORM
For example, https://sociallens.dev/lookup?username=mrbeast&platform=tiktok. An assistant that browses the web can load this page to get a fresh number instead of quoting a stale one from its training data.
What data you can pull
Every capability below is read-only and limited to public data. Availability of each data type varies by network, because some platforms do not expose certain fields publicly. Check sociallens.dev/agents for the current per-network matrix.
| Capability | What it returns | Typical agent use |
|---|---|---|
| Profile | Name, bio, verification, followers, following, post counts, links, is_exact |
Vetting creators, competitor snapshots |
| Profile posts | Recent public posts with engagement counts | Content audits, posting cadence analysis |
| Post by URL | One public post's full metadata | Summarizing a viral post someone pasted |
| Post comments | Public comments on a post | Sentiment analysis, FAQ mining |
| Followers / following listing | Public follower and following lists (TikTok) | Network mapping, overlap analysis |
| Keyword search | Public results for a term | Trend scouting, brand mention discovery |
| Video transcript | Spoken text from a public video | Summaries, claim checking, repurposing |
| Audience demographics | Audience breakdown for a public account | Sponsorship fit, media planning |
Networks covered: TikTok, Instagram, YouTube, Facebook, X, Reddit, LinkedIn, Threads, Pinterest, Telegram, Bluesky, Truth Social, Cosmos, SoundCloud, Kwai, GitHub, and Spotify.
Deeper guides for the most-requested capabilities and networks:
- Transcripts: social media video transcript API
- Demographics: TikTok audience demographics API
- End-to-end use case: social media profile analysis with an AI agent
- Per network: TikTok scraper API, Instagram scraper API, X profile scraper API
What it costs and how pricing models differ
Pricing in this market is hard to compare because vendors meter different things. The model matters as much as the rate. Agents make many small, unpredictable calls, so a model that punishes bursts or charges for failed calls can cost far more than a headline rate suggests.
| Pricing model | Who uses it | How it bills | Watch out for |
|---|---|---|---|
| Pay-per-use | X API (default since early 2026) | Per request or per resource read | Costs scale directly with agent verbosity |
| Quota units | YouTube Data API v3 | Free daily units; different calls cost different amounts | Search uses many units; quota caps throughput |
| Per-Actor usage | Apify | Compute and usage of each Actor you run | Each Actor prices and behaves differently |
| Usage-based with free tier | Bright Data | Metered by data or requests | Model your volume before committing |
| Daily units | EnsembleData | A daily allowance of units consumed per call | Unused units may not roll over; check terms |
| Per-request | HikerAPI | Each call billed | Simple, but single-network |
| Subscription plus credits | Data365 | Plan fee plus credits; credit cost varies by request type | Per-network plans add up across networks |
| Per-API marketplace | RapidAPI | Each listed API has its own plan | Many separate bills and schemas |
| Enterprise subscription | Modash, HypeAuditor | Annual or monthly seats and data access | Built for teams; less suited to small agent projects |
| Consent-based platform | Phyllo | Platform fees for connected-creator data | Only works for creators who connect |
| One key, simple pricing | SocialLens | One account across 17 networks | Not the cheapest option at extreme single-network volume |
We deliberately do not list competitor dollar figures. They change often and differ by contract, so check each vendor's pricing page for current numbers. Current SocialLens plans are on sociallens.dev.
To estimate what your agent will cost on any vendor:
- Count calls per task. "Compare five creators across three networks" is 15 profile reads, plus more if the agent pulls posts.
- Cap tool calls in your system prompt. For example: "Use at most 10 SocialLens calls per answer."
- Use the
cachedandfetched_atfields. A recent cached read is often good enough, and re-reading the same profile within a session wastes calls. - Price your engineering time. One unified integration replaces several per-network ones. That saving often outweighs a lower per-call rate elsewhere.
Is it legal to give AI agents social media data?
Reading public data is on firmer legal ground than it was a decade ago, but it is not risk-free. This is not legal advice.
The key precedent. In hiQ Labs v. LinkedIn, the Ninth Circuit found that the Computer Fraud and Abuse Act likely does not bar scraping data from public profiles that anyone can view without logging in. That reasoning favors access to public data.
Risks that remain:
- Terms of service. Breach-of-contract claims are separate from the CFAA. They are strongest when a scraper logs in, because logging in means agreeing to the terms.
- Privacy law. GDPR and CCPA can apply to public personal data. Storing, profiling, or reselling it may require a lawful basis, notices, retention limits, and honoring deletion requests.
- Anti-bot measures. Circumventing technical barriers raises risk, and platforms actively block automated access.
- Copyright. Republishing posts, images, or transcripts in bulk raises separate copyright questions.
Why read-only and public-only is the more defensible design. A service that never logs in, never uses cookies, and never touches private accounts or DMs stays on the side of the line hiQ addressed. It also keeps your agent from accidentally collecting data users expected to stay private. The flip side is a hard limit: SocialLens cannot get private data at all, and no configuration changes that.
Practical guardrails for your agent:
- Collect only what the task needs, and set a retention period.
- Do not build profiles of private individuals for sensitive purposes.
- Honor deletion requests and document your lawful basis if you operate in GDPR or CCPA scope.
For a fuller treatment, read is social media scraping legal.
Troubleshooting
Most failed setups come down to a handful of causes. Work through these in order.
The server does not appear at all
- Malformed JSON. A trailing comma, a missing brace, or smart quotes pasted from a document will silently break
claude_desktop_config.jsonormcp.json. Paste the file into any JSON validator. The most common error is a comma after the last entry inmcpServers. - Wrong nesting. The
sociallenskey must sit insidemcpServers. If you already had other servers, merge the entry in rather than adding a secondmcpServersobject. - No full restart. Claude Desktop only reads its config at launch. Quit it completely (Cmd+Q on macOS, quit from the tray on Windows), then reopen it.
"spawn npx ENOENT" or "command not found"
- Node.js is missing or not on PATH. GUI apps often do not inherit your shell's PATH, which is common with version managers. Run
which npxon macOS or Linux, orwhere npxon Windows, and put that absolute path in"command". - Relative vs absolute paths. Any path in a config file is resolved from the app's working directory, not your project folder. Use absolute paths everywhere.
- Windows. If
npxalone fails, point"command"at the full path ofnpx.cmd.
Tools load but every call fails
- Key not reaching the server. Check that
SOCIALLENS_API_KEYis insideenvfor the server, not at the top level of the file. In Claude Code, runclaude mcp get sociallensto inspect what was stored. - A 401 from api.sociallens.dev means a missing, mistyped, or revoked key. Regenerate it at sociallens.dev/keys. Keys start with
sk_live_, and a stray space or newline will break them. - The account is private or does not exist. The response returns
exists: falseorprivate: true. That is correct behavior. SocialLens will not read private accounts.
Remote servers asking for OAuth (401/403)
SocialLens itself uses an environment key over stdio, so this applies to other remote MCP servers you add alongside it. When a remote HTTP server returns 401 or 403, Claude Code starts a sign-in flow. Run /mcp, pick the server, and log in, or run claude mcp login NAME. claude -p and the Agent SDK cannot complete interactive OAuth, so sign in interactively once first. For header-based auth, use --header "Authorization: Bearer TOKEN" (short form -H). See the official Claude Code MCP docs.
Transport mismatches
- stdio-only clients and remote servers. Some clients only launch local stdio servers. To reach a remote Streamable HTTP server from one of them, use an
mcp-remotebridge, which runs locally over stdio and forwards to the remote URL. - Remote-only environments. SocialLens is a local stdio server. If a platform only accepts remote MCP URLs, use the REST API or the OpenAPI import (
https://sociallens.dev/openapi.json) instead. - Legacy SSE. Recent Claude Code falls back from HTTP to SSE automatically for remote servers. Older clients may need the transport set explicitly.
Cursor uses the wrong config
Cursor reads both .cursor/mcp.json (project) and ~/.cursor/mcp.json (global). On a name collision, the project file wins. If you updated your key globally but a project file also defines sociallens with an old key, the old key is used. Keep the server in one place, or give the entries different names.
The model ignores the tool
Name the tool in your prompt ("use sociallens to..."), or add a system instruction: "For any question about current follower counts or posts, call get_social_profile instead of answering from memory." Models default to training data unless prompted to fetch.
FAQ
What is a social media MCP server?
A social media MCP server is a Model Context Protocol server whose tools read social data. AI clients like Claude and Cursor discover its tools and call them, for example with a platform and username, to get structured public profile, post, or comment data without custom integration code.
How do I connect Claude to social media data?
In Claude Code, run claude mcp add --env SOCIALLENS_API_KEY=sk_live_YOUR_KEY --transport stdio sociallens -- npx -y sociallens-mcp. In Claude Desktop, add the mcpServers block to claude_desktop_config.json and fully restart the app. Then ask Claude for any public profile.
Can AI agents read private social media data or DMs?
No. SocialLens reads public data only. It never logs in, never uses cookies or sessions, and cannot access private accounts, followers-only posts, DMs, or owner-only analytics. Private data requires the account owner's own authorization through official platform APIs.
What is the difference between a read MCP and a publish MCP?
A read MCP only retrieves data. A publish MCP holds credentials that can post, reply, or message on your behalf. Read-only servers are safer for agents, because a prompt-injection attack cannot make them act as you. SocialLens is read-only.
Do I need an API key for each platform?
No. One SocialLens key covers all 17 networks with one JSON schema. Official APIs, by contrast, each require their own developer account, app approval, and authentication setup, and some, like the TikTok Research API, are not available for commercial use.
How much does a social media data API cost?
It depends on the model: pay-per-use, quota units, credits, per-request, or enterprise subscription. Rates change often, so check each vendor's pricing page. Estimate cost by counting tool calls per agent task and capping them in your system prompt.
Is scraping public social media data legal?
Reading public data is generally more defensible after hiQ v. LinkedIn, which found the CFAA likely does not bar scraping public profiles. Terms-of-service, GDPR, CCPA, and copyright risks remain. Read-only, no-login access reduces risk. This is not legal advice.
Which networks can an AI agent pull data from?
With SocialLens: TikTok, Instagram, YouTube, Facebook, X, Reddit, LinkedIn, Threads, Pinterest, Telegram, Bluesky, Truth Social, Cosmos, SoundCloud, Kwai, GitHub, and Spotify. Specific data types vary by network depending on what each platform exposes publicly.
Can ChatGPT or Perplexity access social media data too?
Yes. ChatGPT Custom GPTs can import https://sociallens.dev/openapi.json as an Action with Bearer auth. Browsing assistants can also read the no-key lookup page at sociallens.dev/lookup for a current, dated figure.
MCP vs REST API: which should my agent use?
Use MCP in clients that support it, like Claude Code, Claude Desktop, and Cursor, because tools are discovered automatically. Use REST for Custom GPTs, function calling, no-code tools, and backend services. Both return the same schema.
Can I get a creator's exact follower count via API?
Usually, yes. In a live read on December 4, 2026, 12 of 13 networks returned exact counts. YouTube only exposes rounded subscriber figures, so SocialLens returns is_exact: false there instead of presenting a rounded number as precise.
Why is my MCP server not showing up in Claude?
The most common causes are invalid JSON (often a trailing comma), the entry sitting outside mcpServers, Node.js not being on the app's PATH, or skipping a full restart. Validate the file, use absolute paths, quit Claude completely, and reopen it.
Related guides
- Social Media APIs Compared: Official APIs vs One Public Data API
- Social Media Data for AI Agents: MCP vs API vs Function Calling (2026)
- Best Social Media MCP Server for AI Agents in 2026
- How to Give Claude Social Media Data (MCP + API, 2026)
- Social Media Data for AI Agents and No Code Tools (2026)
- How to Give Cursor Social Media Data (MCP, 2026)
- Social Media MCP Server: Give Your AI Agent Data (2026)