4,500+ servers built on MCP Fusion
Vinkius
YouTube logo
Vinkius
Mastra AI logo

How to Use the YouTube MCP in Mastra AI

Build complex YouTube workflows that self-correct with Mastra AI.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

YouTube MCP on Cursor AI Code Editor MCP Client YouTube MCP on Claude Desktop App MCP Integration YouTube MCP on OpenAI Agents SDK MCP Compatible YouTube MCP on Visual Studio Code MCP Extension Client YouTube MCP on GitHub Copilot AI Agent MCP Integration YouTube MCP on Google Gemini AI MCP Integration YouTube MCP on Lovable AI Development MCP Client YouTube MCP on Mistral AI Agents MCP Compatible YouTube MCP on Amazon AWS Bedrock MCP Support
MCP Servers - Free for Subscribers
Mastra AI

Connect YouTube MCP to Mastra AI

Create your Vinkius account to connect YouTube to Mastra AI and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.

GDPR Free for Subscribers

Automated Channel Auditing

The `get_channel` tool retrieves full statistics and branding information for a given YouTube channel. You can build a workflow where the agent first checks this data, then conditionally routes based on performance thresholds. If the stats fall below an acceptable level, your Mastra AI workflow automatically triggers a notification step or initiates a retrial with different parameters.

Content Gap Analysis

Use `search_videos` to list videos by keyword. This tool finds potential content ideas across YouTube. You can wrap this in a multi-step workflow that collects dozens of titles and descriptions for later human review. This setup is ideal because if the initial search fails or times out, Mastra AI handles the backoff retry automatically, ensuring your pipeline doesn't break.

Comprehensive Video Performance Check

To audit a specific YouTube video, you combine `get_video` (for metadata and stats) with `list_comments`. The agent runs both tools sequentially. This allows for complex analysis: fetching the raw data from the first tool, passing it into the second, and then using conditional logic to generate a final report.

Setup guide

Set up YouTube MCP in Mastra AI

Prerequisites

  • Node.js 18+ and a TypeScript project
  • @mastra/mcp + @mastra/core packages
  • Active Vinkius subscription with a valid endpoint token
  1. 1

    Install dependencies

    Run npm install @mastra/mcp @mastra/core plus your preferred model provider (e.g. @ai-sdk/openai).

  2. 2

    Configure the MCPClient

    Create an MCPClient with your Vinkius endpoint as a URL object. Replace [YOUR_TOKEN_HERE] with your token from cloud.vinkius.com.

  3. 3

    Discover and inject tools

    Call mcpClient.listTools() and spread the result into your agent's tools object. All YouTube tools become native Mastra tools.

  4. 4

    Run with any model

    Swap openai("gpt-4o") for any AI SDK-compatible provider. Call agent.generate() and the agent routes tool calls through MCP automatically.

agent.ts
import { MCPClient } from "@mastra/mcp";
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";

const mcpClient = new MCPClient({
  id: "youtube-mcp-client",
  servers: {
    "youtube-mcp": {
      url: new URL(
        "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
      ),
    },
  },
});

const agent = new Agent({
  name: "YouTube Agent",
  model: openai("gpt-4o"),
  instructions: "You have access to YouTube tools.",
  tools: {
    ...(await mcpClient.listTools()),
  },
});

const result = await agent.generate(
  "List recent YouTube transactions"
);
console.log(result.text);

Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by YouTube. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.

Why Choose Vinkius

Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.

Real-time monitoring

Live

visibility into every interaction

Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.

Built-in savings

60%

lower AI costs

Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.

Single dashboard

One

place for every integration

Every tool your AI connects to, managed from a single screen. One account, complete control.

Common questions about YouTube MCP in Mastra AI

Absolutely. Use the `get_video` tool within your workflow engine. It pulls all necessary stats and descriptions for a specific video, which is essential data for content analysis.
You chain together calls to `get_channel` for every channel you want to audit. Since the framework supports automatic retries and failure handling, it makes running large batches of audits reliable.
Yes. You use `list_comments` as a tool within your workflow. The agent can gather the comments and then pass that thread data to another module for sentiment scoring or categorization.
The server handles public-facing statistics, metadata, and comment threads. This data is structured for use in complex workflows within Mastra AI.
Mastra AI automatically retries the `search_videos` tool using exponential backoff. This means your workflow is resilient and doesn't fail just because of a temporary API hiccup.

Start using the YouTube MCP today

We host it, we monitor it, we maintain it. You just paste one token.

Built & Managed by Vinkius 30s setup 4 tools

We've already built the connector for YouTube. Just plug in your AI agents and start using Vinkius.

No hosting. No infrastructure. No complex setup.
All 4 tools are live and waiting. You're up and running in seconds.

Claude Claude
ChatGPT ChatGPT
Cursor Cursor
Gemini Gemini
Windsurf Windsurf
VS Code VS Code
JetBrains JetBrains
Vercel Vercel
+ other MCP clients

Vinkius gives your AI agents access to the full catalog of app connectors, all fully managed, secure, and enterprise-ready. One subscription, every tool you need.

Zero hosting required Full MCP catalog included Enterprise-grade security Auto-updated by Vinkius

Built, hosted, and secured by Vinkius. You just connect and go.