Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@
</a>

## Table of Contents
- [Features](#features)
- [Core Composition Features](#core-composition-features)
- [Layer Management](#layer-management)
- [Animation Capabilities](#animation-capabilities)
- [Setup Instructions](#setup-instructions)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Update MCP Config](#Update-MCP-Config)
- [Running the Server](#running-the-server)
- [Usage Guide](#usage-guide)
- [Creating Compositions](#creating-compositions)
- [Working with Layers](#working-with-layers)
- [Animation](#animation)
- [Available MCP Tools](#available-mcp-tools)
- [For Developers](#for-developers)
- [Project Structure](#project-structure)
- [Building the Project](#building-the-project)
- [Contributing](#contributing)
- [License](#license)
- [🎬 After Effects MCP Server](#-after-effects-mcp-server)
- [Table of Contents](#table-of-contents)
- [📦 Features](#-features)
- [🎥 Core Composition Features](#-core-composition-features)
- [🧱 Layer Management](#-layer-management)
- [🌀 Animation Capabilities](#-animation-capabilities)
- [⚙️ Setup Instructions](#️-setup-instructions)
- [🛠 Prerequisites](#-prerequisites)
- [📥 Installation](#-installation)
- [🔧 Update MCP Config](#-update-mcp-config)
- [▶️ Running the Server](#️-running-the-server)
- [🚀 Usage Guide](#-usage-guide)
- [📘 Creating Compositions](#-creating-compositions)
- [✍️ Working with Layers](#️-working-with-layers)
- [🕹 Animation](#-animation)
- [🛠 Available MCP Tools](#-available-mcp-tools)
- [👨‍💻 For Developers](#-for-developers)
- [🧩 Project Structure](#-project-structure)
- [📦 Building the Project](#-building-the-project)
- [🤝 Contributing](#-contributing)
- [License](#license)

## 📦 Features

Expand Down Expand Up @@ -86,6 +88,8 @@
```
This will copy the necessary scripts to your After Effects installation.

> **Note:** On macOS, you may need to run the install command with sudo due to permission requirements:

### 🔧 Update MCP Config

Go to your client (eg. Claude or Cursor ) and update your config file
Expand Down
18 changes: 18 additions & 0 deletions build-scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// build-scripts.js
import { execSync } from 'child_process';
import os from 'os';

try {
// Compile TypeScript
execSync('tsc', { stdio: 'inherit' });

// Copy scripts based on the operating system
if (os.platform() === 'darwin') {
execSync('cp -R ./src/scripts ./build/scripts', { stdio: 'inherit' });
} else {
execSync('xcopy .\\src\\scripts .\\build\\scripts /E /I /Y', { stdio: 'inherit' });
}
} catch (error) {
console.error('Error during build:', error.message);
process.exit(1);
}
112 changes: 64 additions & 48 deletions install-bridge.js
Original file line number Diff line number Diff line change
@@ -1,86 +1,102 @@
#!/usr/bin/env node

// install-bridge.js
// Script to install the After Effects MCP Bridge to the ScriptUI Panels folder

import { execSync } from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import os from 'os';
import { fileURLToPath } from 'url';

// ES Modules replacement for __dirname
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// Possible After Effects installation paths (common locations)
const possiblePaths = [
'C:\\Program Files\\Adobe\\Adobe After Effects 2025',
'C:\\Program Files\\Adobe\\Adobe After Effects 2024',
'C:\\Program Files\\Adobe\\Adobe After Effects 2023',
'C:\\Program Files\\Adobe\\Adobe After Effects 2022',
'C:\\Program Files\\Adobe\\Adobe After Effects 2021'
];
const possiblePaths = {
darwin: [
'/Applications/Adobe After Effects 2025',
'/Applications/Adobe After Effects 2024',
'/Applications/Adobe After Effects 2023',
'/Applications/Adobe After Effects 2022',
'/Applications/Adobe After Effects 2021'
],
win32: [
'C:\\Program Files\\Adobe\\Adobe After Effects 2025',
'C:\\Program Files\\Adobe\\Adobe After Effects 2024',
'C:\\Program Files\\Adobe\\Adobe After Effects 2023',
'C:\\Program Files\\Adobe\\Adobe After Effects 2022',
'C:\\Program Files\\Adobe\\Adobe After Effects 2021'
]
};

// Find valid After Effects installation
let afterEffectsPath = null;
for (const testPath of possiblePaths) {
if (fs.existsSync(testPath)) {
afterEffectsPath = testPath;
break;
const findAfterEffectsPath = (platform) => {
for (const testPath of possiblePaths[platform]) {
if (fs.existsSync(testPath)) {
return testPath;
}
}
}
return null;
};

const platform = os.platform();
const afterEffectsPath = findAfterEffectsPath(platform);

if (!afterEffectsPath) {
console.error('Error: Could not find After Effects installation.');
console.error('Please manually copy the bridge script to your After Effects ScriptUI Panels folder.');
console.error('Source: build/scripts/mcp-bridge-auto.jsx');
console.error('Target: C:\\Program Files\\Adobe\\Adobe After Effects [VERSION]\\Support Files\\Scripts\\ScriptUI Panels\\');
console.error(`Target: ${platform === 'darwin' ? '/Applications/Adobe After Effects [VERSION]/Scripts/ScriptUI Panels/' : 'C:\\Program Files\\Adobe\\Adobe After Effects [VERSION]\\Support Files\\Scripts\\ScriptUI Panels\\'}`);
process.exit(1);
}

// Define source and destination paths
// Define the source and destination paths
const sourceScript = path.join(__dirname, 'build', 'scripts', 'mcp-bridge-auto.jsx');
const destinationFolder = path.join(afterEffectsPath, 'Support Files', 'Scripts', 'ScriptUI Panels');
const destinationFolder = path.join(afterEffectsPath, platform === 'darwin' ? 'Scripts/ScriptUI Panels' : 'Support Files\\Scripts\\ScriptUI Panels');
const destinationScript = path.join(destinationFolder, 'mcp-bridge-auto.jsx');

// Ensure source script exists
// Check if the source script exists
if (!fs.existsSync(sourceScript)) {
console.error(`Error: Source script not found at ${sourceScript}`);
console.error('Please run "npm run build" first to generate the script.');
console.error("Please run 'npm run build' first to generate the script.");
process.exit(1);
}

// Create destination folder if it doesn't exist
// Create the destination folder if it doesn't exist
if (!fs.existsSync(destinationFolder)) {
console.log('Creating destination folder...');
try {
fs.mkdirSync(destinationFolder, { recursive: true });
} catch (error) {
console.error(`Error creating destination folder: ${error.message}`);
console.error('You may need administrative privileges to install the script.');
} catch (err) {
console.error('Error creating destination folder. You may need administrative privileges.');
process.exit(1);
}
}

// Copy the script with elevated privileges (for Windows)
// Copy the script to the destination
console.log(`Installing bridge script to ${destinationScript}...`);
try {
console.log(`Installing bridge script to ${destinationScript}...`);

// Try to use PowerShell with elevated privileges on Windows
const command = `
Start-Process PowerShell -Verb RunAs -ArgumentList "-Command Copy-Item -Path '${sourceScript.replace(/\\/g, '\\\\')}' -Destination '${destinationScript.replace(/\\/g, '\\\\')}' -Force"
`;

execSync(`powershell -Command "${command}"`, { stdio: 'inherit' });

console.log('Bridge script installed successfully!');
console.log('\nImportant next steps:');
console.log('1. Open After Effects');
console.log('2. Go to Edit > Preferences > Scripting & Expressions');
console.log('3. Enable "Allow Scripts to Write Files and Access Network"');
console.log('4. Restart After Effects');
console.log('5. Open the bridge panel: Window > mcp-bridge-auto.jsx');
} catch (error) {
console.error(`Error installing script: ${error.message}`);
console.error('\nPlease try manual installation:');
console.error(`1. Copy: ${sourceScript}`);
console.error(`2. To: ${destinationScript}`);
console.error('3. You may need to run as administrator or use File Explorer with admin rights');
if (platform === 'win32') {
// Use PowerShell with elevated privileges on Windows
const command = `
Start-Process PowerShell -Verb RunAs -ArgumentList "-Command Copy-Item -Path '${sourceScript.replace(/\\/g, '\\\\')}' -Destination '${destinationScript.replace(/\\/g, '\\\\')}' -Force"
`;
execSync(`powershell -Command "${command}"`, { stdio: 'inherit' });
} else {
fs.copyFileSync(sourceScript, destinationScript);
}
} catch (err) {
console.error('Error installing script. You may need to run this script with elevated privileges.');
process.exit(1);
}
}

console.log('Bridge script installed successfully!');
console.log('');
console.log('Important next steps:');
console.log('1. Open After Effects');
console.log(`2. Go to ${platform === 'darwin' ? 'After Effects > Preferences > Scripting & Expressions' : 'Edit > Preferences > Scripting & Expressions'}`);
console.log("3. Enable 'Allow Scripts to Write Files and Access Network'");
console.log('4. Restart After Effects');
console.log('5. Open the bridge panel: Window > mcp-bridge-auto.jsx');
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "build/index.js",
"type": "module",
"scripts": {
"build": "tsc && xcopy .\\src\\scripts .\\build\\scripts /E /I /Y",
"build": "node build-scripts.js",
"start": "node build/index.js",
"install-bridge": "node install-bridge.js",
"postinstall": "npm run build"
Expand Down