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

How to Use the Facebook Ads MCP in Mastra AI

Build resilient Facebook Ads workflows with Mastra AI that handle errors and retries automatically.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

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

Connect Facebook Ads MCP to Mastra AI

Create your Vinkius account to connect Facebook Ads 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 campaign workflows in Mastra AI

Chain multiple operations together using `list_campaigns` and `get_campaign_details` inside a Mastra workflow. If a call fails, the framework handles the retry logic for you. This is for building reliable agents. You can script a sequence that checks performance and updates status without manual oversight.

Conditional ad management for Mastra AI

Define branching logic where your agent evaluates `get_insights` before calling `update_ad_set_status`. If performance metrics drop below your threshold, the workflow triggers the update. It removes the need for custom retry code. Mastra manages the execution flow, ensuring your ad status updates are executed only when conditions are met.

Secure multi-step Facebook Ads operations

Use `get_me` to verify permissions before running complex `list_ads` tasks. Mastra AI provides a clear audit trail for every action taken by the agent. This setup allows for human-in-the-loop approvals. You can configure the agent to pause before calling `update_campaign_status`, ensuring you review the change first.

Setup guide

Set up Facebook Ads 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 Facebook Ads 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: "facebook-ads-mcp-client",
  servers: {
    "facebook-ads-mcp": {
      url: new URL(
        "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
      ),
    },
  },
});

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

const result = await agent.generate(
  "List recent Facebook Ads 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 Facebook Ads. 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 Facebook Ads MCP in Mastra AI

Yes. Because Mastra includes a built-in workflow engine, it handles retries automatically if a request to the Meta API encounters a temporary error.
Install the package and add the MCP server to your agent definition. You then spread the tools into your agent configuration to start running workflows.
Yes. You can create a workflow that triggers `update_ad_status` based on the data returned by `get_insights`.
It is. The server exposes its tools in a format that Mastra auto-detects, making it simple to include in your agent's toolset.
Data flows through a secure V8 sandbox. Your campaign performance metrics are kept strictly within the ephemeral memory of the agent session.

Start using the Facebook Ads MCP today

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

Built & Managed by Vinkius 30s setup 12 tools

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

No hosting. No infrastructure. No complex setup.
All 12 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.