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

How to Use the Amplitude MCP in Mastra AI

Build resilient product analytics workflows in Mastra AI that automatically pull Amplitude data and handle API limits.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

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

Connect Amplitude MCP to Mastra AI

Create your Vinkius account to connect Amplitude 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

Automate cohort generation pipelines

The `get_cohort` tool triggers behavioral segment downloads directly from your Mastra AI workflows. Because these downloads require polling until the backend finishes processing, Mastra shines here. Its built-in workflow engine handles the wait states automatically without blocking your main thread. You start by calling `list_cohorts` to grab the ID, then pass it to the download function. If the Amplitude API throttles the request, Mastra applies exponential backoff. Your agent retries the pull, grabs the CSV data, and moves it to your data warehouse without writing custom retry logic.

Handle funnel failures gracefully with Mastra AI

Executing `get_funnel` pulls conversion rates across comma-separated event names. Sometimes product teams rename events, causing queries to fail. Mastra AI lets you build conditional branching to catch these errors. If the primary event name throws an error, the agent automatically retries with a legacy event name. Setting this up requires passing your MCP Client into the Agent tools array. Once connected, your workflow can chain these analytics checks together. It runs `event_segmentation` to find the drop-off, then alerts your product manager via Slack if the conversion dips below a specific threshold.

Audit user activity with human oversight

The `search_users` tool locates specific accounts by email or device ID before diving into their behavior. Since this exposes individual customer journeys, you might want strict control over who runs it. Mastra supports `requireToolApproval` for human-in-the-loop validation. When the agent wants to run `get_user_activity` on a high-profile enterprise account using the MCP Server, the workflow pauses. An admin clicks approve, and the query executes. This gives you deep diagnostic power over individual sessions while maintaining strict compliance protocols.

Setup guide

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

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

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

Install `@mastra/mcp` and instantiate a new `MCPClient` with your Vinkius server URL. Call `listTools()` and spread the results into your agent's tool configuration. Mastra automatically negotiates whether to use SSE or Streamable HTTP.
Yes. The `revenue_analysis` tool accepts YYYYMMDD date strings and returns daily financial metrics. You can schedule a Mastra workflow to run this every midnight and push the summary to your finance team.
Mastra catches the timeout and triggers its automatic retry system. The `export_events` tool pulls hourly blocks of data, so if the 2026010100 block fails, the workflow simply pauses and tries again based on your backoff settings.
Have your agent call `active_users` twice with different date ranges. Mastra's workflow engine can store the first result in memory, run the second query, and then pass both datasets to a node that calculates the percentage change.
Yes. When your agent runs `get_retention` with specific acquisition and return events, the Vinkius infrastructure processes the query in an isolated, zero-trust sandbox. The container spins up, runs the calculation, returns the data, and immediately destroys itself.

Start using the Amplitude MCP today

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

Built & Managed by Vinkius 30s setup 10 tools

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

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