-
Notifications
You must be signed in to change notification settings - Fork 0
Add MCP crypto data plainly video example #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vladavoX
wants to merge
9
commits into
master
Choose a base branch
from
add-mcp-example
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,847
−7
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
31a87c6
Add example MCP crypto data and Plainly video
vladavoX 78b050d
run formatter
vladavoX 009f69d
Add missing install in CI
vladavoX cfe8b9f
Copilot review fixes; add missing project in folder
vladavoX c281175
Create openAI agent that does all of the things
vladavoX f98e2e2
Add clean script
vladavoX d5fb57f
Final cleanup
vladavoX c186397
Make a talking agent
vladavoX 9b3459e
ask user to try again if failure
vladavoX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .DS_Store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Environment Variables | ||
| # Copy this file to .env.local and fill in your API keys | ||
|
|
||
| # Smithery API Key - Get it from https://smithery.ai/account/api-keys | ||
| SMITHERY_API_KEY= | ||
|
|
||
| # Plainly API Key - Get it from https://app.plainlyvideos.com/dashboard/user/settings/general | ||
| PLAINLY_API_KEY= | ||
|
|
||
| # OpenAI API Key - Get it from https://platform.openai.com | ||
| OPENAI_API_KEY= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| node_modules | ||
| .env | ||
| .env.local | ||
| dist | ||
| .DS_Store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| # MCP AI Crypto Video Agent | ||
|
|
||
| Generate a short crypto performance video using a real OpenAI agent that | ||
| discovers and orchestrates MCP tools for data fetching and rendering. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - [Node.js](https://nodejs.org/) 18+ (or newer) | ||
| - [pnpm](https://pnpm.io/) package manager | ||
| - OpenAI API key | ||
| - Smithery API key (Free Crypto Coin Data) | ||
| - Plainly API key | ||
|
|
||
| ## Getting started | ||
|
|
||
| 1. Clone the repository: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/plainly-videos/examples.git | ||
| cd examples/mcp-ai-crypto-video-agent | ||
| ``` | ||
|
|
||
| 2. Install dependencies: | ||
| - `pnpm install --frozen-lockfile` | ||
| 3. Upload the After Effects project used in this example to Plainly: | ||
| - Download the example project from [here](./after-effects/Crypto%202025.zip). | ||
| - Go to [Upload form](https://app.plainlyvideos.com/dashboard/projects/create) and upload the project. | ||
| - Once the upload is done, auto-generate a template with prefix option: | ||
| - Set the prefixes to `edit`, which will include all compositions starting with `edit` and their parameters. | ||
| - Click on "Generate". | ||
| - This will generate a template with few parameters from layers. | ||
|
|
||
| <p align="center"> | ||
| <img src=".assets/auto-generate-template.png" alt="Plainly auto-generate template" width="500" /> | ||
| </p> | ||
|
|
||
| 4. Set up environment variables: | ||
|
|
||
| ```bash | ||
| cp .env.example .env.local | ||
| ``` | ||
|
|
||
| Update `.env.local` with your OpenAI API key, Smithery API key from [Smithery account settings](https://smithery.ai/account/api-keys), and Plainly API key from [Plainly settings](https://app.plainlyvideos.com/dashboard/user/settings/general). | ||
|
|
||
| ```properties | ||
| # Smithery API Key | ||
| SMITHERY_API_KEY=your_smithery_api_key | ||
|
|
||
| # Plainly API Key | ||
| PLAINLY_API_KEY=your_plainly_api_key | ||
|
|
||
| # OpenAI API Key | ||
| OPENAI_API_KEY=your_openai_api_key | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| - Default coin (bitcoin): | ||
| - `pnpm start` | ||
| - Specify a coin: | ||
| - `pnpm start -- --coin ethereum` | ||
|
|
||
| For this example, only `bitcoin` and `ethereum` are supported because the | ||
| template uses a static logo mapping for `editImage`. | ||
|
|
||
| ## How it works | ||
|
|
||
| - The OpenAI agent connects to the MCP servers (crypto data + Plainly). | ||
| - Fetches current price plus 24h/7d change for the coin. | ||
| - Finds the Plainly project named "Crypto 2025". | ||
| - Uses the first template variant and maps data into parameters. | ||
| - Submits a render and polls until completion. | ||
|
|
||
| ## Template parameters | ||
|
|
||
| The example maps these fields for the "Crypto 2025" template: | ||
|
|
||
| - `editName` | ||
| - `editSymbol` | ||
| - `editPrice` | ||
| - `editChange24h` | ||
| - `editChange7d` | ||
| - `editImage` | ||
| - `editDate` | ||
|
|
||
| If your template uses different parameter names, update the mapping in | ||
| `src/index.ts`. | ||
|
|
||
| ## Scripts | ||
|
|
||
| - `pnpm start` - run the agent | ||
| - `pnpm build` - typecheck with TypeScript | ||
| - `pnpm biome` - lint and format check | ||
| - `pnpm biome:fix` - auto-fix lint issues |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", | ||
| "vcs": { | ||
| "enabled": false, | ||
| "clientKind": "git", | ||
| "useIgnoreFile": false | ||
| }, | ||
| "files": { | ||
| "ignoreUnknown": false, | ||
| "includes": ["**", "!node_modules", "!dist"] | ||
| }, | ||
| "formatter": { | ||
| "enabled": true, | ||
| "indentStyle": "tab" | ||
| }, | ||
| "linter": { | ||
| "enabled": true, | ||
| "rules": { | ||
| "recommended": true, | ||
| "suspicious": { | ||
| "noExplicitAny": "off" | ||
| } | ||
| } | ||
| }, | ||
| "javascript": { | ||
| "formatter": { | ||
| "quoteStyle": "double" | ||
| } | ||
| }, | ||
| "assist": { | ||
| "enabled": true, | ||
| "actions": { | ||
| "source": { | ||
| "organizeImports": "on" | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "name": "mcp-ai-crypto-video-agent", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "scripts": { | ||
| "clean": "rm -rf dist", | ||
| "start": "tsx src/index.ts", | ||
| "build": "pnpm clean && pnpm tsc", | ||
| "biome": "biome check .", | ||
| "biome:fix": "biome check . --write" | ||
| }, | ||
| "license": "ISC", | ||
| "packageManager": "pnpm@10.26.2", | ||
| "devDependencies": { | ||
| "@biomejs/biome": "2.3.11", | ||
| "@types/node": "^25.0.3", | ||
| "tsx": "^4.21.0", | ||
| "typescript": "^5.9.3" | ||
| }, | ||
| "dependencies": { | ||
| "@openai/agents": "^0.3.7", | ||
| "chalk": "^5.6.2", | ||
| "commander": "^14.0.2", | ||
| "dotenv": "^17.2.3", | ||
| "zod": "^3.25.76" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.