YouTube Shorts Agent

io.github.davidmosiah由 GitHub 账号 davidmosiah 发布v0.1.6更新于 Oct 24, 2026

Agent-first YouTube Shorts uploader: dry-run validation, OAuth checks, synthetic-media metadata.

已验证STDIO仅桌面效率与工作流媒体与设计

概览

AI 生成的概览

本地 MCP 服务器,让助手通过官方 YouTube Data API 准备、校验 Shorts 上传,并在配置 OAuth 后真正发布。

可以做什么
检查 OAuth 与 dry-run 就绪状态,并获取 MCP 客户端安装指引,不暴露令牌值(manifest、连接状态)。审计上传范围、合成媒体标记与本地文件边界。生成带本地会话存储的 PKCE 授权链接。以 dry-run 或正式模式上传 Short,默认标记含合成媒体。列出频道近期视频,用于上传后的简单核对。
适用场景
适合在发布前让助手准备并校验 Shorts 上传内容(标题、文案、标签、合成媒体元数据),或通过官方 API 而非 YouTube Studio 界面发布。dry-run 模式无需凭据即可安全试用。
运行要求
以 npm 包形式在本地通过 stdio 运行(需要 Node.js),另有仅限本机回环的可选 HTTP 模式。正式上传需要 Google OAuth 客户端与令牌:YOUTUBE_CLIENT_ID、YOUTUBE_CLIENT_SECRET,以及写入本地 .env 的访问令牌和刷新令牌。正式调用需要访问 YouTube Data API 的网络;dry-run 无需凭据。
安装前请注意
正式上传会向 YouTube 频道公开发布内容,需要设置 YOUTUBE_DRY_RUN=false;默认是 dry-run。YOUTUBE_CLIENT_SECRET 与 OAuth 令牌属敏感信息,应仅保存在本地且不进入 Git,README 建议永不打印令牌值。PKCE 会话数据存放在本地 .agent-data/。上传默认标记为含合成媒体。

安装

在 SourceWeft 中

  1. 打开 控制台中的 YouTube Shorts Agent,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

YouTube Shorts Agent

Agent-first YouTube Shorts uploader for the YouTube Data API.
Dry-run safe, OAuth readiness checks, MCP-ready for Codex / Claude / Cursor / Hermes.

[npm version] [npm downloads] [License MIT] [Built for MCP]

[GitHub stars] [CI status] [Part of the Delx agent stack] [Category]

⭐ If this agent-first tool helps your workflow, please star the repo. Stars make this tooling easier for other builders to discover and help Delx keep shipping open infrastructure.
🧱 Part of the Delx agent stack — 15 open-source MCP servers across body, reach and coordination.


Agent-first YouTube Shorts uploader for the YouTube Data API. It is designed for Codex, Claude, Cursor, Hermes, OpenClaw and any MCP client that needs a predictable upload workflow with dry-run safety, OAuth readiness checks and structured output.

Use it when an agent needs to prepare, validate or upload Shorts through the official API without touching YouTube Studio UI.

What Agents Get

  • youtube_agent_manifest for install/runtime guidance
  • youtube_connection_status before upload attempts
  • youtube_privacy_audit for local token and media boundaries
  • youtube_oauth_authorize_url with local PKCE session storage
  • youtube_upload_short with containsSyntheticMedia support
  • youtube_list_recent_videos for lightweight post-upload checks

Install

bash
npm install -g youtube-shorts-agent

Or run directly:

bash
npm exec --yes --package=youtube-shorts-agent -- youtube-shorts-agent doctor

CLI

bash
youtube-shorts-agent manifest --client codexyoutube-shorts-agent doctoryoutube-shorts-agent privacy-audityoutube-shorts-agent auth-url --redirect-uri http://localhost:8787/callbackyoutube-shorts-agent upload-short --video ./short.mp4 --title "Launch title" --caption-file copy.txtyoutube-shorts-agent list-recent --max-results 10

Dry-run is enabled by default. Set YOUTUBE_DRY_RUN=false only when doctor reports a complete OAuth setup and you intend to call the live API.

First Upload (dry-run walkthrough)

This is the full first-run path. Every step here is dry-run safe — no credentials are required and nothing is sent to YouTube. The output below is captured verbatim from a real run.

1. Check readiness. With no OAuth configured, doctor confirms you are in dry-run mode:

bash
youtube-shorts-agent doctor
json
{  "ok": true,  "dry_run": true,  "configured": {    "client_credentials": "missing",    "access_token": "missing",    "refresh_token": "missing"  },  "missing_count": 3,  "ready_for_live_upload": false,  "next_steps": [    "Current mode is dry-run. Validate metadata and agent flow before live uploads."  ]}

2. Prepare a Short and its caption.

bash
printf 'Launching the agent-first Shorts uploader.\n#shorts #ai #agents' > copy.txt# short.mp4 is your vertical 9:16 clip

3. Run the upload in dry-run. No network call is made; the tool returns the exact job and result it would publish, so an agent can validate metadata before going live:

bash
youtube-shorts-agent upload-short \  --video ./short.mp4 \  --title "Agent-first Shorts upload" \  --caption-file copy.txt \  --tags ai,agents \  --duration 24
json
{  "ok": true,  "dry_run": true,  "job": {    "id": "youtube_1780082215631",    "platform": "youtube",    "status": "queued",    "createdAt": "2026-05-29T19:16:55.631Z",    "caption": "Launching the agent-first Shorts uploader.\n#shorts #ai #agents",    "targetUrl": "",    "mediaPaths": ["./short.mp4"],    "metadata": {      "title": "Agent-first Shorts upload",      "youtube_title": "Agent-first Shorts upload",      "youtube_tags": ["ai", "agents"],      "youtube_contains_synthetic_media": true,      "video_duration_sec": 24,      "video_aspect_ratio": "9:16"    }  },  "result": {    "provider": "youtube_official",    "platformPostId": "dryrun_1780082215631",    "releaseUrl": "https://www.youtube.com",    "raw": { "dryRun": true, "jobId": "youtube_1780082215631" }  }}

platformPostId is prefixed with dryrun_ and releaseUrl is the YouTube root — both signal that nothing was uploaded. The id, createdAt and dryrun_* values vary per run.

4. Confirm the channel listing path (returns an empty list in dry-run):

bash
youtube-shorts-agent list-recent --max-results 5
json
{ "items": [] }

Going live. Configure OAuth (youtube-shorts-agent auth-url --redirect-uri http://localhost:8787/callback, then exchange the callback code for tokens), set YOUTUBE_CLIENT_ID / YOUTUBE_CLIENT_SECRET / YOUTUBE_ACCESS_TOKEN / YOUTUBE_REFRESH_TOKEN in .env, re-run doctor until ready_for_live_upload is true, then set YOUTUBE_DRY_RUN=false and re-run the same upload-short command.

MCP

bash
youtube-shorts-mcp

HTTP (v2 stateless)

Default is stdio. Optional Streamable HTTP — no session id, JSON responses, loopback only:

bash
npx -y -p youtube-shorts-agent youtube-shorts-mcp --http# GET  http://127.0.0.1:3032/health# POST http://127.0.0.1:3032/mcp   (sessionless)

Env: YOUTUBE_MCP_HOST, YOUTUBE_MCP_PORT, YOUTUBE_MCP_TRANSPORT=http.

Hermes-style config:

yaml
mcp_servers:  youtube_shorts:    command: npx    args: ["-y", "youtube-shorts-agent"]    sampling:      enabled: false

Recommended first calls:

  1. youtube_connection_status
  2. youtube_privacy_audit
  3. youtube_upload_short

Agent Surfaces

ToolPurpose
youtube_agent_manifestInstall/runtime guidance for Codex, Claude, Cursor, Hermes and OpenClaw
youtube_connection_statusOAuth and dry-run readiness without token values
youtube_privacy_auditUpload scope, synthetic media and local file boundaries
youtube_oauth_authorize_urlPKCE authorization URL with local session storage
youtube_upload_shortDry-run or live Shorts upload
youtube_list_recent_videosLightweight channel verification

Copy-Paste Agent Prompt

text
Use youtube-shorts-agent. First call youtube_connection_status and youtube_privacy_audit.If uploading AI-generated media, keep containsSyntheticMedia=true. Never print token values.

Configuration

Copy .env.example to .env. Keep .env and .agent-data/ out of Git.

The upload tool sets containsSyntheticMedia=true by default for AI-generated or AI-edited videos. Override only when that is not true for the asset.

Safety Model

  • OAuth tokens are never returned by CLI or MCP tools.
  • PKCE verifier is stored locally in .agent-data/.
  • Live upload requires YOUTUBE_DRY_RUN=false.
  • The package uses the official YouTube Data API and does not automate Studio UI.

Development

bash
npm installnpm testnpm run check

📧 Contact & Support

来源:README.md,提交 26827b4

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.6最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分