Logo van Social Media Toolkit

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.

UitgeverJNHFlow21
Repositorysocial-media-toolkit
TaalPython
Forks
2
Sterren
30
Beschikbare tools
0
Transporttypestdio, streamable-http
Categorieën
LicentieApache-2.0
Links
  • Koppel tools aan AI-workflows

    Social Media Toolkit biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • Beschikbare tools: 0

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Belangstelling voor het opensourceproject

    Statistieken van de gekoppelde repository (sterren: 30, forks: 2).

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.

Installatie

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

Gebruik Social Media Toolkit MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Social Media Toolkit is verbonden, kun je de verbinding dus met verschillende AI-modellen in TypingMind gebruiken, zonder die voor elk model apart in te stellen. Je kunt MCP lokaal op je apparaat uitvoeren of verbinding maken met de URL van een externe MCP-server.

Optie 1: gebruik de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Social Media Toolkit toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus op ‘Gereed’ staat.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Social Media Toolkit.
  4. Sla de serverlijst op.
  5. Vernieuw de pagina als je wilt controleren of de connectorstatus nog op ‘Gereed’ staat.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "social-media-toolkit": {
      "command": "npx",
      "args": [
        "-y",
        "@getnote/cli"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Social Media Toolkit in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Social Media Toolkit in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Social Media Toolkit gebruiken om me hiermee te helpen?
Social Media Toolkit
Zeker. Ik heb het gelezen.
Dit vond ik met Social Media Toolkit.

Optie 2: voeg een MCP-server-URL toe

Gebruik dit als Social Media Toolkit al extern wordt gehost of als je team één gedeelde connector wil waar meerdere gebruikers toegang toe hebben.

1

Open MCP-connectoren

Ga in TypingMind naar Plug-ins, open MCP-connectoren en kies URL toevoegen.

  1. Open TypingMind in je browser.
  2. Ga naar Plug-ins.
  3. Open MCP-connectoren.
  4. Klik op URL toevoegen.
TypingMind-formulier om een eigen MCP-server-URL toe te voegen
2

Plak de server-URL

Voer de MCP-server-URL van de aanbieder in het veld Server-URL in. Voeg een verbindingsnaam, beschrijving, icoon, aangepaste HTTP-headers of OAuth-clientinstellingen toe als de server die vereist.

  1. Plak de MCP-server-URL van de aanbieder in het veld Server-URL.
  2. Voer een verbindingsnaam in voor Social Media Toolkit.
  3. Voeg een beschrijving en een icoon toe als je de verbinding makkelijker wilt herkennen.
  4. Voeg aangepaste HTTP-headers of OAuth-clientgegevens toe als de server authenticatie vereist.
3

Maak de verbinding aan

Klik op Verbinding maken, ga terug naar de lijst met plug-ins en controleer of de nieuwe MCP-verbinding actief is.

  1. Klik op Verbinding maken.
  2. Ga terug naar de lijst met MCP-connectoren.
  3. Controleer of de verbinding met Social Media Toolkit als actief wordt weergegeven.
  4. Vernieuw de lijst met plug-ins als de verbinding niet meteen verschijnt.
4

Wissel van model zonder opnieuw verbinding te maken

Start een chat met je favoriete model, schakel de tools van Social Media Toolkit in via Plug-ins en wissel van model wanneer dat nodig is. De MCP-verbinding blijft beschikbaar in de TypingMind-werkruimte.

  1. Start een nieuwe chat in TypingMind.
  2. Selecteer het AI-model dat je wilt gebruiken.
  3. Schakel de tools van Social Media Toolkit in via Plug-ins.
  4. Vraag het model om de tool te gebruiken wanneer dat nodig is.
  5. Schakel over naar een ander AI-model en gebruik dezelfde MCP-verbinding opnieuw.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Social Media Toolkit gebruiken om me hiermee te helpen?
Social Media Toolkit
Zeker. Ik heb het gelezen.
Dit vond ik met Social Media Toolkit.

Veelgestelde vragen

Waarvoor wordt de MCP-server Social Media Toolkit gebruikt?

Social Media Toolkit is een MCP-server waarmee compatibele AI-clients toegang krijgen tot externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Social Media Toolkit MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Social Media Toolkit gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Social Media Toolkit MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Social Media Toolkit verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Social Media Toolkit MCP met TypingMind?

Je kunt Social Media Toolkit met TypingMind verbinden via de lokale MCP-connector of door de URL van een externe MCP-server toe te voegen. Gebruik de lokale connector als de server toegang nodig heeft tot bestanden, apps of privébronnen op je apparaat. Gebruik een server-URL als de MCP-server extern wordt gehost.

Welke tools biedt Social Media Toolkit MCP in TypingMind?

Social Media Toolkit biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Social Media Toolkit MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Social Media Toolkit authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇