Skip to content

🎥 Make videos programmatically with React

mcp

Jonny Burger0445dd28cc6d
diff --git a/packages/mcp/eslint.config.mjs b/packages/mcp/eslint.config.mjs
new file mode 100644
index 0000000000..04fd4fac11
--- /dev/null
+++ b/packages/mcp/eslint.config.mjs
@@ -0,0 +1,7 @@
+import {remotionFlatConfig} from '@remotion/eslint-config-internal';
+
+const config = remotionFlatConfig({react: false});
+
+export default {
+ ...config,
+};
diff --git a/packages/mcp/package.json b/packages/mcp/package.json
new file mode 100644
index 0000000000..84f2afdb6e
--- /dev/null
+++ b/packages/mcp/package.json
@@ -0,0 +1,43 @@
+{
+ "repository": {
+ "url": "https://github.com/remotion-dev/remotion/tree/main/packages/openai-whisper"
+ },
+ "name": "@remotion/mcp",
+ "version": "4.0.273",
+ "description": "Work with the output of the OpenAI Whisper API",
+ "main": "dist/index.js",
+ "sideEffects": false,
+ "bugs": {
+ "url": "https://github.com/remotion-dev/remotion/issues"
+ },
+ "scripts": {
+ "formatting": "prettier src --check",
+ "lint": "eslint src",
+ "test": "bun test src",
+ "make": "tsc -d"
+ },
+ "files": [
+ "dist"
+ ],
+ "author": "Jonny Burger <[email protected]>, Pramod Kumar <[email protected]>",
+ "license": "MIT",
+ "dependencies": {
+ "@modelcontextprotocol/sdk": "1.5.0",
+ "command-line-args": "6.0.1",
+ "zod": "3.24.2"
+ },
+ "peerDependencies": {},
+ "devDependencies": {
+ "@remotion/eslint-config-internal": "workspace:*",
+ "eslint": "9.19.0",
+ "@types/command-line-args": "^5.2.3"
+ },
+ "keywords": [
+ "remotion",
+ "mcp"
+ ],
+ "publishConfig": {
+ "access": "public"
+ },
+ "homepage": "https://www.remotion.dev/docs/ai"
+}
diff --git a/packages/mcp/src/index.ts b/packages/mcp/src/index.ts
new file mode 100644
index 0000000000..82e6f9c957
--- /dev/null
+++ b/packages/mcp/src/index.ts
@@ -0,0 +1,37 @@
+#! /usr/bin/env node
+
+import {McpServer} from '@modelcontextprotocol/sdk/server/mcp.js';
+import {StdioServerTransport} from '@modelcontextprotocol/sdk/server/stdio.js';
+import commandLineArgs from 'command-line-args';
+import {z} from 'zod';
+
+const HOST = 'https://mcp.remotion.dev';
+
+const options = commandLineArgs([
+ {name: 'id', alias: 'i', type: String},
+ {name: 'name', alias: 'n', type: String},
+]);
+
+const server = new McpServer({
+ name: 'remotion-mcp',
+ version: '1.0.0',
+});
+
+server.tool(
+ options.name,
+ {
+ query: z.string({
+ description: 'The query to search for. Keep it short and concise.',
+ }),
+ },
+ async function ({query}: {query: string}) {
+ const res = await fetch(`${HOST}/mcp/${options.id}?query=${query}`);
+
+ return {
+ content: [{type: 'text', text: await res.text()}],
+ };
+ },
+);
+
+const transport = new StdioServerTransport();
+await server.connect(transport);
diff --git a/packages/mcp/tsconfig.json b/packages/mcp/tsconfig.json
new file mode 100644
index 0000000000..26af2540bb
--- /dev/null
+++ b/packages/mcp/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "Node16",
+ "moduleResolution": "Node16",
+ "outDir": "./build",
+ "rootDir": "./src",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "include": ["src/**/*"],
+ "exclude": ["node_modules"]
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6053d4103a..c9b20ab0e3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1579,6 +1579,28 @@ importers:
specifier: 19.0.0
version: 19.0.0([email protected])
+ packages/mcp:
+ dependencies:
+ '@modelcontextprotocol/sdk':
+ specifier: 1.5.0
+ version: 1.5.0
+ command-line-args:
+ specifier: 6.0.1
+ version: 6.0.1
+ zod:
+ specifier: 3.24.2
+ version: 3.24.2
+ devDependencies:
+ '@remotion/eslint-config-internal':
+ specifier: workspace:*
+ version: link:../eslint-config-internal
+ '@types/command-line-args':
+ specifier: ^5.2.3
+ version: 5.2.3
+ eslint:
+ specifier: 9.19.0
+ version: 9.19.0
+
packages/media-parser:
devDependencies:
'@remotion/eslint-config-internal':
@@ -11394,6 +11416,17 @@ packages:
/@mjackson/[email protected]:
resolution: {integrity: sha512-EMlH1e30yzmTpGLQjlFmaDAjyOeZhng1/XCd7DExR8PNAnG/G1tyruZxEoUe11ClnwGhGrtsdnyyUx1frSzjng==}
+ /@modelcontextprotocol/[email protected]:
+ resolution: {integrity: sha512-IJ+5iVVs8FCumIHxWqpwgkwOzyhtHVKy45s6Ug7Dv0MfRpaYisH8QQ87rIWeWdOzlk8sfhitZ7HCyQZk7d6b8w==}
+ engines: {node: '>=18'}
+ dependencies:
+ content-type: 1.0.5
+ eventsource: 3.0.5
+ raw-body: 3.0.0
+ zod: 3.24.2
+ zod-to-json-schema: 3.24.3([email protected])
+ dev: false
+
/@module-federation/[email protected]:
resolution: {integrity: sha512-55LYmrDdKb4jt+qr8qE8U3al62ZANp3FhfVaNPOaAmdTh0jHdD8M3yf5HKFlr5xVkVO4eV/F/J2NCfpbh+pEXQ==}
dev: false
@@ -15050,6 +15083,10 @@ packages:
resolution: {integrity: sha512-iyuC9rR+3QYd+VuC8E9MvKM2fTForr9RcUa4YurqRJyXcDALYIt+GPsy1skrri2QcYxWVNYYyoznxe8Y42K4/g==}
dev: true
+ resolution: {integrity: sha512-uv0aG6R0Y8WHZLTamZwtfsDLVRnOa+n+n5rEvFWL5Na5gZ8V2Teab/duDPFzIIIhs9qizDpcavCusCLJZu62Kw==}
+ dev: true
+
resolution: {integrity: sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==}
dependencies:
@@ -15601,7 +15638,7 @@ packages:
'@typescript-eslint/scope-manager': 5.62.0
'@typescript-eslint/type-utils': 5.62.0([email protected])([email protected])
'@typescript-eslint/utils': 5.62.0([email protected])([email protected])
- debug: 4.3.7
+ debug: 4.4.0
eslint: 9.19.0
graphemer: 1.4.0
ignore: 5.3.2
@@ -15705,7 +15742,7 @@ packages:
'@typescript-eslint/scope-manager': 5.62.0
'@typescript-eslint/types': 5.62.0
'@typescript-eslint/typescript-estree': 5.62.0([email protected])
- debug: 4.3.7
+ debug: 4.4.0
eslint: 9.19.0
typescript: 5.5.4
transitivePeerDependencies:
@@ -16735,6 +16772,11 @@ packages:
engines: {node: '>= 0.4'}
dev: false
+ resolution: {integrity: sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==}
+ engines: {node: '>=12.17'}
+ dev: false
+
resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==}
engines: {node: '>= 0.4'}
@@ -17919,6 +17961,21 @@ packages:
resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}
+ resolution: {integrity: sha512-Jr3eByUjqyK0qd8W0SGFW1nZwqCaNCtbXjRo2cRJC1OYxWl3MZ5t1US3jq+cO4sPavqgw4l9BMGX0CBe+trepg==}
+ engines: {node: '>=12.20'}
+ peerDependencies:
+ '@75lb/nature': latest
+ peerDependenciesMeta:
+ '@75lb/nature':
+ optional: true
+ dependencies:
+ array-back: 6.2.2
+ find-replace: 5.0.2
+ lodash.camelcase: 4.3.0
+ typical: 7.3.0
+ dev: false
+
resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==}
engines: {node: '>=14'}
@@ -20057,6 +20114,18 @@ packages:
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
engines: {node: '>=0.8.x'}
+ resolution: {integrity: sha512-T1C0XCUimhxVQzW4zFipdx0SficT651NnkR0ZSH3yQwh+mFMdLfgjABVi4YtMTtaL4s168593DaoaRLMqryavA==}
+ engines: {node: '>=18.0.0'}
+ dev: false
+
+ resolution: {integrity: sha512-LT/5J605bx5SNyE+ITBDiM3FxffBiq9un7Vx0EwMDM3vg8sWKx/tO2zC+LMqZ+smAM0F2hblaDZUVZF0te2pSw==}
+ engines: {node: '>=18.0.0'}
+ dependencies:
+ eventsource-parser: 3.0.0
+ dev: false
+
resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
engines: {node: '>=10'}
@@ -20361,6 +20430,16 @@ packages:
pkg-dir: 7.0.0
dev: false
+ resolution: {integrity: sha512-Y45BAiE3mz2QsrN2fb5QEtO4qb44NcS7en/0y9PEVsg351HsLeVclP8QPMH79Le9sH3rs5RSwJu99W0WPZO43Q==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@75lb/nature': latest
+ peerDependenciesMeta:
+ '@75lb/nature':
+ optional: true
+ dev: false
+
resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==}
engines: {node: '>=18'}
@@ -21609,6 +21688,13 @@ packages:
dependencies:
safer-buffer: 2.1.2
+ resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ safer-buffer: 2.1.2
+ dev: false
+
resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==}
engines: {node: ^10 || ^12 || >= 14}
@@ -26661,6 +26747,16 @@ packages:
iconv-lite: 0.4.24
unpipe: 1.0.0
+ resolution: {integrity: sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ bytes: 3.1.2
+ http-errors: 2.0.0
+ iconv-lite: 0.6.3
+ unpipe: 1.0.0
+ dev: false
+
resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==}
hasBin: true
@@ -29580,6 +29676,11 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
+ resolution: {integrity: sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==}
+ engines: {node: '>=12.17'}
+ dev: false
+
resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==}
dev: false
@@ -30120,7 +30221,7 @@ packages:
hasBin: true
dependencies:
cac: 6.7.14
- debug: 4.3.7
+ debug: 4.4.0
pathe: 1.1.2
picocolors: 1.1.1
vite: 5.4.14(@types/[email protected])
@@ -31085,6 +31186,14 @@ packages:
zod: 3.23.8
dev: false
+ resolution: {integrity: sha512-HIAfWdYIt1sssHfYZFCXp4rU1w2r8hVVXYIlmoa0r0gABLs5di3RCqPU5DDROogVz1pAdYBaz7HK5n9pSUNs3A==}
+ peerDependencies:
+ zod: ^3.24.1
+ dependencies:
+ zod: 3.24.2
+ dev: false
+
resolution: {integrity: sha512-x30XE43V+InwGpvTySRNz9kB7qFU8DlyEy7BsSTCHPH1R0QasMmHWZDCzYm6bVXtj/9NNJAZF3jW8rzFvH5OFA==}
peerDependencies:
@@ -31102,6 +31211,10 @@ packages:
resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==}
dev: false
+ resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==}
+ dev: false
+
resolution: {integrity: sha512-9oxn0IIjbCZkJ67L+LkhYWRyAy7axphb3VgE2MBDlOqnmHMPWGYMxJxBYFueFq/JGY2GMwS0rU+UCLunEmy5UA==}
dev: false
diff --git a/tsconfig.json b/tsconfig.json
index 3220168b16..06616c4117 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -66,6 +66,9 @@
{
"path": "./packages/openai-whisper"
},
+ {
+ "path": "./packages/mcp"
+ },
{
"path": "./packages/it-tests"
},