Automatically post clips about what's trending, with OpusClip and Perplexity's API
Trending topics move fast, and by the time you've manually checked what's hot, matched it to your old footage, and scheduled the post - the moment's gone.
So I built this agent that searches Perplexity for what's actually trending in your niche, finds a relevant clip in your OpusClip library, and schedules it across your platforms. Running every week, fully on autopilot. Try it out!

Run it with your agent
- Open Settings → Connectors in your client
- Click Add Connector → Add Custom Connector
- Name it "OpusClip" and paste the URL below for the Remote MCP Server URL
- Sign in with your OpusClip account in the OAuth window
https://mcp.opus.pro/mcp- Run the command below in your terminal
claude mcp add --transport http opusclip https://mcp.opus.pro/mcp - Start Claude Code and run
/mcp - Approve the OAuth sign-in with your OpusClip account
claude mcp add --transport http opusclip https://mcp.opus.pro/mcp- Open Settings → MCP → Add new server in Cursor
- Paste the OpusClip MCP URL (Streamable HTTP)
- Sign in with OAuth on first use
- Save the file
{"mcpServers": {"opusclip": {"url": "https://mcp.opus.pro/mcp"}}}- Open Settings → Plugins → MCPs, then click "+ Add server"
- Name it "OpusClip", switch Type to Streamable HTTP, and paste the URL below
- Save — the server appears in the list with an "Authenticate" button
- Click "Authenticate" and allow access with your OpusClip account
https://mcp.opus.pro/mcp- Add OpusClip to
.vscode/mcp.json(type: http) - Open the MCP view in VS Code
- Sign in with OAuth when prompted
https://mcp.opus.pro/mcpI. Setting up the Perplexity API
You'll need to create an API key on Perplexity's API platform. You don't need a paid subscription for it, but you'll probably need to purchase like $5 worth of API credits. ($5 should theoretically last you about 5 months to a year for this workflow).
Make sure to check that "Auto Reload" is disabled.
II. Storing Your Perplexity API Key as an ENV variable
You can store your API key as an "environment variable" on your computer by running the terminal commands below. Then, you can tell your AI assistant to read from that when it needs your API key.
echo 'export PERPLEXITY_API_KEY=“PASTE-YOUR-API-KEY-HERE"' >> ~/.zshrc
source ~/.zshrc👆 This is the clean and safe way to do it. But if you don't care as much, and you tend to just give API keys directly to your AI, then you can do that and skip the above. (Just know that if your Claude chat is ever leaked, your API key will be visible to outsiders. ⚠️)
III. Finding daily trends with Perplexity
Here's the prompt you can give your AI, for it to find relevant trends through Perplexity:
Can you use the Perplexity Search API (https://docs.perplexity.ai/api-reference/search-post) and my API key (stored as an ENV variable PERPLEXITY_API_KEY) to search for new trending topics from the past week, about the following 5 topics:
1.Content creation
2. AI for content creation
3. Creator economy
4. Social media marketing
5. Video editing
When looking for "trends", bias towards specifics - breaking news, entirely new developments, or a specific new trending subject from social media.
Then, once you have arrived at a list, narrow it down to only the top 5 most compelling trends across these 5 topics. The 5 trends you narrow down to should be the most unique and most time sensitive.
Return the 5 in an ordered list, with all of the data provided by Perplexity.
IV. Searching your OpusClip account for relevant clips
Then give your AI the following prompt to find your #1 most "on-trend" clip:
Now, pull up my OpusClip account, and look through all of the clips (titles and transcripts are fine) from all of my past projects, ignoring any projects that are deleted or expired. And try to find the the single clip that is most relevant to one of the top 5 trends that you flagged above. Then, return that clip here.
V. Scheduling the clips with OpusClip
Give your AI the following prompt to schedule that clip to your social accounts, and tell it to message you with confirmation on Slack:
Now, can you use OpusClip to schedule that clip to be posted tomorrow, onto my connected YouTube Shorts, Instagram, TikTok, and X accounts, at times that are most optimal for each platform. Please tweak the post caption for each post written by OpusClip's AI copywriter, to specifically call attention to the overarching trend itself — and make sure the caption actually renders in each platform's caption field (don't assume title and description behave the same way across platforms; populate both where applicable, and verify nothing posts blank).
After all of the posts are scheduled, please send a DM to me on Slack with a recap of what was scheduled.
VI. Automate it so that it runs every week on its own
Lastly, you can ask your AI something like the following, so that it will turn this entire workflow into a repeat process that runs on its own going forward:
Can you turn this entire process we just went through into a Claude Routine, that will run every Monday morning at 9 AM Pacific time?
It should be executed autonomously. Have each step occur in sequence, with each output chained together - Not requiring user input or response from me




