Social Media Toolkit logo

Social Media Toolkit

Community
JNHFlow21

Public Python SDK, CLI, and MCP server for extracting metadata, text, timed transcripts, media, and supported comments from Douyin, RedNote, Bilibili, and YouTube.

PublisherJNHFlow21
Repositorysocial-media-toolkit
LanguagePython
Forks
2
Stars
30
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Social Media Toolkit exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    30 stars and 2 forks from the linked repository.

Social Media Toolkit

Social Media Toolkit architecture: public social links flow through one toolkit into normalized JSON, transcripts, media, and MCP tools

Maturity: alpha. The normalized PostBundle contract is versioned, but public platform pages and endpoints can change without notice.

Social Media Toolkit is an open-source Python SDK, socialkit CLI, and Model Context Protocol (MCP) server for developers and AI agents that need one auditable interface for public social-media extraction. It does not require a browser profile, cookies, a logged-in session, Agent Switch, or the maintainer's machine.

Quick start

Install or update

Prerequisite: Node.js 18+ with npm / npx.

bash
npx -y github:JNHFlow21/social-media-toolkit
socialkit doctor

The installer:

  1. reuses uv when available or downloads it from the official Astral installer;
  2. installs the Python package in an isolated uv tool environment;
  3. exposes socialkit and social-media-toolkit-mcp on the user command path;
  4. never reads provider credentials or creates a project .env file.

socialkit doctor returns JSON. A machine with only the free public-reading path configured can report "status": "partial"; use its warnings field to see which optional text or long-recording capabilities are unavailable.

json
{
  "status": "partial",
  "supported_platforms": ["douyin", "xiaohongshu", "bilibili", "youtube"],
  "local_asr_fallback": false,
  "warnings": ["optional capability setup guidance"]
}

Run the same npx command to update. Uninstall with:

bash
uv tool uninstall social-media-toolkit
bash
git clone https://github.com/JNHFlow21/social-media-toolkit.git
cd social-media-toolkit
uv sync --locked
uv run socialkit doctor

First useful result

Inspect a public share URL without downloading media or starting GetNote / ASR:

bash
socialkit inspect "SHARE_URL"

The command returns a normalized, provenance-bearing bundle:

json
{
  "schema_version": "1.0",
  "source": {"platform": "youtube", "url": "https://example.invalid/public-post"},
  "post": {"title": "Example public post"},
  "media": {"videos": [], "covers": [], "images": [], "audio": []},
  "content": {},
  "comments": {},
  "provenance": {"routes": ["platform:public"]}
}

The example is synthetic. Real fields depend on what the public source exposes. If the free Douyin parser fails and TIKHUB_API_KEY is configured, inspect automatically uses the paid TikHub fallback and records that route plus the ephemeral-media warning in provenance.

What it can do

OutcomeInterfaceRequirementsPossible cost
Normalize public metadataSDK / CLI / MCPPython dependencies; YouTube uses yt-dlpFree by default; optional TikHub Douyin fallback may cost money
Get readable textGetNote → public parser / optional TikHub media → native subtitle/body → Volcengine ASRDepends on the selected routeGetNote, TikHub, or Volcengine may cost money
Create timed YouTube transcriptsManual cues → automatic cues → timed Volcengine ASRyt-dlp; ASR also needs ffmpeg and credentialsASR/TOS may cost money
Download video, cover, or imagesExplicit download / capture requestAn explicit output directoryToolkit is free
Sample public commentsDouyin top-level public sampleNo cookies or accountNo
Use the same logic from an agentSix MCP toolsMCP-compatible clientDepends on selected route

Platform matrix

PlatformMetadataTextVideoCover / imagesPublic comments
Douyin✅; optional TikHub fallbackGetNote → public/TikHub media → Volcengine ASR✅✅, including public image posts✅ bounded top-level sample
Xiaohongshu / RedNote✅GetNote → post body / Volcengine ASR✅✅—
Bilibili✅GetNote → native subtitle → Volcengine ASR✅✅—
YouTube✅GetNote → manual subtitle → automatic subtitle → Volcengine ASR✅✅—

Douyin comment sorting applies only to the public sample returned by the source. It is not a platform-wide ranking, and the toolkit does not paginate or backfill missing items.

Text and transcript routes

The normal readable-text route has one deterministic order:

There is no local Whisper fallback, alternate ASR provider, OCR/Vision fallback, LLM rewriting, browser automation, CDP, Playwright, or cookie-backed extraction.

Timed YouTube mode is a separate evidence route because every segment must point back to the source video:

text
manual subtitle cues → automatic subtitle cues → timed Volcengine ASR

It writes only the requested MD/SRT/JSON artifacts to an explicit output directory. Temporary media is deleted before the call returns. --force-asr --speaker-info can bypass existing captions and request anonymous speaker clusters such as SPEAKER_01; those labels do not identify real people.

Duration-aware ASR

Media durationRouteExtra requirement
Up to 2 hoursVolcengine flash ASRVOLCENGINE_ASR_API_KEY
Over 2 and up to 5 hoursVolcengine standard ASRTwo TOS secrets plus bucket/region/endpoint configuration
Over 5 hoursRejected before media downloadNo automatic chunking

The standard route uploads one temporary private TOS object, submits a presigned URL, and deletes the object on success or failure.

Optional configuration

Public metadata, public media downloads, supported public comments, and native captions do not require a Volcengine key.

GetNote

bash
npm install -g @getnote/cli
getnote auth login

GetNote manages its own credentials. Its service may require a paid membership. Calling text, a text-enabled capture, or a full-chain smoke test is the execution signal for the documented route and can save the URL to the user's GetNote account.

Optional TikHub fallback for Douyin

Secret name:

text
TIKHUB_API_KEY

The toolkit always tries the free public Douyin adapter first. Only when that adapter fails and this secret is configured does the single orchestrator call TikHub's Web share-URL endpoint. TikHub supplies normalized public metadata and temporary CDN media URLs; it is not a text or ASR provider. Requests may incur TikHub charges, and returned CDN URLs can expire. The route, cost warning, and ephemeral-URL status are preserved in every result.

Get a key and API documentation from TikHub, then inject it through the process environment, MCP client, or another secret manager. Never write it to a project .env file.

Volcengine ASR and TOS

Secret names:

text
VOLCENGINE_ASR_API_KEY
TOS_ACCESS_KEY
TOS_SECRET_KEY

Non-sensitive long-recording settings:

text
TOS_BUCKET
TOS_REGION
TOS_ENDPOINT
TOS_OBJECT_PREFIX            # optional
TOS_PRESIGN_EXPIRES          # optional

Inject secrets through the operating system, MCP client, or another secret manager. Do not commit them or write them to a project .env file. Non-sensitive TOS settings may instead live at ~/.config/social-media-toolkit/config.json:

json
{
  "volcengine_tos": {
    "bucket": "example-private-bucket",
    "region": "example-region",
    "endpoint": "https://example-tos-endpoint.invalid",
    "object_prefix": "social-media-toolkit/long-asr"
  }
}

The repository never stores secret values. Agent Switch is an optional maintainer integration, not a package dependency.

CLI examples

bash
# Metadata only: no persistent write, GetNote, or ASR
socialkit inspect "SHARE_URL"

# Readable canonical text; may use GetNote, paid TikHub media, or paid ASR
socialkit text "SHARE_URL"

# Timed YouTube transcript artifacts
socialkit text "YOUTUBE_URL" \
  --timed \
  --output "/absolute/path/to/transcripts" \
  --outputs md,srt,json

# Force timed ASR with anonymous speaker clusters
socialkit text "YOUTUBE_URL" \
  --timed --force-asr --speaker-info \
  --asr-context-file "/absolute/path/to/public-context.json" \
  --output "/absolute/path/to/transcripts" \
  --outputs json,md,srt

# Bounded Douyin public-comment sample
socialkit comments "DOUYIN_URL" --sort likes --limit 20

# Explicit persistent media download
socialkit download "SHARE_URL" \
  --include video,cover,images \
  --output "/absolute/path/to/output"

--speaker-info and --asr-context-file require --force-asr. Context is a bounded public-metadata vocabulary hint, not identity mapping.

Python SDK

python
from social_media_toolkit import SocialMediaToolkit

toolkit = SocialMediaToolkit()

bundle = toolkit.inspect("SHARE_URL")
text = toolkit.get_text("SHARE_URL")
timed = toolkit.get_text(
    "YOUTUBE_URL",
    timed=True,
    output_dir="/absolute/path/to/transcripts",
    outputs="md,srt,json",
)
comments = toolkit.get_comments("DOUYIN_URL", sort_by="likes", limit=20)

The SDK, CLI, and MCP server use the same SocialMediaToolkit orchestrator and the same versioned result contracts.

MCP server

Release 0.4.1 intentionally constrains the Python MCP SDK to mcp>=1.28.1,<2: this transport still uses the v1 FastMCP API. MCP 2.x renamed and changed that server API, so a future v2 migration will be handled as a separate compatibility change instead of breaking fresh installs.

Start the stdio server:

bash
social-media-toolkit-mcp

Client configuration:

json
{
  "mcpServers": {
    "social-media-toolkit": {
      "command": "social-media-toolkit-mcp"
    }
  }
}

Do not place secrets in this JSON. Use the client's secret store or secure process environment.

MCP toolPurpose
social_inspectNormalize public metadata without download or transcription
social_get_textRun the readable or timed text contract
social_get_commentsFetch the supported public-comment sample
social_downloadExplicitly download requested media
social_capture_bundleCombine normalized data and requested downloads
social_doctorReport dependencies and configuration names without values

Trust and boundaries

AreaContract
AccessPublic URLs only; no access-control bypass, browser login, or private analytics
CredentialsStandard environment or client secret store; values are never returned or logged
Persistent writesOnly explicit output directories and the optional user config file
Temporary dataASR media and standard-route TOS objects are deleted before return
TelemetryNo product telemetry
NetworkPublic platform/GetNote reads and optional TikHub/Volcengine/TOS calls
PublishingUploading or publishing to social accounts is intentionally out of scope
LegalUsers remain responsible for platform terms, copyright, and local law

The downloader accepts HTTP(S), rejects local/private literal IPs, bounds download size, sanitizes filenames, and records SHA-256 manifests. See SECURITY.md for private vulnerability reporting.

Compatibility and distribution

  • Python 3.10–3.12 are the supported package runtimes.
  • Node.js 18+ is required only for the one-command bootstrap.
  • macOS, Linux, and Windows are exercised by CI; platform endpoints themselves may still change independently.
  • The canonical user distribution is the GitHub-backed npx installer and isolated uv tool environment.
  • Versioned source distributions, wheels, npm tarballs, and checksums are attached to GitHub Releases.

Architecture and documentation

Development

bash
uv sync --locked
uv run python -m unittest discover -s tests
uv run python -m compileall social_media_toolkit social_post_extractor_mcp
uv build
npm test
npm pack --dry-run
git diff --check

Tests use synthetic fixtures and must not contain real cookies, tokens, private media, or user content.

Repository activity

Repository Pulse for JNHFlow21/social-media-toolkit

Contributing, support, and license

Bug reports and focused feature proposals are welcome through GitHub Issues. Read CONTRIBUTING.md before opening a pull request, and use GitHub's private vulnerability reporting for security issues.

Licensed under the Apache License 2.0.

Installation

TypingMind
{
  "mcpServers": {
    "social-media-toolkit": {
      "command": "uv",
      "args": [
        "run",
        "social-media-toolkit-mcp"
      ]
    }
  }
}

Use Social Media Toolkit MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Social Media Toolkit is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Social Media Toolkit as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Social Media Toolkit MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "social-media-toolkit": {
      "command": "npx",
      "args": [
        "-y",
        "@getnote/cli"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Social Media Toolkit MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Social Media Toolkit MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Social Media Toolkit to help me with this task?
Social Media Toolkit
Sure. I read it.
Here is what I found using Social Media Toolkit.

Option 2: Add an MCP server URL

Use this when Social Media Toolkit is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for Social Media Toolkit.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Social Media Toolkit connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Social Media Toolkit tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Social Media Toolkit tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Social Media Toolkit to help me with this task?
Social Media Toolkit
Sure. I read it.
Here is what I found using Social Media Toolkit.

Frequently asked questions

What is the Social Media Toolkit MCP server used for?

Social Media Toolkit is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Social Media Toolkit MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Social Media Toolkit with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Social Media Toolkit MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Social Media Toolkit connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Social Media Toolkit MCP to TypingMind?

Social Media Toolkit can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does Social Media Toolkit MCP provide in TypingMind?

Social Media Toolkit exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Social Media Toolkit MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Social Media Toolkit requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇