[](https://github.com/sun-guannan/CapCutAPI/stargazers)[](LICENSE)[](https://python.org)[](./MCP_Documentation_English.md)**๐ Open source CapCut API tool with MCP (Model Context Protocol) support**[๐ Try Online](https://www.capcutapi.top) โข [๐ ไธญๆๆๆกฃ](README-zh.md) โข [๐ง MCP Docs](./MCP_Documentation_English.md) โข [๐ MCP ไธญๆๆๅ](./MCP_ๆๆกฃ_ไธญๆ.md)
---## ๐ฏ Project Overview**CapCutAPI** is a powerful enterprise-grade video editing automation platform built with Python, providing complete CapCut video editing capabilities. Through dual interfaces of HTTP API and MCP protocol, it enables seamless integration with AI assistants and automation tools.### ๐ Core Advantages### ๐ AI Generated Video Cases[](https://www.youtube.com/watch?v=IF1RDFGOtEU)### ๐ต Music Video Production[](https://www.youtube.com/watch?v=rGNLE_slAJ8)*AI-driven video generation powered by CapCutAPI*
---## ๐ Core Features### ๐ Feature Matrix| Feature Module | HTTP API | MCP Protocol | Description ||---------------|----------|--------------|-------------|| ๐ฌ **Draft Management** | โ
| โ
| Create, read, modify, save CapCut draft files || ๐ฅ **Video Processing** | โ
| โ
| Multi-format video import, editing, transitions, effects || ๐ **Audio Editing** | โ
| โ
| Audio tracks, volume control, audio effects || ๐ผ๏ธ **Image Processing** | โ
| โ
| Image import, animations, masks, filters || ๐ **Text Editing** | โ
| โ
| Multi-style text, shadows, backgrounds, animations || ๐ **Subtitle System** | โ
| โ
| SRT subtitle import, styling, time sync || โจ **Effects Engine** | โ
| โ
| Visual effects, filters, transition animations || ๐ญ **Sticker System** | โ
| โ
| Sticker assets, position control, animation effects || ๐ฏ **Keyframes** | โ
| โ
| Property animations, timeline control, easing functions || ๐ **Media Analysis** | โ
| โ
| Video duration detection, format analysis |### ๐ ๏ธ API Interface Overview
+
+| Feature | Description | Example |
+|---------|-------------|----------|
+| ๐จ **Advanced Text Styling** | Multi-color, shadow, background effects | `shadow_enabled: true` |
+| ๐ฌ **Keyframe Animation** | Position, scale, opacity animations | `property_types: ["scale_x", "alpha"]` |
+| ๐ **Audio Precision Control** | Volume, speed, audio effects | `volume: 0.8, speed: 1.2` |
+| ๐ฑ **Multi-format Support** | Various video dimensions and formats | `width: 1080, height: 1920` |
+| โก **Real-time Processing** | Instant draft updates and previews | Millisecond response time |
+
+
+
+---
+
+## ๐ก Usage Examples
+
+### ๐ HTTP API Examples
+
+
+
+| ๐ Document Type | ๐ Language | ๐ Link | ๐ Description |
+|-----------------|-------------|---------|----------------|
+| **MCP Complete Guide** | ๐บ๐ธ English | [MCP Documentation](./MCP_Documentation_English.md) | Complete MCP server usage guide |
+| **MCP User Manual** | ๐จ๐ณ Chinese | [MCP ไธญๆๆๆกฃ](./MCP_ๆๆกฃ_ไธญๆ.md) | Detailed Chinese usage instructions |
+| **API Reference** | ๐บ๐ธ English | [example.py](./example.py) | Code examples and best practices |
+| **REST Testing** | ๐ Universal | [rest_client_test.http](./rest_client_test.http) | HTTP interface test cases |
+
+
+
+---
+
+## ๐ Enterprise Features
+
+### ๐ Security
+
+- **๐ก๏ธ Input Validation**: Strict parameter validation and type checking
+- **๐ Error Handling**: Comprehensive exception catching and error reporting
+- **๐ Logging**: Detailed operation logs and debug information
+- **๐ซ Resource Limits**: Memory and processing time limit protection
+
+### โก Performance Optimization
+
+- **๐ Async Processing**: Non-blocking concurrent operation support
+- **๐พ Memory Management**: Smart resource recycling and caching mechanisms
+- **๐ Batch Processing**: Efficient batch operation interfaces
+- **โฑ๏ธ Response Time**: Millisecond-level API response speed
+
+### ๐ง Scalability
+
+- **๐ Plugin Architecture**: Modular functionality extension support
+- **๐ Multi-protocol**: HTTP REST and MCP dual protocol support
+- **โ๏ธ Cloud Deployment**: Containerization and microservice architecture ready
+- **๐ Monitoring Integration**: Complete performance monitoring and metrics collection
+
+---
+
+## ๐ค Community & Support
+
+### ๐ฌ Get Help
+
+
+
+| ๐ Support Channel | ๐ Link | ๐ Description |
+|-------------------|---------|----------------|
+| **๐ Bug Reports** | [GitHub Issues](https://github.com/sun-guannan/CapCutAPI/issues) | Bug reports and feature requests |
+| **๐ก Feature Suggestions** | [Discussions](https://github.com/sun-guannan/CapCutAPI/discussions) | Community discussions and suggestions |
+| **๐ Documentation Feedback** | [Documentation Issues](https://github.com/sun-guannan/CapCutAPI/issues?q=label%3Adocumentation) | Documentation improvement suggestions |
+| **๐ง Technical Support** | [Stack Overflow](https://stackoverflow.com/questions/tagged/capcut-api) | Technical Q&A |
+
+
+
+### ๐ฏ Contributing Guide
+
+We welcome all forms of contributions!
+
+```bash
+# 1. Fork the project
+git clone https://github.com/your-username/CapCutAPI.git
+
+# 2. Create feature branch
+git checkout -b feature/amazing-feature
+
+# 3. Commit changes
+git commit -m 'Add amazing feature'
+
+# 4. Push branch
+git push origin feature/amazing-feature
+
+# 5. Create Pull Request
+```
+
+---
+
+## ๐ Project Statistics
+
+
+
+### โญ Star History
+
+[](https://www.star-history.com/#sun-guannan/CapCutAPI&Date)
+
+### ๐ Project Metrics
+
+
+
+
+
+
+
+
+
+---
+
+## ๐ License
+
+
+
+This project is open source under the MIT License. See [LICENSE](LICENSE) file for details.
----## ๐ ๏ธ Quick Start### ๐ System Requirements
| ๐ Python Environment | Python 3.8.20+ (Recommended 3.10+) |
| ๐ฌ CapCut Application | CapCut International or JianYing China |
| ๐ต FFmpeg | For media file processing and analysis |
| ๐พ Storage Space | At least 2GB available space |
### โก One-Click Installation```bash# 1. Clone the projectgit clone https://github.com/sun-guannan/CapCutAPI.gitcd CapCutAPI# 2. Create virtual environment (recommended)python -m venv venv-capcutsource venv-capcut/bin/activate # Linux/macOS# or venv-capcut\Scripts\activate # Windows# 3. Install dependenciespip install -r requirements.txt # HTTP API basic dependenciespip install -r requirements-mcp.txt # MCP protocol support (optional)# 4. Configurationcp config.json.example config.json# Edit config.json as needed```### ๐ Start Services
| **๐ HTTP API Server**```bashpython capcut_server.py```*Default port: 9001* | **๐ง MCP Protocol Server**```bashpython mcp_server.py```*Supports stdio communication* |
---## ๐ง MCP Integration Guide### ๐ฑ Client ConfigurationCreate or update `mcp_config.json` configuration file:```json{ "mcpServers": { "capcut-api": { "command": "python3", "args": ["mcp_server.py"], "cwd": "/path/to/CapCutAPI", "env": { "PYTHONPATH": "/path/to/CapCutAPI", "DEBUG": "0" } } }}```### ๐งช Connection Testing```bash# Test MCP connectionpython test_mcp_client.py# Expected outputโ
MCP server started successfullyโ
Retrieved 11 available toolsโ
Draft creation test passed```### ๐ฏ MCP Featured Functions
| Feature | Description | Example ||---------|-------------|----------|| ๐จ **Advanced Text Styling** | Multi-color, shadow, background effects | `shadow_enabled: true` || ๐ฌ **Keyframe Animation** | Position, scale, opacity animations | `property_types: ["scale_x", "alpha"]` || ๐ **Audio Precision Control** | Volume, speed, audio effects | `volume: 0.8, speed: 1.2` || ๐ฑ **Multi-format Support** | Various video dimensions and formats | `width: 1080, height: 1920` || โก **Real-time Processing** | Instant draft updates and previews | Millisecond response time |
---## ๐ก Usage Examples### ๐ HTTP API Examples
๐น Adding Video Material
```pythonimport requests# Add background videoresponse = requests.post("http://localhost:9001/add_video", json={ "video_url": "https://example.com/background.mp4", "start": 0, "end": 10, "width": 1080, "height": 1920, "volume": 0.8, "transition": "fade_in"})print(f"Video addition result: {response.json()}")```๐ Creating Styled Text
```pythonimport requests# Add title textresponse = requests.post("http://localhost:9001/add_text", json={ "text": "๐ฌ Welcome to CapCutAPI", "start": 0, "end": 5, "font": "Arial", "font_color": "#FFD700", "font_size": 48, "shadow_enabled": True, "background_color": "#000000"})print(f"Text addition result: {response.json()}")```### ๐ง MCP Protocol Examples
๐ฏ Complete Workflow
```python# 1. Create new projectdraft = mcp_client.call_tool("create_draft", { "width": 1080, "height": 1920})draft_id = draft["result"]["draft_id"]# 2. Add background videomcp_client.call_tool("add_video", { "video_url": "https://example.com/bg.mp4", "draft_id": draft_id, "start": 0, "end": 10, "volume": 0.6})# 3. Add title textmcp_client.call_tool("add_text", { "text": "AI-Driven Video Production", "draft_id": draft_id, "start": 1, "end": 6, "font_size": 56, "shadow_enabled": True, "background_color": "#1E1E1E"})# 4. Add keyframe animationmcp_client.call_tool("add_video_keyframe", { "draft_id": draft_id, "track_name": "main", "property_types": ["scale_x", "scale_y", "alpha"], "times": [0, 2, 4], "values": ["1.0", "1.2", "0.8"]})# 5. Save projectresult = mcp_client.call_tool("save_draft", { "draft_id": draft_id})print(f"Project saved: {result['result']['draft_url']}")```### Testing with REST ClientYou can use the `rest_client_test.http` file with REST Client IDE plugins for HTTP testing.### Draft ManagementCalling `save_draft` generates a folder starting with `dfd_` in the server's current directory. Copy this folder to your CapCut draft directory to access the generated draft in CapCut.---## ๐ Documentation Center
| ๐ Document Type | ๐ Language | ๐ Link | ๐ Description ||-----------------|-------------|---------|----------------|| **MCP Complete Guide** | ๐บ๐ธ English | [MCP Documentation](./MCP_Documentation_English.md) | Complete MCP server usage guide || **MCP User Manual** | ๐จ๐ณ Chinese | [MCP ไธญๆๆๆกฃ](./MCP_ๆๆกฃ_ไธญๆ.md) | Detailed Chinese usage instructions || **API Reference** | ๐บ๐ธ English | [example.py](./example.py) | Code examples and best practices || **REST Testing** | ๐ Universal | [rest_client_test.http](./rest_client_test.http) | HTTP interface test cases |
---## ๐ Enterprise Features### ๐ Security- **๐ก๏ธ Input Validation**: Strict parameter validation and type checking- **๐ Error Handling**: Comprehensive exception catching and error reporting- **๐ Logging**: Detailed operation logs and debug information- **๐ซ Resource Limits**: Memory and processing time limit protection### โก Performance Optimization- **๐ Async Processing**: Non-blocking concurrent operation support- **๐พ Memory Management**: Smart resource recycling and caching mechanisms- **๐ Batch Processing**: Efficient batch operation interfaces- **โฑ๏ธ Response Time**: Millisecond-level API response speed### ๐ง Scalability- **๐ Plugin Architecture**: Modular functionality extension support- **๐ Multi-protocol**: HTTP REST and MCP dual protocol support- **โ๏ธ Cloud Deployment**: Containerization and microservice architecture ready- **๐ Monitoring Integration**: Complete performance monitoring and metrics collection---## ๐ค Community & Support### ๐ฌ Get Help
| ๐ Support Channel | ๐ Link | ๐ Description ||-------------------|---------|----------------|| **๐ Bug Reports** | [GitHub Issues](https://github.com/sun-guannan/CapCutAPI/issues) | Bug reports and feature requests || **๐ก Feature Suggestions** | [Discussions](https://github.com/sun-guannan/CapCutAPI/discussions) | Community discussions and suggestions || **๐ Documentation Feedback** | [Documentation Issues](https://github.com/sun-guannan/CapCutAPI/issues?q=label%3Adocumentation) | Documentation improvement suggestions || **๐ง Technical Support** | [Stack Overflow](https://stackoverflow.com/questions/tagged/capcut-api) | Technical Q&A |
### ๐ฏ Contributing GuideWe welcome all forms of contributions!```bash# 1. Fork the projectgit clone https://github.com/your-username/CapCutAPI.git# 2. Create feature branchgit checkout -b feature/amazing-feature# 3. Commit changesgit commit -m 'Add amazing feature'# 4. Push branchgit push origin feature/amazing-feature# 5. Create Pull Request```---## ๐ Project Statistics
### โญ Star History[](https://www.star-history.com/#sun-guannan/CapCutAPI&Date)### ๐ Project Metrics
---## ๐ License
This project is open source under the MIT License. See [LICENSE](LICENSE) file for details.
MIT License
Copyright (c) 2024 CapCutAPI Contributors
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...
-
-
---
## ๐ Get Started Now**Experience the power of CapCutAPI today!**[](https://www.capcutapi.top)[](https://github.com/sun-guannan/CapCutAPI/archive/refs/heads/main.zip)[](./MCP_Documentation_English.md)---**๐ New Feature**: Now with MCP protocol support for seamless AI assistant integration! Try the MCP server for advanced video editing automation.*Made with โค๏ธ by the CapCutAPI Community*
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files...
+
+
+
+---
+
+
+
+## ๐ Get Started Now
+
+**Experience the power of CapCutAPI today!**
+
+[](https://www.capcutapi.top)
+[](https://github.com/sun-guannan/CapCutAPI/archive/refs/heads/main.zip)
+[](./MCP_Documentation_English.md)
+
+---
+
+**๐ New Feature**: Now with MCP protocol support for seamless AI assistant integration! Try the MCP server for advanced video editing automation.
+
+*Made with โค๏ธ by the CapCutAPI Community*