MCP_FIX_README.md•5.89 kB
# After Effects Motion Control Panel (MCP) Fix
This package contains tools to fix the issue where the web UI shows commands as successful but After Effects reports "No command file found" when checking for commands.
## The Problem
The MCP system consists of:
1. A web UI that sends commands to a server
2. A server that writes command files to a specific location
3. An After Effects script that checks for and processes these command files
The issue occurs when:
- The server reports success but doesn't actually write the command file
- The command file is written to a location different from where After Effects is looking
- There are permission issues preventing file creation or access
- The communication between components is broken
## Solution Components
This package includes several tools to diagnose and fix the issue:
1. **Fix Permissions Batch Script** (`fix_permissions.bat`)
- Creates the C:\ae_temp directory if it doesn't exist
- Sets proper permissions so all applications can read/write to it
- Creates a test file to verify everything works
2. **After Effects Command Fix Script** (`ae_command_fix.jsx`)
- Shows exactly where After Effects is looking for command files
- Tests if the directory exists and is writable
- Creates and processes command files directly
- Monitors for new commands automatically
3. **Complete MCP Fix Script** (`complete_mcp_fix.py`)
- Fixes the server code to ensure commands are written to the correct location
- Adds verification steps to confirm commands are being sent
- Provides a WebSocket connection for real-time status updates
4. **MCP Status Monitor** (`mcp_status.html`)
- Shows live status of the MCP system
- Displays command processing in real-time
- Shows file existence and command results
- Provides a simple interface to send commands
## Step-by-Step Fix Instructions
### Step 1: Run Fix Permissions Script
1. Right-click on `fix_permissions.bat` and select "Run as administrator"
2. The script will:
- Create the C:\ae_temp directory if it doesn't exist
- Set full permissions for all users
- Create a test file to verify everything works
3. If successful, you'll see "All operations completed successfully!"
### Step 2: Install After Effects Command Fix Script
1. In After Effects, go to File > Scripts > Run Script File...
2. Select the `ae_command_fix.jsx` file
3. The script will open a panel showing:
- The status of the command directory
- Controls to check for commands, create test commands, etc.
- A log of all operations
### Step 3: Start the Complete MCP Fix Script
1. Open a command prompt or PowerShell window
2. Navigate to the directory containing the fix scripts
3. Run: `python complete_mcp_fix.py`
4. The script will:
- Ensure the temp directory exists
- Start a WebSocket server for real-time communication
- Create a test command file
- Monitor for command results
### Step 4: Open the MCP Status Monitor
1. Open the `mcp_status.html` file in a web browser
2. The status monitor will:
- Connect to the WebSocket server
- Show the current status of the system
- Display file existence and command results
- Provide a simple interface to send commands
## Testing the Fix
1. In the MCP Status Monitor, enter a command in the input field and click "Send Command"
2. The command will be processed by the Complete MCP Fix Script
3. A command file will be created in C:\ae_temp
4. Click "Check for Command" in After Effects (or use the automatic monitor)
5. After Effects will process the command and create a result file
6. The MCP Status Monitor will show the result
## Troubleshooting
### After Effects still reports "No command file found"
1. Check that the C:\ae_temp directory exists
2. Verify that the command file is being created (check the logs)
3. Make sure After Effects has permission to access the directory
4. Try creating a test command file manually using the AE Command Fix Script
### Web UI shows success but nothing happens
1. Check that the Complete MCP Fix Script is running
2. Verify that the WebSocket connection is established
3. Check the logs for any errors
4. Try restarting the Complete MCP Fix Script
### Permission errors
1. Run the Fix Permissions Batch Script again as administrator
2. Check that the C:\ae_temp directory has full permissions for all users
3. Try creating a file in the directory manually to verify permissions
## Technical Details
### Command File Format
The command file (command.json) uses this format:
```json
{
"action": "create_text_layer",
"params": {
"text": "Example Text",
"fontSize": 72,
"color": "#00AAFF"
}
}
```
### Result File Format
The result file (result.json) uses this format:
```json
{
"status": "success",
"message": "Command processed successfully",
"timestamp": 1621234567890
}
```
### WebSocket Communication
The WebSocket server runs on port 8001 and accepts these message types:
- `command`: Direct command object
- `gemini_command`: Text command to be processed by Gemini AI
- `check_file_status`: Request to check file status
The server sends these message types:
- `status`: General status information
- `log`: Log messages
- `result`: Command result information
- `ai_status`: AI processing status
- `reminder`: Reminder messages
- `file_status`: File existence information
## Next Steps
Once you've verified that the fix works:
1. Integrate the Complete MCP Fix Script into your main server
2. Update your After Effects script to use the new command file location
3. Consider adding the real-time status monitor to your web UI
## Support
If you continue to experience issues, please:
1. Check the log files generated by the Complete MCP Fix Script
2. Take screenshots of any error messages
3. Note the exact steps that led to the issue
4. Contact support with this information