S2

suriyaprakash-25/mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

2 stars 0 forks 质量 46 趋势 8

A Model Context Protocol (MCP) compatible FastAPI server that enables automated posting of videos to YouTube Shorts and Instagram Reels.

概览

A Model Context Protocol (MCP) compatible FastAPI server that enables automated posting of videos to YouTube Shorts and Instagram Reels. - 🎬 : Automatic detection and upload of short-form videos to YouTube - 📱 : Direct upload to Instagram Reels with caption support - 🔐 : Secure authentication for both platforms - 🛡️ : Comprehensive file type and size validation - 🔄 : Automatic OAuth token refresh for YouTube - 🎯 : Full MCP tool integration for seamless automation - ⚡ : High-performance async file handling - 📏 : Automatic video duration detection using ffprobe 4. : - Visit http://localhost:8000/docs for interactive API documentation - Use the /upload/youtube and /upload/instagram endpoints - Access MCP tools at http://localhost:8000/mcp The server exposes two MCP tools for programmatic access: 1. : - Go to Google Cloud Console - Create a new project or select existing one - Enable YouTube Data API v3 in the API Library - Create OAuth 2.0 credentials (Desktop application) 2.

README

以下为原文 README 节选,完整内容请查看原文。

YouTube Shorts & Instagram Reels MCP Server

A Model Context Protocol (MCP) compatible FastAPI server that enables automated posting of videos to YouTube Shorts and Instagram Reels.

Features

  • 🎬 YouTube Shorts Upload: Automatic detection and upload of short-form videos to YouTube
  • 📱 Instagram Reels Upload: Direct upload to Instagram Reels with caption support
  • 🔐 OAuth 2.0 Authentication: Secure authentication for both platforms
  • 🛡️ File Validation: Comprehensive file type and size validation
  • 🔄 Token Refresh: Automatic OAuth token refresh for YouTube
  • 🎯 MCP Compatible: Full MCP tool integration for seamless automation
  • ⚡ Async Operations: High-performance async file handling
  • 📏 Video Processing: Automatic video duration detection using ffprobe

Quick Start

  1. Install dependencies:
pip install -r requirements.txt
  1. Configure credentials:
cp .env.example .env
# Edit .env with your API credentials (see setup sections below)
  1. Start the server:
python main.py
  1. Test the API:

API Endpoints

Upload to YouTube Shorts

POST /upload/youtube
Content-Type: multipart/form-data

file: 
title: "My Amazing Short"
description: "Check out this cool video!"
tags: "shorts,viral,amazing"

Response:

{
  "success": true,
  "video_id": "dQw4w9WgXcQ",
  "watch_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}

Upload to Instagram Reels

POST /upload/instagram
Content-Type: multipart/form-data

file: 
caption: "Check out my new reel! #viral #reels"

Response:

{
  "success": true,
  "reel_id": "17841234567890123",
  "permalink": "https://www.instagram.com/reel/ABC123def456/"
}

MCP Tool Usage

The server exposes two MCP tools for programmatic access:

post_to_youtube

await post_to_youtube(
    title="My Video Title",
    description="Video description",
    tags=["tag1", "tag2", "tag3"],
    video_path="/path/to/video.mp4"
)

post_to_instagram

await post_to_instagram(
    caption="My reel caption #hashtag",
    video_path="/path/to/video.mp4"
)

Prerequisites & Setup

YouTube API Setup

  1. Google Cloud Console:

    • Go to Google Cloud Console
    • Create a new project or select existing one
    • Enable YouTube Data API v3 in the API Library
    • Create OAuth 2.0 credentials (Desktop application)
  2. Get OAuth Tokens:

    • Use Google OAuth 2.0 Playground
    • Configure with your Client ID and Secret
    • Select https://www.googleapis.com/auth/youtube.upload scope
    • Complete OAuth flow and get access_token + refresh_token

Instagram API Setup

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →