Logotipo de Social Media Toolkit

Social Media Toolkit

Comunidad
JNHFlow21

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

EditorJNHFlow21
Repositoriosocial-media-toolkit
IdiomaPython
Forks
2
Estrellas
30
Herramientas disponibles
0
Tipo de transportestdio, streamable-http
Categorías
LicenciaApache-2.0
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    Social Media Toolkit ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    30 estrellas y 2 forks en el repositorio enlazado.

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.

Instalación

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

Usa el MCP de Social Media Toolkit con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado Social Media Toolkit, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Puedes ejecutar MCP localmente en tu dispositivo o conectarte a la URL de un servidor MCP remoto.

Opción 1: Usa el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade Social Media Toolkit como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de Social Media Toolkit.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "social-media-toolkit": {
      "command": "npx",
      "args": [
        "-y",
        "@getnote/cli"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de Social Media Toolkit y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de Social Media Toolkit.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar Social Media Toolkit para ayudarme con esta tarea?
Social Media Toolkit
Claro. Lo he leído.
Esto he encontrado usando Social Media Toolkit.

Opción 2: Añade la URL de un servidor MCP

Usa esta opción si Social Media Toolkit ya está alojado en un servidor remoto o si tu equipo quiere un conector compartido al que puedan acceder varios usuarios.

1

Abre Conectores MCP

En TypingMind, ve a Plugins, abre Conectores MCP y elige Añadir URL.

  1. Abre TypingMind en tu navegador.
  2. Ve a Plugins.
  3. Abre Conectores MCP.
  4. Haz clic en Añadir URL.
Formulario de TypingMind para añadir la URL de un servidor MCP personalizado
2

Pega la URL del servidor

Introduce la URL del servidor MCP facilitada por el proveedor en el campo URL del servidor. Añade un nombre de conexión, una descripción, un icono, cabeceras HTTP personalizadas o la configuración del cliente OAuth si el servidor los requiere.

  1. Pega la URL del servidor MCP facilitada por el proveedor en el campo URL del servidor.
  2. Introduce un nombre para la conexión de Social Media Toolkit.
  3. Añade una descripción y un icono si quieres que sea más fácil de identificar.
  4. Añade cabeceras HTTP personalizadas o los datos del cliente OAuth si el servidor requiere autenticación.
3

Crea la conexión

Haz clic en Crear conexión, vuelve a la lista de plugins y comprueba que la nueva conexión MCP esté activa.

  1. Haz clic en Crear conexión.
  2. Vuelve a la lista de conectores MCP.
  3. Comprueba que la conexión de Social Media Toolkit aparezca como activa.
  4. Actualiza la lista de plugins si la conexión no aparece de inmediato.
4

Cambia de modelo sin volver a conectar

Inicia un chat con tu modelo preferido, activa las herramientas de Social Media Toolkit desde Plugins y cambia de modelo cuando lo necesites. La conexión MCP seguirá disponible en el espacio de trabajo de TypingMind.

  1. Inicia un nuevo chat en TypingMind.
  2. Selecciona el modelo de IA que quieras usar.
  3. Activa las herramientas de Social Media Toolkit desde Plugins.
  4. Pide al modelo que use la herramienta cuando sea necesario.
  5. Cambia a otro modelo de IA y reutiliza la misma conexión MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar Social Media Toolkit para ayudarme con esta tarea?
Social Media Toolkit
Claro. Lo he leído.
Esto he encontrado usando Social Media Toolkit.

Preguntas frecuentes

¿Para qué sirve el servidor MCP Social Media Toolkit?

Social Media Toolkit es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP Social Media Toolkit con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar Social Media Toolkit con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de Social Media Toolkit con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con Social Media Toolkit conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP Social Media Toolkit a TypingMind?

Puedes conectar Social Media Toolkit en TypingMind con el conector MCP local o añadiendo la URL de un servidor MCP remoto. Usa el conector local cuando el servidor necesite acceder a archivos, aplicaciones o recursos privados de tu dispositivo, y una URL de servidor cuando el servidor MCP esté alojado de forma remota.

¿Qué herramientas ofrece el servidor MCP Social Media Toolkit en TypingMind?

Social Media Toolkit ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP Social Media Toolkit?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si Social Media Toolkit requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇