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

How to Use the BallDontLie MCP in Mastra AI

Build resilient, automated NBA data workflows using Mastra AI and the BallDontLie MCP Server.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

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

Connect BallDontLie MCP to Mastra AI

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

Build Resilient Player Workflows with Mastra AI

Using the `list_players` tool searches the NBA database, and `get_season_averages` pulls their seasonal performance metrics. Mastra AI runs these tools inside automated workflows, letting you chain search queries and stat lookups together. If the upstream sports data source experiences a temporary blip, Mastra's built-in retry mechanism handles exponential backoff automatically. Your Mastra agent will keep trying until it secures the NBA player data, preventing workflow crashes.

Branch Workflows Based on Live Game Results

Querying `list_games` retrieves scheduled matchups, while `get_game_details` and `list_player_stats` expose specific game outcomes and box scores. Mastra AI uses these tools to execute conditional branches based on court events like a blowout game or a high-scoring night. You can write Mastra logic that triggers a secondary analysis if an NBA player scores over thirty points, or alerts an editor if a game goes into overtime. The Mastra workflow engine handles the branching logic while this MCP Server provides the raw game numbers.

Sync NBA Team Data via MCP Server Workflows

Executing `list_teams` fetches active franchises, and `get_team_details` retrieves granular details about specific organizations. Mastra AI agents use these tools to keep local databases synchronized with active NBA rosters. Because Mastra deploys with a single command to any cloud provider, you can schedule these NBA sync tasks to run on a cron job. The Mastra framework handles the scheduling, while Vinkius manages the secure connection to the BallDontLie endpoint.

Setup guide

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

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

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

Install the MCP package and instantiate the client with your Vinkius URL. Spread the results of `mcpClient.listTools()` directly into your Mastra Agent's tool array to grant it access to NBA data.
Yes, you can set `requireToolApproval` on tools like `get_season_averages` or `get_game_details`. This pauses the Mastra workflow until you manually verify the action.
Mastra automatically detects the transport type, whether it is SSE or Streamable HTTP. It configures the connection to the Vinkius sandbox behind the scenes so your workflow can pull NBA stats immediately.
Mastra's workflow engine catches the failure and applies your configured retry policies. It retries the tool call with exponential backoff, ensuring temporary network drops don't ruin your NBA data pipeline.
All requests for NBA statistics, player profiles, and game results run through Vinkius's zero-trust V8 sandbox. Your search terms and API calls are executed in an ephemeral environment and never stored.

Start using the BallDontLie MCP today

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

Built & Managed by Vinkius 30s setup 8 tools

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

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