Skip to content

Commit 8525ae5

Browse files
committed
Add MCP example
1 parent 731023f commit 8525ae5

File tree

15 files changed

+1365
-8
lines changed

15 files changed

+1365
-8
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Continuous integration
22

33
on:
44
push:
5-
branches: [ main, master ]
5+
branches: [main, master]
66
pull_request:
77

88
jobs:
@@ -15,28 +15,53 @@ jobs:
1515

1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919

2020
- name: Setup pnpm
2121
uses: pnpm/action-setup@v4
2222
with:
2323
version: 10
2424

2525
- name: Setup Node.js
26-
uses: actions/setup-node@v4
26+
uses: actions/setup-node@v6
2727
with:
2828
node-version: 20
29-
cache: pnpm
30-
cache-dependency-path: plainly-render-and-webhook/pnpm-lock.yaml
3129

3230
- name: Install dependencies
3331
run: pnpm install --frozen-lockfile
3432

3533
- name: Biome check (lint + format)
36-
run: pnpm exec biome check --reporter=github .
34+
run: pnpm exec biome ci --reporter=github .
3735

38-
- name: Biome format verification
39-
run: pnpm exec biome format .
36+
- name: Build
37+
run: pnpm build
38+
39+
build-ai-crypto-video-agent:
40+
name: Build ai-crypto-video-agent
41+
runs-on: ubuntu-latest
42+
defaults:
43+
run:
44+
working-directory: ai-crypto-video-agent
45+
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v5
49+
50+
- name: Setup pnpm
51+
uses: pnpm/action-setup@v4
52+
with:
53+
version: 10
54+
55+
- name: Setup Node.js
56+
uses: actions/setup-node@v6
57+
with:
58+
node-version: 22
59+
60+
- name: Install dependencies
61+
run: pnpm install --frozen-lockfile
62+
63+
- name: Biome check
64+
run: pnpm exec biome ci --reporter=github .
4065

4166
- name: Build
4267
run: pnpm build

ai-crypto-video-agent/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SMITHERY_API_KEY=12345678-****-****-****-************
2+
SMITHERY_PROFILE=open-******-******

ai-crypto-video-agent/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
.env

ai-crypto-video-agent/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# AI Crypto Video Agent
2+
3+
Fetches 7-day historical crypto data (price, volume) via Free Crypto Coin Data MCP server and then renders a Plainly "Media / Abstract" square video summarizing stats.
4+
5+
## Features
6+
- Retrieves 7-day historical chart (`getCoinHistoricalChart`).
7+
- Computes start, end, high, low, % change, average volume.
8+
- Selects the Plainly `Media / Abstract` design (square variant).
9+
- Auto-populates textual parameters and supplies PNG logo/image URL (CoinGecko) for required media layers.
10+
- Initiates a render.
11+
12+
## Requirements
13+
- [Smithery AI account](https://smithery.ai/signup).
14+
- Node.js 22+ (TypeScript target ES2022 / module nodenext).
15+
- PNPM package manager.
16+
- Valid API keys from [Free Crypto Coin Data](https://smithery.ai/server/@Liam8/free-coin-price-mcp) and [Plainly Videos](https://smithery.ai/server/@plainly-videos/mcp-server).
17+
18+
## Getting started
19+
20+
Create a `.env` file from `.env.example` and fill in your API keys.
21+
```bash
22+
cp .env.example .env
23+
```
24+
25+
Go to [Plainly Videos](https://smithery.ai/server/@plainly-videos/mcp-server) and [Free Crypto Coin Data](https://smithery.ai/server/@Liam8/free-coin-price-mcp) to get your API keys and `profile`, by clicking on the TypeScript under the Connect tab and copying the values from there into your `.env` file.
26+
27+
## Usage
28+
29+
Values for coin are hard-coded in the `src/constants.ts` as `bitcoin`; modify as needed (e.g. change `id` to another coin). You can also extend the code to accept command-line arguments for dynamic coin selection.
30+
31+
Run the example:
32+
33+
```bash
34+
pnpm install
35+
pnpm build
36+
pnpm start
37+
```
38+
39+
On success, you will get a response message, and you can visit the [Render list page](https://app.plainlyvideos.com/dashboard/renders) to track status of your video render.

ai-crypto-video-agent/biome.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.5/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"includes": ["**", "!!**/dist"]
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"indentStyle": "tab",
14+
"lineWidth": 120
15+
},
16+
"linter": {
17+
"enabled": true,
18+
"rules": {
19+
"recommended": true
20+
}
21+
},
22+
"javascript": {
23+
"formatter": {
24+
"quoteStyle": "double"
25+
}
26+
},
27+
"assist": {
28+
"enabled": true,
29+
"actions": {
30+
"source": {
31+
"organizeImports": "on"
32+
}
33+
}
34+
}
35+
}

ai-crypto-video-agent/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "ai-crypto-video-agent",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "module",
7+
"scripts": {
8+
"build": "pnpm tsc",
9+
"start": "node --env-file=.env ./dist/index.js",
10+
"biome": "biome check",
11+
"biome:ci": "biome ci"
12+
},
13+
"keywords": [],
14+
"author": "",
15+
"license": "ISC",
16+
"packageManager": "pnpm@10.22.0",
17+
"devDependencies": {
18+
"@biomejs/biome": "2.3.5",
19+
"@tsconfig/node22": "^22.0.3",
20+
"@types/node": "^22",
21+
"typescript": "^5.9.3"
22+
},
23+
"dependencies": {
24+
"@modelcontextprotocol/sdk": "^1.22.0"
25+
}
26+
}

0 commit comments

Comments
 (0)