Skip to main content

Overview

Mastra is a TypeScript AI agent framework with built-in browser capabilities and MCP support. Connect Ovra’s MCP server and your Mastra agents can pay for things online.

Setup

import { Agent } from "@mastra/core";
import { MCPClient } from "@mastra/mcp";
import { Browser } from "@mastra/agent-browser";

const mcp = new MCPClient({
  servers: {
    ovra: {
      url: "https://api.getovra.com/api/mcp",
      transport: "streamable-http",
      requestInit: {
        headers: { Authorization: "Bearer sk_test_..." }
      }
    }
  }
});

const agent = new Agent({
  name: "Shopping Agent",
  model: openai("gpt-4o"),
  browser: new Browser({ headless: false }),
  tools: await mcp.getTools(),
});

Usage

const result = await agent.generate(
  "Buy a USB-C hub under €30 on amazon.de using Ovra"
);
The agent will:
  1. Open a browser and navigate to amazon.de
  2. Find a suitable product and add to cart
  3. Call ovra_intent_create to declare the purchase
  4. Call ovra_checkout_pay to fill the payment form
  5. Return the result — agent never sees card data