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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ cython_debug/
.nox/

# MacOS
.DS_Store
.DS_Store
88 changes: 88 additions & 0 deletions addons/photoshop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Lightfast MCP Plugin for Photoshop

This plugin provides a socket server inside Photoshop that allows the Lightfast MCP server to connect and control Photoshop.

## Features

- Socket server that listens on port 8765 (configurable)
- Command handling for common Photoshop operations
- UI panel to start/stop the server and monitor connections
- Support for executing arbitrary JSX code
- Document information retrieval

## Installation

### Prerequisites

- Adobe Photoshop 2021 (version 22.0) or later
- UXP Developer Tool (for development)

### Installation Steps

#### Development Installation (using UXP Developer Tool)

1. Download and install the [UXP Developer Tool](https://developer.adobe.com/photoshop/uxp/devtool/)
2. Open UXP Developer Tool
3. Click "Add Plugin" and select the folder containing this plugin
4. Click "Load" to load the plugin
5. Click "Actions" → "Debug" to launch the plugin in Photoshop

#### Production Installation

1. Package the plugin using UXP Developer Tool:
- Click "Package" on your plugin entry
- This will create a `.ccx` file
2. Install the package:
- In Photoshop, go to Plugins → Manage Plugins
- Click the "..." button and select "Install Plugins"
- Navigate to and select the `.ccx` file
- Follow the installation prompts

## Usage

1. Open the plugin panel in Photoshop via `Plugins → Lightfast MCP`
2. Set the desired port number (default: 8765)
3. Click "Start Server" to start the socket server
4. The Lightfast MCP server should now be able to connect to Photoshop
5. The UI will show the connection status and provide logs of operations

## Troubleshooting

- If you see a "Network access is not available" error, make sure the plugin has network permissions
- Ensure the port is not in use by another application
- Check the plugin logs for any error messages
- Verify your Photoshop version is 22.0 or later
- Try restarting Photoshop after installation

## Development

### Structure

- `manifest.json` - UXP plugin manifest
- `index.html` - UI panel HTML
- `styles.css` - CSS for UI panel
- `js/main.js` - JavaScript for the UI panel and socket server logic

### Adding New Commands

To add new commands, modify the `executeCommand` function in `js/main.js`:

```javascript
async function executeCommand(command) {
const { type, params = {} } = command;

switch (type) {
// Existing commands...

case 'your_new_command':
return {
status: 'success',
result: await yourNewFunction(params)
};

// ...
}
}
```

Then implement the corresponding function to handle the command.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions addons/photoshop/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Lightfast MCP Plugin</title>
<link rel="stylesheet" href="styles.css">
<script src="js/main.js"></script>
</head>
<body>
<div class="container">
<h1>Lightfast MCP Plugin</h1>

<div class="form-group">
<label for="port">Python Server Port:</label>
<input type="number" id="port" value="8765" min="1024" max="65535">
</div>

<div class="form-buttons">
<button id="connectButton" class="start">Connect to Server</button>
<button id="disconnectButton" class="stop" disabled>Disconnect</button>
</div>

<div class="status">
<div class="status-item">
Connection Status: <span id="serverStatus"><div class="indicator off"></div>Disconnected</span>
</div>
<div class="status-item">
Connected to Server: <span id="clientStatus"><div class="indicator off"></div>No</span>
</div>
</div>

<div class="log" id="log">
<div class="log-entry">Lightfast MCP Plugin initialized.</div>
</div>
</div>
</body>
</html>
Loading
Loading