🎥 Make videos programmatically with React
Finish MCP
Jonny Burger4769a0c3c3a1
diff --git a/packages/STATS.md b/packages/STATS.mdindex c6b1d1a761..c5e9495d57 100644--- a/packages/STATS.md+++ b/packages/STATS.md@@ -30,6 +30,7 @@ Monthly downloads of Remotion packages[](https://npmcharts.com/compare/@remotion/layout-utils?minimal=true)[](https://npmcharts.com/compare/@remotion/licensing?minimal=true)[](https://npmcharts.com/compare/@remotion/lottie?minimal=true)+[](https://npmcharts.com/compare/@remotion/mcp?minimal=true)[](https://npmcharts.com/compare/@remotion/media-parser?minimal=true)[](https://npmcharts.com/compare/@remotion/media-utils?minimal=true)[](https://npmcharts.com/compare/@remotion/motion-blur?minimal=true)diff --git a/packages/cli/src/list-of-remotion-packages.ts b/packages/cli/src/list-of-remotion-packages.tsindex 903bee263d..6825d15fa8 100644--- a/packages/cli/src/list-of-remotion-packages.ts+++ b/packages/cli/src/list-of-remotion-packages.ts@@ -45,6 +45,7 @@ export const listOfRemotionPackages = ['@remotion/layout-utils','@remotion/licensing','@remotion/lottie',+ '@remotion/mcp','@remotion/media-utils','@remotion/motion-blur','@remotion/noise',diff --git a/packages/create-video/src/list-of-remotion-packages.ts b/packages/create-video/src/list-of-remotion-packages.tsindex 903bee263d..6825d15fa8 100644--- a/packages/create-video/src/list-of-remotion-packages.ts+++ b/packages/create-video/src/list-of-remotion-packages.ts@@ -45,6 +45,7 @@ export const listOfRemotionPackages = ['@remotion/layout-utils','@remotion/licensing','@remotion/lottie',+ '@remotion/mcp','@remotion/media-utils','@remotion/motion-blur','@remotion/noise',diff --git a/packages/docs/docs/ai/TableOfContents.tsx b/packages/docs/docs/ai/TableOfContents.tsxindex 59cfc5ca99..9257ec6669 100644--- a/packages/docs/docs/ai/TableOfContents.tsx+++ b/packages/docs/docs/ai/TableOfContents.tsx@@ -10,7 +10,10 @@ export const TableOfContents: React.FC = () => {<strong>{'Chatbot'}</strong><div>Use the chatbot to get help with Remotion</div></TOCItem>-+ <TOCItem link="/docs/ai/mcp">+ <strong>{'MCP'}</strong>+ <div>Get Remotion-domain specific help from LLMs</div>+ </TOCItem><TOCItem link="/docs/ai/bolt"><strong>{'Bolt.new'}</strong><div>Use Bolt.new to prompt Remotion videos</div>diff --git a/packages/docs/docs/ai/chatbot.mdx b/packages/docs/docs/ai/chatbot.mdxindex eb1f2254e5..0066b5435a 100644--- a/packages/docs/docs/ai/chatbot.mdx+++ b/packages/docs/docs/ai/chatbot.mdx@@ -5,7 +5,10 @@ title: Use the Remotion Chatbotsidebar_label: Chatbot----We made a Chatbot that can answer simple questions about Remotion.+We made a Chatbot that can answer simple questions about Remotion.++The Chatbot uses [CrawlChat](https://crawlchat.app) to index Remotion's documentation and make it queryable.+You can invoke it either by:- Clicking on the "Ask AI" button anywhere on our docsdiff --git a/packages/docs/docs/ai/index.mdx b/packages/docs/docs/ai/index.mdxindex f115ee2c1e..9f043cd10c 100644--- a/packages/docs/docs/ai/index.mdx+++ b/packages/docs/docs/ai/index.mdx@@ -6,7 +6,7 @@ title: Building with Remotion and AIimport {TableOfContents} from './TableOfContents';-We are interested in how AI can help us realize Remotion projects.+We are interested in how AI can help with realizing Remotion projects.Here are a few ways you can use AI in your Remotion workflow today:diff --git a/packages/docs/docs/ai/mcp.mdx b/packages/docs/docs/ai/mcp.mdxnew file mode 100644index 0000000000..e7f5f04c2f--- /dev/null+++ b/packages/docs/docs/ai/mcp.mdx@@ -0,0 +1,32 @@+---+image: /generated/articles-docs-ai-mcp.png+crumb: 'AI'+title: Remotion's Model Context Protocol+sidebar_label: MCP+---++You can use Remotion's Model Context Protocol (MCP) Client to make your editor's AI Chat better at understanding Remotion.++Our MCP server uses [CrawlChat](https://crawlchat.app)'s technology to index Remotion's documentation into a vector database and++:::warning+**Test Phase**: Right now, this tool is open without authentication. If running this tool gets too expensive, we might restrict the usage.+:::++To set it up:++<Step>1</Step> Go to your Cursor Settings: <kbd>Cmd+Ctrl</kbd> + <kbd>P</kbd>, then type `> Cursor Settings` and confirm with Enter.++<Step>2</Step> Add an MCP with the following settings:++- **Name**: Search Remotion Documentation+- **Command**: `npx @remotion/mcp`+- **Type**: Command++If this worked, a green dot should show up and the tool `search_remotion_documentation` should show up.++If you now ask Cursor in the composer to use the Remotion Documentation, the MCP should get invoked.++<br />++<img style={{width: 600}} src="https://remotion-assets.s3.eu-central-1.amazonaws.com/mcp-cursor.png" />diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex 8039c80bfd..fb82a2d098 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -991,7 +991,7 @@ module.exports = {type: 'doc',id: 'ai/index',},- items: ['ai/chatbot', 'ai/bolt', 'ai/system-prompt'],+ items: ['ai/bolt', 'ai/chatbot', 'ai/mcp', 'ai/system-prompt'],},{type: 'category',diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex dd7179eb6a..cfe602557b 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -98,6 +98,15 @@ export const articles = [noAi: false,slug: 'ai/index',},+ {+ id: 'ai/mcp',+ title: "Remotion's Model Context Protocol",+ relativePath: 'docs/ai/mcp.mdx',+ compId: 'articles-docs-ai-mcp',+ crumb: 'AI',+ noAi: false,+ slug: 'ai/mcp',+ },{id: 'ai/system-prompt',title: 'Remotion System Prompt for LLMs',diff --git a/packages/docs/static/generated/articles-docs-ai-mcp.png b/packages/docs/static/generated/articles-docs-ai-mcp.pngnew file mode 100644index 0000000000..290ffe2414Binary files /dev/null and b/packages/docs/static/generated/articles-docs-ai-mcp.png differdiff --git a/packages/mcp/README.md b/packages/mcp/README.mdnew file mode 100644index 0000000000..487b700739--- /dev/null+++ b/packages/mcp/README.md@@ -0,0 +1,18 @@+# @remotion/mcp++Remotion's Model Context Protocol++[](https://npmcharts.com/compare/@remotion/mcp?minimal=true)++## Installation++```bash+npm install @remotion/mcp --save-exact+```++When installing a Remotion package, make sure to align the version of all `remotion` and `@remotion/*` packages to the same version.+Remove the `^` character from the version number to use the exact version.++## Usage++See the [documentation](https://www.remotion.dev/docs/ai/mcp) for more information.diff --git a/packages/mcp/bundle.ts b/packages/mcp/bundle.tsnew file mode 100644index 0000000000..06dca1b15e--- /dev/null+++ b/packages/mcp/bundle.ts@@ -0,0 +1,15 @@+import {buildPackage} from '../.monorepo/builder';++await buildPackage({+ formats: {+ cjs: 'use-tsc',+ esm: 'build',+ },+ external: 'dependencies',+ entrypoints: [+ {+ path: 'src/index.ts',+ target: 'node',+ },+ ],+});diff --git a/packages/mcp/package.json b/packages/mcp/package.jsonindex 84f2afdb6e..0391fb89f1 100644--- a/packages/mcp/package.json+++ b/packages/mcp/package.json@@ -1,20 +1,22 @@{"repository": {- "url": "https://github.com/remotion-dev/remotion/tree/main/packages/openai-whisper"+ "url": "https://github.com/remotion-dev/remotion/tree/main/packages/mcp"},"name": "@remotion/mcp","version": "4.0.273",- "description": "Work with the output of the OpenAI Whisper API",- "main": "dist/index.js",+ "description": "Remotion's Model Context Protocol",+ "main": "dist/esm/index.mjs","sideEffects": false,+ "type": "module","bugs": {"url": "https://github.com/remotion-dev/remotion/issues"},+ "bin": {+ "remotion-mcp": "./dist/esm/index.mjs"+ },"scripts": {- "formatting": "prettier src --check","lint": "eslint src",- "test": "bun test src",- "make": "tsc -d"+ "make": "tsc -d && bun --env-file=../.env.bundle bundle.ts"},"files": ["dist"@@ -23,7 +25,6 @@"license": "MIT","dependencies": {"@modelcontextprotocol/sdk": "1.5.0",- "command-line-args": "6.0.1","zod": "3.24.2"},"peerDependencies": {},@@ -39,5 +40,14 @@"publishConfig": {"access": "public"},- "homepage": "https://www.remotion.dev/docs/ai"+ "homepage": "https://www.remotion.dev/docs/ai/mcp",+ "exports": {+ "./package.json": "./package.json",+ ".": {+ "types": "./dist/index.d.ts",+ "require": "./dist/index.js",+ "module": "./dist/esm/index.mjs",+ "import": "./dist/esm/index.mjs"+ }+ }}diff --git a/packages/mcp/src/index.ts b/packages/mcp/src/index.tsindex 82e6f9c957..106aebf40b 100644--- a/packages/mcp/src/index.ts+++ b/packages/mcp/src/index.ts@@ -2,30 +2,26 @@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,+ 'search-remotion-documentation',{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}`);+ async ({query}: {query: string}) => {+ const res = await fetch(+ `${HOST}/mcp/67cad4626afeae106c6ffb50?query=${query}`,+ );return {content: [{type: 'text', text: await res.text()}],diff --git a/packages/mcp/tsconfig.json b/packages/mcp/tsconfig.jsonindex 26af2540bb..56e3a70fc5 100644--- a/packages/mcp/tsconfig.json+++ b/packages/mcp/tsconfig.json@@ -1,9 +1,9 @@{"compilerOptions": {"target": "ES2022",- "module": "Node16",- "moduleResolution": "Node16",- "outDir": "./build",+ "module": "NodeNext",+ "moduleResolution": "nodenext",+ "outDir": "./dist","rootDir": "./src","strict": true,"esModuleInterop": true,diff --git a/packages/studio-shared/src/package-info.ts b/packages/studio-shared/src/package-info.tsindex a95c7c266e..6af098026a 100644--- a/packages/studio-shared/src/package-info.ts+++ b/packages/studio-shared/src/package-info.ts@@ -44,6 +44,7 @@ export const packages = ['layout-utils','licensing','lottie',+ 'mcp','media-utils','motion-blur','noise',@@ -91,6 +92,7 @@ export const descriptions: {[key in Pkgs]: string | null} = {'studio-server': 'Run a Remotion Studio with a server backend','install-whisper-cpp': 'Helpers for installing and using Whisper.cpp','google-fonts': 'Use Google Fonts in Remotion',+ mcp: "Remotion's Model Context Protocol",'media-utils': 'Utilities for working with media files',lottie: 'Include Lottie animations in Remotion',licensing: 'Manage your Remotion.pro license',@@ -205,6 +207,7 @@ export const installableMap: {[key in Pkgs]: boolean} = {'lambda-ruby': false,'lambda-python': false,lambda: true,+ mcp: true,'layout-utils': true,licensing: true,lottie: true,@@ -258,6 +261,7 @@ export const apiDocs: {[key in Pkgs]: string | null} = {licensing: 'https://www.remotion.dev/docs/licensing','layout-utils': 'https://www.remotion.dev/docs/layout-utils',noise: 'https://www.remotion.dev/docs/noise',+ mcp: 'https://www.remotion.dev/docs/ai/mcp','motion-blur': 'https://www.remotion.dev/docs/motion-blur',preload: 'https://www.remotion.dev/docs/preload',shapes: 'https://www.remotion.dev/docs/shapes',diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex c9b20ab0e3..949570b446 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1584,9 +1584,6 @@ importers:'@modelcontextprotocol/sdk':specifier: 1.5.0version: 1.5.0- command-line-args:- specifier: 6.0.1- version: 6.0.1zod:specifier: 3.24.2version: 3.24.2@@ -16772,11 +16769,6 @@ 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'}@@ -17961,21 +17953,6 @@ 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'}@@ -20430,16 +20407,6 @@ packages:pkg-dir: 7.0.0dev: 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'}@@ -29676,11 +29643,6 @@ 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