Skip to main content
Mastra works well for TypeScript agents that need a remote MCP tool provider for X/Twitter search, profiles, trends, and write workflows.

Prerequisites

  • Node.js 20+
  • A Twexapi API key
  • A model provider configured for Mastra

Install

MCP server config

Full example

Agent prompt

Handoff fields

When Mastra passes results into another workflow, keep these fields stable:

Environment variables

.env

Multiple MCP servers

Keep the Twexapi server name stable when the same agent also uses docs, browser, or database MCP servers.

Package versions