🎬 Instagram视频分析器MCP服务器
一个全面的模型上下文协议(MCP)服务器,用于使用AI分析Instagram视频。该服务器使Claude和其他LLM能够使用高级AI功能分析Instagram内容,包括转录、视觉分析和内容洞察。
🎯 这有什么作用
使用人工智能将Instagram视频转化为可操作的见解:
- 📝 转录:将语音转换为带有时间戳的文本
- 👁️ 视觉分析:详细的逐场景描述
- 🧠 内容洞察:提取关键主题、情感和参与因素
- 📊 性能指标:跟踪分析作业和系统运行状况
- 🔄 实时处理:通过实时更新监控进度
非常适合:需要大规模分析Instagram视频内容的内容创作者、营销人员、研究人员和人工智能爱好者。
🌟 特性
🛠️ 6强大的工具
analyze_instagram_video-使用AI完成视频分析get_job_status-监控分析进度list_recent_analyses-查看最近的分析历史记录cancel_job-取消运行分析get_system_stats-系统性能指标get_video_info-视频基本信息
📚 3动态资源
analysis://{job_id}-访问特定分析结果jobs://recent-最近的工作概述stats://system-实时系统统计
🎯 分析类型
- 全面的 -全面分析,包括转录、视觉描述和见解
- 转录 -仅音频到文本转换
- 视觉描述 -详细的视觉内容分析
- 总结 -简明的内容概述
🚀 快速开始
先决条件
- Python 3.11+
- 谷歌人工智能API密钥(适用于Gemini)
- Claude Code或兼容的MCP客户端
- FFmpeg(用于视频处理)
⚡ 5分钟设置
- 克隆和设置:
git clone https://github.com/Morfeu333/instagram-video-analyzer-mcp.git
cd instagram-video-analyzer-mcp- 启动后端:
cd backend
pip install -r requirements.txt
# Add your GOOGLE_API_KEY to .env file
python -m app.main- 安装并运行MCP服务器:
cd mcp-server
uv sync
uv run instagram-video-analyzer-mcp- 配置Claude代码 (参见 安装指南 详情)
Claude代码配置
添加到您的Claude Code配置文件中:
窗户: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"instagram-video-analyzer": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-server", "run", "instagram-video-analyzer-mcp"],
"env": {
"API_BASE_URL": "http://localhost:8000",
"LOG_LEVEL": "INFO"
}
}
}
}📖 使用示例
🎬 基本视频分析
Analyze this Instagram video: https://www.instagram.com/reel/DMiEEmlMI7J/结果:完整转录+视觉分析+内容洞察
📝 仅转录
Get only the transcription of this video: https://www.instagram.com/reel/DMiEEmlMI7J/结果:带时间戳的语音到文本转换
👁️ 视觉分析
Describe the visual content of this video: https://www.instagram.com/reel/DMiEEmlMI7J/结果:逐场景视觉描述
📊 批次分析
Analyze these 5 Instagram videos and compare their content themes:
- https://www.instagram.com/reel/video1/
- https://www.instagram.com/reel/video2/
- https://www.instagram.com/reel/video3/🔍 系统监控
Show me the system statistics and recent analyses结果:性能指标、作业历史、磁盘使用情况
🔧 api参考
工具
analyze_instagram_video
使用AI分析Instagram视频。
参数:
url(字符串,必填):Instagram视频URLanalysis_type(字符串,可选):分析类型
- comprehensive (默认):完成分析 - transcription:仅音频转录 - visual_description:视觉内容分析 - summary:简明概述
退货:
{
"success": true,
"job_id": "uuid-string",
"status": "completed",
"analysis": {
"analysis_type": "comprehensive",
"model_used": "gemini-2.5-flash",
"raw_response": "Detailed analysis...",
"file_size": 19058688
}
}get_job_status
检索分析作业的状态。
参数:
job_id(字符串,必填):作业标识符
退货:
{
"job_id": "uuid-string",
"status": "completed",
"progress": 100,
"created_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:32:30Z",
"analysis_result": { ... }
}list_recent_analyses
列出最近的视频分析。
参数:
limit(int,可选):最大结果(默认值:10)page(int,可选):页码(默认值:1)
cancel_job
取消正在运行的分析作业。
参数:
job_id(string,必填):要取消的作业
get_system_stats
检索系统性能统计信息。
退货:
{
"total_jobs": 150,
"completed_jobs": 142,
"failed_jobs": 3,
"pending_jobs": 5,
"success_rate": 94.67,
"average_processing_time": 125.5
}get_video_info
获取有关Instagram视频的基本信息。
参数:
url(字符串,必填):Instagram视频URL
资源
analysis://{job_id}
访问特定分析的详细结果。
jobs://recent
近期分析工作概述。
stats://system
实时系统性能指标。
🎯 高级功能
逐场景分析
MCP服务器可以提供同步分析,其中每个口语短语与其相应的视觉场景相匹配:
Frase 1 (0:00-0:03): "Check out this amazing tip!"
Scene 1: Close-up of person's face, excited expression, blurred background...
Frase 2 (0:03-0:07): "You'll only need..."
Scene 2: Hands holding objects, organized desk, natural lighting...批处理
分析多个视频并比较不同内容的见解。
实时监控
实时跟踪分析进度和系统性能。
🔍 故障排除
常见问题
MCP服务器无法启动:
- 验证是否安装了Python 3.11+
- 检查API是否正在运行:
curl http://localhost:8000/health - 确保安装了所有依赖项:
uv sync
分析失败:
- 验证Instagram URL是否有效且公开
- 检查API连接
- 查看日志以了解详细的错误消息
Claude代码集成问题:
- 验证配置文件路径和语法
- 配置更改后重新启动Claude代码
- 检查MCP服务器日志中的连接错误
日志记录
服务器为调试提供结构化日志记录:
2024-01-15 10:30:00 INFO 🚀 Starting Instagram Video Analyzer MCP Server...
2024-01-15 10:30:01 INFO ✅ API connection established
2024-01-15 10:30:15 INFO 🎬 Starting video analysis: https://instagram.com/reel/...🧪 测试
运行测试套件:
cd mcp-server
uv run pytest tests/ -v📁 项目结构
instagram-video-analyzer-mcp/
├── 📂 backend/ # FastAPI backend server
│ ├── app/
│ │ ├── main.py # FastAPI application
│ │ ├── database.py # Database configuration
│ │ ├── models/ # SQLAlchemy models
│ │ └── services/ # AI analysis services
│ ├── requirements.txt
│ └── .env # Environment variables
├── 📂 mcp-server/ # MCP bridge server
│ ├── instagram_video_analyzer_mcp.py
│ ├── pyproject.toml
│ └── tests/
├── 📂 data/ # Storage directories
│ ├── videos/ # Downloaded Instagram videos
│ ├── results/ # Analysis results
│ └── temp/ # Temporary processing files
├── 📂 docs/ # Documentation
├── 📂 frontend/ # Optional React frontend
├── 📂 vibekanban-templates/ # Automation workflows
├── 📄 README.md # This file
├── 📄 INSTALLATION_GUIDE.md # Setup instructions
├── 📄 TECHNICAL_DOCUMENTATION.md # Technical details
└── 📄 LICENSE # MIT License🤝 贡献
- 分叉存储库
- 创建要素分支:
git checkout -b feature-name - 进行更改并添加测试
- 提交您的更改:
git commit -am 'Add feature' - 推到分支:
git push origin feature-name - 提交拉取请求
📄 许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
📚 文档
🆘 支持
- 🐛 问题:
- 💬 讨论:
- 📧 联系:为支持请求创建问题
🎉 致谢
- 内置于 FastMCP
- 由谷歌Gemini AI提供技术支持
- 通过Instaloader处理Instagram内容
______________________________________________________________________
由以下材料制成❤️ 对于AI社区
