Skip to main content

MCP Integration

MCP Tools: Connect AI Agents to Social Media Data

Use the Model Context Protocol (MCP) to give Claude, Cursor, VS Code, and any MCP-compatible AI agent direct access to 990+ social data tools across 16 platforms. Build AI-powered social media workflows with real-time data.

990+

MCP Tools

Across all platforms

16

Platform MCPs

Dedicated servers

3

Transports

Stdio · SSE · Streamable HTTP

3 lines

3 lines

Paste config and go

Stdio

1. Stdio Transport

Stdio is the default for desktop MCP clients. Since the TikHub MCP server is remote, we use npx mcp-remote to bridge HTTP to stdio. Requires Node.js installed.

Replace YOUR_API_KEY with your TikHub key from tikhub.io.

Stdio Configurator

Pick a client and the platforms you need — we generate the exact config to paste in.

Choose your client

Config file location

Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Select platforms 1 selected

claude_desktop_config.json
1{
2 "mcpServers": {
3 "tikhub-tiktok": {
4 "command": "npx",
5 "args": ["mcp-remote", "https://mcp.tikhub.io/tiktok/mcp", "--header", "Authorization: Bearer YOUR_API_KEY"]
6 }
7 }
8}

Restart your client after saving. Add only the platforms you use.

SSE

2. SSE Transport

For clients that connect over Server-Sent Events. Same hosted server, with the /sse path.

Hosted endpoint

URLhttps://mcp.tikhub.io/{platform}/sse
HeaderAuthorization: Bearer YOUR_API_KEY

Self-hosted SSE

Run a single platform locally as an SSE server. Clients connect to http://localhost:8001/sse.

Terminal
1tikhub-mcp --platform tiktok --transport sse --port 8001

Streamable HTTP

3. Streamable HTTP Transport

For clients that natively support streamable HTTP (no stdio bridge). The most direct and efficient method.

URL patternhttps://mcp.tikhub.io/{platform}/mcp
HeaderAuthorization: Bearer YOUR_API_KEY
  1. 1Open Settings → MCP Servers
  2. 2Click Add Server and select Streamable HTTP
  3. 3Set name, URL, and the Authorization header
  4. 4Repeat for each platform you need
URLhttps://mcp.tikhub.io/{platform}/mcp
HeaderAuthorization: Bearer YOUR_API_KEY

LangChain

4. LangChain / LangGraph Integration

Use TikHub MCP tools in your LangChain agents via langchain-mcp-adapters.

Install

Terminal
1pip install langchain-mcp-adapters langgraph langchain-openai

Single platform (Streamable HTTP)

single_platform.py
1import asyncio
2from langchain_mcp_adapters.client import MultiServerMCPClient
3from langgraph.prebuilt import create_react_agent
4from langchain_openai import ChatOpenAI
5
6async def main():
7 async with MultiServerMCPClient(
8 {
9 "tikhub-tiktok": {
10 "transport": "streamable_http",
11 "url": "https://mcp.tikhub.io/tiktok/mcp",
12 "headers": {"Authorization": "Bearer YOUR_API_KEY"},
13 },
14 }
15 ) as client:
16 tools = client.get_tools()
17 agent = create_react_agent(ChatOpenAI(model="gpt-4o"), tools)
18 response = await agent.ainvoke(
19 {"messages": [{"role": "user", "content": "Get TikTok video details for ID 7350810998023949599"}]}
20 )
21 print(response)
22
23asyncio.run(main())

Multiple platforms

multiple_platforms.py
1async with MultiServerMCPClient(
2 {
3 "tikhub-tiktok": {
4 "transport": "streamable_http",
5 "url": "https://mcp.tikhub.io/tiktok/mcp",
6 "headers": {"Authorization": "Bearer YOUR_API_KEY"},
7 },
8 "tikhub-instagram": {
9 "transport": "streamable_http",
10 "url": "https://mcp.tikhub.io/instagram/mcp",
11 "headers": {"Authorization": "Bearer YOUR_API_KEY"},
12 },
13 "tikhub-youtube": {
14 "transport": "streamable_http",
15 "url": "https://mcp.tikhub.io/youtube/mcp",
16 "headers": {"Authorization": "Bearer YOUR_API_KEY"},
17 },
18 }
19) as client:
20 tools = client.get_tools()
21 agent = create_react_agent(ChatOpenAI(model="gpt-4o"), tools)

Stdio variant (with mcp-remote)

stdio_variant.py
1from langchain_mcp_adapters.client import MultiServerMCPClient
2
3async with MultiServerMCPClient(
4 {
5 "tikhub-tiktok": {
6 "transport": "stdio",
7 "command": "npx",
8 "args": [
9 "mcp-remote",
10 "https://mcp.tikhub.io/tiktok/mcp",
11 "--header",
12 "Authorization: Bearer YOUR_API_KEY",
13 ],
14 },
15 }
16) as client:
17 tools = client.get_tools()

Server Endpoints

Two unauthenticated meta-endpoints on the hosted server.

Health check

GET /health
1curl https://mcp.tikhub.io/health

List all platforms

GET /platforms
1curl https://mcp.tikhub.io/platforms

JSON-RPC 2.0 Primer

All HTTP / SSE requests follow the JSON-RPC 2.0 spec. The flow is: initialize → store the session id → tools/list → tools/call.

1. Initialize session (required first)

Returns an Mcp-Session-Id you must include on every subsequent call.

initialize
1curl -X POST https://mcp.tikhub.io/tiktok/mcp \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -H "Accept: application/json, text/event-stream" \
5 -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"my-client","version":"1.0"}}}'

2. List tools

Returns the catalog of tools the platform exposes — names, descriptions, and JSON schemas.

tools/list
1curl -X POST https://mcp.tikhub.io/tiktok/mcp \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -H "Accept: application/json, text/event-stream" \
5 -H "Mcp-Session-Id: SESSION_ID_FROM_INITIALIZE" \
6 -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

3. Call a tool

Pass the tool name and the arguments matching its schema.

tools/call
1curl -X POST https://mcp.tikhub.io/tiktok/mcp \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -H "Accept: application/json, text/event-stream" \
5 -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"tiktok_web_fetch_post_detail","arguments":{"itemId":"7350810998023949599"}}}'

Available Platforms

Replace {platform} in any URL with the slug from the table.

  • TikTok
    tiktok
    204tools

    Videos, users, search, ads, shop, analytics, creator tools

  • Douyin
    douyin
    247tools

    Videos, users, search, billboard, creator, Xingtu

  • Instagram
    instagram
    82tools

    Posts, reels, stories, users, comments, hashtags

  • Xiaohongshu
    xiaohongshu
    71tools

    Notes, users, search, comments

  • Weibo
    weibo
    64tools

    Posts, users, comments, search, trending

  • Others
    others
    64tools

    Lemon8, PiPiXia, Xigua, Toutiao, Sora2

  • Bilibili
    bilibili
    41tools

    Videos, users, comments, danmaku, search

  • YouTube
    youtube
    37tools

    Videos, channels, comments, search, playlists

  • Kuaishou
    kuaishou
    33tools

    Videos, users, comments, search

  • Zhihu
    zhihu
    32tools

    Questions, answers, users, topics, search

  • LinkedIn
    linkedin
    25tools

    Profiles, posts, companies, search

  • Reddit
    reddit
    24tools

    Posts, comments, subreddits, users, search

  • TikHub Utilities
    tikhub
    23tools

    Account info, downloader, health check, hybrid parsing, temp mail

  • WeChat
    wechat
    19tools

    Articles, accounts, channels, search

  • Twitter
    twitter
    13tools

    Tweets, users, search, timelines

  • @Threads
    threads
    11tools

    Posts, users, replies, search