dcc-mcp-premiere 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dcc_mcp_premiere-0.2.0/.github/workflows/ci.yml +36 -0
- dcc_mcp_premiere-0.2.0/.github/workflows/release.yml +35 -0
- dcc_mcp_premiere-0.2.0/.gitignore +8 -0
- dcc_mcp_premiere-0.2.0/.release-please-manifest.json +1 -0
- dcc_mcp_premiere-0.2.0/CHANGELOG.md +22 -0
- dcc_mcp_premiere-0.2.0/LICENSE +21 -0
- dcc_mcp_premiere-0.2.0/PKG-INFO +42 -0
- dcc_mcp_premiere-0.2.0/README.md +17 -0
- dcc_mcp_premiere-0.2.0/pyproject.toml +39 -0
- dcc_mcp_premiere-0.2.0/release-please-config.json +1 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/__init__.py +6 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/__version__.py +3 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/bridge.py +132 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/premiere_uxp/index.html +1 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/premiere_uxp/index.js +25 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/premiere_uxp/manifest.json +1 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/server.py +57 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/skills/premiere-project/SKILL.md +20 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/skills/premiere-project/scripts/inspect_project.py +16 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/skills/premiere-project/scripts/list_sequences.py +16 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/skills/premiere-project/scripts/save_project.py +16 -0
- dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/skills/premiere-project/tools.yaml +31 -0
- dcc_mcp_premiere-0.2.0/tests/test_bridge.py +16 -0
- dcc_mcp_premiere-0.2.0/tests/test_package.py +17 -0
- dcc_mcp_premiere-0.2.0/tools/lint_skills.py +8 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
19
|
+
python-version: ["3.9", "3.11", "3.12"]
|
|
20
|
+
exclude:
|
|
21
|
+
- os: windows-latest
|
|
22
|
+
python-version: "3.9"
|
|
23
|
+
- os: macos-latest
|
|
24
|
+
python-version: "3.9"
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
- uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ matrix.python-version }}
|
|
30
|
+
- run: python -m pip install -e ".[dev]"
|
|
31
|
+
- run: pytest
|
|
32
|
+
- run: ruff check src tests tools
|
|
33
|
+
- run: ruff format --check src tests tools
|
|
34
|
+
- run: python tools/lint_skills.py
|
|
35
|
+
- run: python -m build
|
|
36
|
+
- run: python -m twine check dist/*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
release-please:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
outputs:
|
|
17
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
18
|
+
steps:
|
|
19
|
+
- id: release
|
|
20
|
+
uses: googleapis/release-please-action@v4
|
|
21
|
+
with:
|
|
22
|
+
config-file: release-please-config.json
|
|
23
|
+
manifest-file: .release-please-manifest.json
|
|
24
|
+
publish:
|
|
25
|
+
needs: release-please
|
|
26
|
+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
environment: pypi
|
|
29
|
+
permissions: {id-token: write, contents: read}
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
- uses: actions/setup-python@v5
|
|
33
|
+
with: {python-version: "3.12"}
|
|
34
|
+
- run: python -m pip install build && python -m build
|
|
35
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{".":"0.2.0"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.2.0](https://github.com/dcc-mcp/dcc-mcp-premiere/compare/v0.1.0...v0.2.0) (2026-07-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add Premiere MCP adapter ([0cbf195](https://github.com/dcc-mcp/dcc-mcp-premiere/commit/0cbf1957b69a0891e827686bf9027a5b7b335a23))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* make release tests and UXP entry point robust ([f9729c4](https://github.com/dcc-mcp/dcc-mcp-premiere/commit/f9729c440d4019d6e13e5a50aeb40369dc0e2bc8))
|
|
16
|
+
* use valid CI expression syntax ([3d5ba21](https://github.com/dcc-mcp/dcc-mcp-premiere/commit/3d5ba21ddfd294539d5bcee72a27fed79f60f0e8))
|
|
17
|
+
|
|
18
|
+
## [0.1.0] - 2026-07-14
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Initial Premiere Pro MCP adapter with UXP bridge and typed project tools.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dcc-mcp contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dcc-mcp-premiere
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: MCP adapter for Adobe Premiere Pro
|
|
5
|
+
Project-URL: Homepage, https://github.com/dcc-mcp/dcc-mcp-premiere
|
|
6
|
+
Project-URL: Repository, https://github.com/dcc-mcp/dcc-mcp-premiere
|
|
7
|
+
Author-email: loonghao <hal.long@outlook.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Requires-Dist: dcc-mcp-core<1.0.0,>=0.19.13
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
22
|
+
Requires-Dist: ruff>=0.8; extra == 'dev'
|
|
23
|
+
Requires-Dist: twine>=6; extra == 'dev'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# dcc-mcp-premiere
|
|
27
|
+
|
|
28
|
+
MCP adapter for Adobe Premiere Pro. It uses a bundled UXP panel as a typed, localhost-only bridge to Premiere's project APIs.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install dcc-mcp-premiere
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Load the installed `dcc_mcp_premiere/premiere_uxp` folder with Adobe UXP Developer Tool in Premiere Pro 25.6 or later. The MCP endpoint defaults to `http://127.0.0.1:8765/mcp`.
|
|
35
|
+
|
|
36
|
+
Set the same non-default `DCC_MCP_PREMIERE_BRIDGE_TOKEN` in the adapter environment and the UXP panel before production use.
|
|
37
|
+
|
|
38
|
+
## Tools
|
|
39
|
+
|
|
40
|
+
- `premiere-project.inspect_project`
|
|
41
|
+
- `premiere-project.list_sequences`
|
|
42
|
+
- `premiere-project.save_project`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# dcc-mcp-premiere
|
|
2
|
+
|
|
3
|
+
MCP adapter for Adobe Premiere Pro. It uses a bundled UXP panel as a typed, localhost-only bridge to Premiere's project APIs.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install dcc-mcp-premiere
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Load the installed `dcc_mcp_premiere/premiere_uxp` folder with Adobe UXP Developer Tool in Premiere Pro 25.6 or later. The MCP endpoint defaults to `http://127.0.0.1:8765/mcp`.
|
|
10
|
+
|
|
11
|
+
Set the same non-default `DCC_MCP_PREMIERE_BRIDGE_TOKEN` in the adapter environment and the UXP panel before production use.
|
|
12
|
+
|
|
13
|
+
## Tools
|
|
14
|
+
|
|
15
|
+
- `premiere-project.inspect_project`
|
|
16
|
+
- `premiere-project.list_sequences`
|
|
17
|
+
- `premiere-project.save_project`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "dcc-mcp-premiere"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "MCP adapter for Adobe Premiere Pro"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "loonghao", email = "hal.long@outlook.com" }]
|
|
13
|
+
classifiers = ["Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12"]
|
|
14
|
+
dependencies = ["dcc-mcp-core>=0.19.13,<1.0.0"]
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://github.com/dcc-mcp/dcc-mcp-premiere"
|
|
18
|
+
Repository = "https://github.com/dcc-mcp/dcc-mcp-premiere"
|
|
19
|
+
|
|
20
|
+
[project.optional-dependencies]
|
|
21
|
+
dev = ["build>=1.2", "pytest>=8", "ruff>=0.8", "twine>=6"]
|
|
22
|
+
|
|
23
|
+
[project.entry-points."dcc_mcp.adapters"]
|
|
24
|
+
premiere = "dcc_mcp_premiere:PremiereMcpServer"
|
|
25
|
+
|
|
26
|
+
[tool.hatch.build.targets.wheel]
|
|
27
|
+
packages = ["src/dcc_mcp_premiere"]
|
|
28
|
+
artifacts = ["src/dcc_mcp_premiere/skills/**", "src/dcc_mcp_premiere/premiere_uxp/**"]
|
|
29
|
+
|
|
30
|
+
[tool.pytest.ini_options]
|
|
31
|
+
testpaths = ["tests"]
|
|
32
|
+
|
|
33
|
+
[tool.ruff]
|
|
34
|
+
target-version = "py39"
|
|
35
|
+
line-length = 100
|
|
36
|
+
|
|
37
|
+
[tool.ruff.lint]
|
|
38
|
+
select = ["E", "F", "I", "B"]
|
|
39
|
+
ignore = ["E501"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"packages":{".":{"release-type":"python","package-name":"dcc-mcp-premiere","changelog-path":"CHANGELOG.md","include-component-in-tag":false,"extra-files":[{"type":"toml","path":"pyproject.toml","jsonpath":"$.project.version"},{"type":"generic","path":"src/dcc_mcp_premiere/__version__.py"}]}}}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""Minimal localhost request broker shared by the MCP server and UXP panel."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import os
|
|
7
|
+
import queue
|
|
8
|
+
import threading
|
|
9
|
+
import uuid
|
|
10
|
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|
11
|
+
from typing import Any, Optional
|
|
12
|
+
from urllib.request import Request, urlopen
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class BridgeBroker:
|
|
16
|
+
"""Queue typed requests until the installed Adobe panel completes them."""
|
|
17
|
+
|
|
18
|
+
def __init__(self, prefix: str, default_port: int) -> None:
|
|
19
|
+
self._prefix = prefix
|
|
20
|
+
self._port = int(os.environ.get(f"{prefix}_BRIDGE_PORT", default_port))
|
|
21
|
+
self._token = os.environ.get(f"{prefix}_BRIDGE_TOKEN", "dev-token")
|
|
22
|
+
self._pending: queue.Queue[dict[str, Any]] = queue.Queue()
|
|
23
|
+
self._waiting: dict[str, tuple[threading.Event, dict[str, Any]]] = {}
|
|
24
|
+
self._lock = threading.Lock()
|
|
25
|
+
self._httpd: Optional[ThreadingHTTPServer] = None
|
|
26
|
+
self._thread: Optional[threading.Thread] = None
|
|
27
|
+
os.environ.setdefault(f"{prefix}_BRIDGE_URL", f"http://127.0.0.1:{self._port}")
|
|
28
|
+
|
|
29
|
+
def start(self) -> None:
|
|
30
|
+
if self._httpd is not None:
|
|
31
|
+
return
|
|
32
|
+
broker = self
|
|
33
|
+
|
|
34
|
+
class Handler(BaseHTTPRequestHandler):
|
|
35
|
+
def do_GET(self): # noqa: N802
|
|
36
|
+
if self.path != "/next" or not self._authorized():
|
|
37
|
+
return self._send(403, {"error": "forbidden"})
|
|
38
|
+
self._send(200, broker.next())
|
|
39
|
+
|
|
40
|
+
def do_POST(self): # noqa: N802
|
|
41
|
+
if not self._authorized():
|
|
42
|
+
return self._send(403, {"error": "forbidden"})
|
|
43
|
+
try:
|
|
44
|
+
payload = json.loads(self.rfile.read(int(self.headers["Content-Length"])))
|
|
45
|
+
except (KeyError, ValueError, json.JSONDecodeError):
|
|
46
|
+
return self._send(400, {"error": "invalid JSON"})
|
|
47
|
+
if self.path == "/call":
|
|
48
|
+
try:
|
|
49
|
+
return self._send(
|
|
50
|
+
200, broker.submit(payload["action"], payload.get("params", {}))
|
|
51
|
+
)
|
|
52
|
+
except (KeyError, RuntimeError) as error:
|
|
53
|
+
return self._send(503, {"error": str(error)})
|
|
54
|
+
if self.path == "/result":
|
|
55
|
+
broker.resolve(
|
|
56
|
+
payload.get("id", ""), payload.get("result"), payload.get("error")
|
|
57
|
+
)
|
|
58
|
+
return self._send(200, {"ok": True})
|
|
59
|
+
return self._send(404, {"error": "not found"})
|
|
60
|
+
|
|
61
|
+
def log_message(self, *_: Any) -> None:
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
def _authorized(self) -> bool:
|
|
65
|
+
return self.headers.get("X-DCC-MCP-Token") == broker._token
|
|
66
|
+
|
|
67
|
+
def _send(self, status: int, payload: dict[str, Any]) -> None:
|
|
68
|
+
body = json.dumps(payload).encode("utf-8")
|
|
69
|
+
self.send_response(status)
|
|
70
|
+
self.send_header("Content-Type", "application/json")
|
|
71
|
+
self.send_header("Content-Length", str(len(body)))
|
|
72
|
+
self.end_headers()
|
|
73
|
+
self.wfile.write(body)
|
|
74
|
+
|
|
75
|
+
self._httpd = ThreadingHTTPServer(("127.0.0.1", self._port), Handler)
|
|
76
|
+
self._thread = threading.Thread(target=self._httpd.serve_forever, daemon=True)
|
|
77
|
+
self._thread.start()
|
|
78
|
+
|
|
79
|
+
def stop(self) -> None:
|
|
80
|
+
if self._httpd is not None:
|
|
81
|
+
self._httpd.shutdown()
|
|
82
|
+
self._httpd.server_close()
|
|
83
|
+
self._httpd = None
|
|
84
|
+
|
|
85
|
+
def submit(self, action: str, params: dict[str, Any], timeout: int = 30) -> dict[str, Any]:
|
|
86
|
+
request_id = uuid.uuid4().hex
|
|
87
|
+
completed, result = threading.Event(), {}
|
|
88
|
+
with self._lock:
|
|
89
|
+
self._waiting[request_id] = (completed, result)
|
|
90
|
+
self._pending.put({"id": request_id, "action": action, "params": params})
|
|
91
|
+
if not completed.wait(timeout):
|
|
92
|
+
with self._lock:
|
|
93
|
+
self._waiting.pop(request_id, None)
|
|
94
|
+
raise RuntimeError("Adobe bridge did not respond; load the bundled panel")
|
|
95
|
+
if "error" in result:
|
|
96
|
+
raise RuntimeError(str(result["error"]))
|
|
97
|
+
return result.get("result", {})
|
|
98
|
+
|
|
99
|
+
def next(self) -> dict[str, Any]:
|
|
100
|
+
try:
|
|
101
|
+
return self._pending.get(timeout=25)
|
|
102
|
+
except queue.Empty:
|
|
103
|
+
return {"id": None}
|
|
104
|
+
|
|
105
|
+
def resolve(self, request_id: str, result: Any, error: Any) -> None:
|
|
106
|
+
with self._lock:
|
|
107
|
+
waiting = self._waiting.pop(request_id, None)
|
|
108
|
+
if waiting is None:
|
|
109
|
+
return
|
|
110
|
+
completed, payload = waiting
|
|
111
|
+
if error:
|
|
112
|
+
payload["error"] = error
|
|
113
|
+
else:
|
|
114
|
+
payload["result"] = result if isinstance(result, dict) else {"value": result}
|
|
115
|
+
completed.set()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def call_bridge(prefix: str, action: str, params: dict[str, Any]) -> dict[str, Any]:
|
|
119
|
+
"""Call a running adapter-local bridge from a skill subprocess."""
|
|
120
|
+
url = os.environ[f"{prefix}_BRIDGE_URL"].rstrip("/") + "/call"
|
|
121
|
+
token = os.environ.get(f"{prefix}_BRIDGE_TOKEN", "dev-token")
|
|
122
|
+
request = Request(
|
|
123
|
+
url,
|
|
124
|
+
data=json.dumps({"action": action, "params": params}).encode("utf-8"),
|
|
125
|
+
headers={"Content-Type": "application/json", "X-DCC-MCP-Token": token},
|
|
126
|
+
method="POST",
|
|
127
|
+
)
|
|
128
|
+
with urlopen(request, timeout=35) as response: # noqa: S310 - loopback URL is adapter-owned.
|
|
129
|
+
payload = json.loads(response.read().decode("utf-8"))
|
|
130
|
+
if "error" in payload:
|
|
131
|
+
raise RuntimeError(payload["error"])
|
|
132
|
+
return payload
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><body><script src="index.js"></script>DCC MCP bridge connected.</body></html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const app = require("premierepro");
|
|
2
|
+
const baseUrl = "http://127.0.0.1:47393";
|
|
3
|
+
const token = "dev-token"; // Set the same value as DCC_MCP_PREMIERE_BRIDGE_TOKEN before production use.
|
|
4
|
+
|
|
5
|
+
async function reply(id, result, error) {
|
|
6
|
+
await fetch(`${baseUrl}/result`, {method: "POST", headers: {"Content-Type": "application/json", "X-DCC-MCP-Token": token}, body: JSON.stringify({id, result, error})});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function project() { return app.project; }
|
|
10
|
+
function dispatch(job) {
|
|
11
|
+
const current = project();
|
|
12
|
+
if (job.action === "inspect_project") return {project_name: current.name || null, active_sequence: current.activeSequence ? current.activeSequence.name : null};
|
|
13
|
+
if (job.action === "list_sequences") return {sequences: Array.from(current.sequences || []).map(sequence => ({name: sequence.name})), sequence_count: (current.sequences || []).length || 0};
|
|
14
|
+
if (job.action === "save_project") { current.save(); return {saved: true}; }
|
|
15
|
+
throw new Error(`Unsupported action: ${job.action}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function poll() {
|
|
19
|
+
try {
|
|
20
|
+
const response = await fetch(`${baseUrl}/next`, {headers: {"X-DCC-MCP-Token": token}});
|
|
21
|
+
const job = await response.json();
|
|
22
|
+
if (job.id) { try { await reply(job.id, dispatch(job), null); } catch (error) { await reply(job.id, null, String(error)); } }
|
|
23
|
+
} finally { setTimeout(poll, 50); }
|
|
24
|
+
}
|
|
25
|
+
poll();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"com.dccmcp.premiere","name":"DCC MCP Premiere Bridge","version":"0.1.0","manifestVersion":5,"host":[{"app":"premierepro","minVersion":"25.6.0"}],"requiredPermissions":{"network":{"domains":["http://127.0.0.1"]}},"entrypoints":[{"type":"panel","id":"dccMcp","label":"DCC MCP","main":"index.html"}]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Premiere Pro MCP server lifecycle."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
from dcc_mcp_core import DccServerOptions
|
|
10
|
+
from dcc_mcp_core.server_base import DccServerBase
|
|
11
|
+
|
|
12
|
+
from .__version__ import __version__
|
|
13
|
+
from .bridge import BridgeBroker
|
|
14
|
+
|
|
15
|
+
DEFAULT_PORT = 8765
|
|
16
|
+
_server: Optional["PremiereMcpServer"] = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class PremiereMcpServer(DccServerBase):
|
|
20
|
+
"""MCP server whose typed calls are completed by the UXP panel."""
|
|
21
|
+
|
|
22
|
+
def __init__(self, port: int = DEFAULT_PORT) -> None:
|
|
23
|
+
self.bridge = BridgeBroker("DCC_MCP_PREMIERE", 47393)
|
|
24
|
+
options = DccServerOptions.from_env(
|
|
25
|
+
"premiere",
|
|
26
|
+
Path(__file__).resolve().parent / "skills",
|
|
27
|
+
port=port,
|
|
28
|
+
server_name="dcc-mcp-premiere",
|
|
29
|
+
server_version=__version__,
|
|
30
|
+
)
|
|
31
|
+
super().__init__(options=options)
|
|
32
|
+
|
|
33
|
+
def start(self, **kwargs):
|
|
34
|
+
self.bridge.start()
|
|
35
|
+
return super().start(**kwargs)
|
|
36
|
+
|
|
37
|
+
def stop(self) -> None:
|
|
38
|
+
super().stop()
|
|
39
|
+
self.bridge.stop()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def start_server(port: Optional[int] = None) -> PremiereMcpServer:
|
|
43
|
+
global _server
|
|
44
|
+
if _server is None or not _server.is_running:
|
|
45
|
+
_server = PremiereMcpServer(
|
|
46
|
+
port or int(os.environ.get("DCC_MCP_PREMIERE_PORT", DEFAULT_PORT))
|
|
47
|
+
)
|
|
48
|
+
_server.register_builtin_actions()
|
|
49
|
+
_server.start()
|
|
50
|
+
return _server
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def stop_server() -> None:
|
|
54
|
+
global _server
|
|
55
|
+
if _server is not None:
|
|
56
|
+
_server.stop()
|
|
57
|
+
_server = None
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: premiere-project
|
|
3
|
+
description: >-
|
|
4
|
+
Host skill - inspect sequences and explicitly save the active Premiere project.
|
|
5
|
+
Use when working with Premiere projects. Not for raw JavaScript execution.
|
|
6
|
+
license: MIT
|
|
7
|
+
compatibility: "Premiere Pro 25.6+ UXP; dcc-mcp-core 0.19+"
|
|
8
|
+
allowed-tools: Python
|
|
9
|
+
metadata:
|
|
10
|
+
dcc-mcp:
|
|
11
|
+
dcc: premiere
|
|
12
|
+
version: "0.1.0"
|
|
13
|
+
layer: domain
|
|
14
|
+
stage: scene
|
|
15
|
+
search-hint: "premiere project sequence inspect save"
|
|
16
|
+
tags: "adobe, premiere, video, sequence"
|
|
17
|
+
tools: tools.yaml
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Premiere Project
|
dcc_mcp_premiere-0.2.0/src/dcc_mcp_premiere/skills/premiere-project/scripts/inspect_project.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from dcc_mcp_core.skill import skill_entry, skill_success
|
|
2
|
+
|
|
3
|
+
from dcc_mcp_premiere.bridge import call_bridge
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@skill_entry
|
|
7
|
+
def main(**_kwargs):
|
|
8
|
+
return skill_success(
|
|
9
|
+
"Premiere project inspected.", **call_bridge("DCC_MCP_PREMIERE", "inspect_project", {})
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
from dcc_mcp_core.skill import run_main
|
|
15
|
+
|
|
16
|
+
run_main(main)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from dcc_mcp_core.skill import skill_entry, skill_success
|
|
2
|
+
|
|
3
|
+
from dcc_mcp_premiere.bridge import call_bridge
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@skill_entry
|
|
7
|
+
def main(**_kwargs):
|
|
8
|
+
return skill_success(
|
|
9
|
+
"Premiere sequences listed.", **call_bridge("DCC_MCP_PREMIERE", "list_sequences", {})
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
from dcc_mcp_core.skill import run_main
|
|
15
|
+
|
|
16
|
+
run_main(main)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from dcc_mcp_core.skill import skill_entry, skill_success
|
|
2
|
+
|
|
3
|
+
from dcc_mcp_premiere.bridge import call_bridge
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@skill_entry
|
|
7
|
+
def main(**_kwargs):
|
|
8
|
+
return skill_success(
|
|
9
|
+
"Premiere project saved.", **call_bridge("DCC_MCP_PREMIERE", "save_project", {})
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
from dcc_mcp_core.skill import run_main
|
|
15
|
+
|
|
16
|
+
run_main(main)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
tools:
|
|
2
|
+
- name: inspect_project
|
|
3
|
+
description: Return the active Premiere project and sequence metadata.
|
|
4
|
+
input_schema: {type: object, properties: {}}
|
|
5
|
+
read_only: true
|
|
6
|
+
destructive: false
|
|
7
|
+
idempotent: true
|
|
8
|
+
execution: sync
|
|
9
|
+
affinity: any
|
|
10
|
+
timeout_hint_secs: 30
|
|
11
|
+
source_file: scripts/inspect_project.py
|
|
12
|
+
- name: list_sequences
|
|
13
|
+
description: List sequences in the active Premiere project.
|
|
14
|
+
input_schema: {type: object, properties: {}}
|
|
15
|
+
read_only: true
|
|
16
|
+
destructive: false
|
|
17
|
+
idempotent: true
|
|
18
|
+
execution: sync
|
|
19
|
+
affinity: any
|
|
20
|
+
timeout_hint_secs: 30
|
|
21
|
+
source_file: scripts/list_sequences.py
|
|
22
|
+
- name: save_project
|
|
23
|
+
description: Save the current Premiere project through the loaded UXP panel.
|
|
24
|
+
input_schema: {type: object, properties: {}}
|
|
25
|
+
read_only: false
|
|
26
|
+
destructive: true
|
|
27
|
+
idempotent: false
|
|
28
|
+
execution: sync
|
|
29
|
+
affinity: any
|
|
30
|
+
timeout_hint_secs: 60
|
|
31
|
+
source_file: scripts/save_project.py
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import threading
|
|
2
|
+
|
|
3
|
+
from dcc_mcp_premiere.bridge import BridgeBroker
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_broker_delivers_and_resolves_a_typed_request():
|
|
7
|
+
broker = BridgeBroker("TEST_PREMIERE", 0)
|
|
8
|
+
result = {}
|
|
9
|
+
thread = threading.Thread(
|
|
10
|
+
target=lambda: result.setdefault("value", broker.submit("inspect_project", {}))
|
|
11
|
+
)
|
|
12
|
+
thread.start()
|
|
13
|
+
job = broker.next()
|
|
14
|
+
broker.resolve(job["id"], {"project_name": "demo"}, None)
|
|
15
|
+
thread.join(timeout=1)
|
|
16
|
+
assert result["value"] == {"project_name": "demo"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from dcc_mcp_premiere import __version__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_version_metadata_is_synchronized():
|
|
8
|
+
root = Path(__file__).parents[1]
|
|
9
|
+
assert f'version = "{__version__}"' in (root / "pyproject.toml").read_text(encoding="utf-8")
|
|
10
|
+
manifest = json.loads((root / ".release-please-manifest.json").read_text(encoding="utf-8"))
|
|
11
|
+
assert manifest["."] == __version__
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def test_uxp_panel_is_packaged_with_source():
|
|
15
|
+
panel = Path(__file__).parents[1] / "src" / "dcc_mcp_premiere" / "premiere_uxp"
|
|
16
|
+
assert (panel / "manifest.json").is_file()
|
|
17
|
+
assert (panel / "index.js").is_file()
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from dcc_mcp_core import validate_skill
|
|
4
|
+
|
|
5
|
+
skills_root = Path(__file__).parents[1] / "src" / "dcc_mcp_premiere" / "skills"
|
|
6
|
+
reports = [validate_skill(str(path)) for path in skills_root.iterdir() if path.is_dir()]
|
|
7
|
+
assert all(report.is_clean for report in reports), [report.issues for report in reports]
|
|
8
|
+
print(f"validated {len(reports)} bundled skills")
|