Skip to main content
Glama
sociallens-mcp

sociallens-mcp

Official

sociallens-mcp

MCP server that gives your AI agent read access to public social media data from TikTok, Instagram, YouTube, X, Reddit, LinkedIn, Threads, Pinterest and Facebook.

Powered by the SocialLens API. Get a free API key (250 free reads, no credit card): https://sociallens.dev/register

Install

You need Python 3.10 or newer.

  1. Download this repository to your machine.

  2. Install the two dependencies with the same Python that will run the server:

pip install -r requirements.txt

The server talks to your MCP client over stdio and reads the key only from the SOCIALLENS_API_KEY environment variable. It refuses to start without it.

Claude Code

claude mcp add --env SOCIALLENS_API_KEY=sk_live_YOUR_KEY --transport stdio sociallens -- python /absolute/path/to/sociallens-mcp/server.py

Keep --transport stdio between --env and the server name, otherwise the CLI reads the name as another env pair.

Cursor and other MCP clients

Add the server to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

{
  "mcpServers": {
    "sociallens": {
      "command": "python",
      "args": ["/absolute/path/to/sociallens-mcp/server.py"],
      "env": {
        "SOCIALLENS_API_KEY": "sk_live_YOUR_KEY"
      }
    }
  }
}

Other clients that use the mcpServers JSON format take the same block. If your system only has python3, use it as the command.

Related MCP server: social-data-mcp

Tools

Tool

What it does

Networks

get_profile

Public profile: followers, following, bio, verified and private flags, avatar

All 9

get_post

Metrics of one post or video by URL: likes, views, comments, shares, author, caption

All except LinkedIn

get_profile_posts

Recent posts of a profile with their counters, one page per call

All 9

get_post_comments

Public comments of one post: text, author, likes, replies

TikTok, Instagram, YouTube, Facebook, Reddit

get_followers

Accounts that follow a profile, one page per call

TikTok only

get_following

Accounts a profile follows, one page per call

TikTok only

check_api_key

Checks that your key works. Free

Not tied to a network

Every tool returns the JSON of the SocialLens API unchanged. A successful read costs 1 credit, check_api_key costs nothing, and errors are not charged.

Example

Ask your agent:

How many followers does @nasa have on TikTok?

The agent calls get_profile with platform="tiktok" and username="nasa", receives the profile JSON from the API (fields such as followers, followers_rounded, is_exact and verified) and answers with the number in followers.

Notes

  • get_followers and get_following are TikTok only. For the follower count on any network, use get_profile.

  • The agent gets a clear message instead of a stack trace when the key is invalid, the credits run out, the source is temporarily unavailable or the API cannot be reached.

  • Tested with the official MCP Python SDK (mcp) versions 1.30 and 2.3.

Full guide: https://sociallens.dev/blog/social-media-mcp-server-ai-agent-data More guides: https://sociallens.dev/blog

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides AI agents with unified access to 21 social media platforms and 105 endpoints for retrieving profiles, posts, comments, search results, trending content, and analytics without per-platform authentication.
      4
      793 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to retrieve X/Twitter profiles and tweets, YouTube video and channel data, and TikTok profile and video stats on a pay-per-result basis without requiring login or platform API keys.
      81 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI tools to read publicly visible social media posts, comments, profiles, and trends from 18 platforms such as TikTok, Instagram, X, Reddit, YouTube, Xiaohongshu, and Weibo, on a prepaid pay-per-call basis where failed calls are free. Ships tools for search, trending, detail, comments, user profiles and posts, plus higher-level workflows like brand buzz, comment analysis, account watching, creator discovery, bulk link data, and viral finding.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to query public social media data across TikTok, Instagram, YouTube, X, Douyin and Xiaohongshu through ten unified business-level tools covering creator and post search, comments, trending topics, and comment insights. Ships one normalized schema over MCP, SSE, REST and stdio, with per-call pricing and cost/balance reported in every response.
      10
      34 PyPI
      MIT