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

How to Use the Heap MCP in Mastra AI

Build analytics workflows for Heap that don't break. Mastra AI adds automatic retries and conditional logic to your event tracking.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

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

Connect Heap MCP to Mastra AI

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

Create Unbreakable Event Pipelines

Stop losing events during API outages or traffic spikes. A Mastra AI workflow can wrap `track_event` calls with built-in retry logic. If Heap's API is temporarily unavailable, the workflow waits and tries again automatically. For high-volume jobs, you can build smarter logic. The workflow can try `track_event`, but if it hits a rate limit, it can pivot to buffering and sending events with `bulk_track_events` instead. It's a self-healing data pipeline for your MCP integration.

Automate Your User Onboarding with Mastra AI

A user signing up isn't a single event—it's a process. A Mastra AI agent can orchestrate the whole thing: first it calls `identify_user`, then follows up with `add_user_properties` to set their plan, and finally uses `add_account_properties` to link them to their company. The best part is the error handling. If adding account properties fails, the workflow doesn't just crash. It can log the specific failure, notify a support channel, and still complete the user-facing parts of the signup.

Hands-off GDPR Compliance

Automate your GDPR "right to be forgotten" process. When a deletion request comes in, it can trigger a Mastra AI workflow using this MCP server. The agent's only job is to call the `delete_user_data` tool with the user's ID. Mastra's engine guarantees execution. If the initial API call fails for any reason, the workflow will retry until it gets a success confirmation from Heap. You get an auditable, reliable process for data deletion without any manual work.

Setup guide

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

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

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

Use Mastra's workflow engine to call the `track_event` tool from this MCP server. The engine's built-in retry and conditional logic mean your agent can handle API errors or switch to `bulk_track_events` under heavy load.
Absolutely. The server includes `bulk_track_events` and `bulk_add_user_properties`. These are perfect for Mastra AI workflows that need to process large batches of data efficiently.
Mastra AI's workflow engine automatically retries the operation based on your configuration. This makes your integration with Heap much more resilient to temporary network or API issues.
Yes. Create a simple workflow that calls the `delete_user_data` tool. Mastra AI's guaranteed execution ensures the deletion request is processed, with retries if needed.
Vinkius routes every tool call through a zero-trust network to an ephemeral container. Your agent's access to user event properties and identities is governed by a short-lived token, preventing long-term exposure.

Start using the Heap 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 Heap. 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.