
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
@composio/mastra
Advanced tools
Agentic Provider for Mastra in Composio SDK.
npm install @composio/core @composio/mastra
# or
yarn add @composio/core @composio/mastra
# or
pnpm add @composio/core @composio/mastra
Required environment variables:
COMPOSIO_API_KEY: Your Composio API keyMASTRA_API_KEY: Your Mastra API keyOptional environment variables:
MASTRA_API_URL: Custom API base URL (defaults to Mastra's API)MASTRA_DEBUG: Enable debug logging (set to "true")import { Composio } from '@composio/core';
import { MastraProvider } from '@composio/mastra';
// Initialize Composio with Mastra provider
const composio = new Composio({
apiKey: process.env.COMPOSIO_API_KEY,
provider: new MastraProvider({
apiKey: process.env.MASTRA_API_KEY,
}),
});
// Get available tools
const tools = await composio.tools.get('user123', {
toolkits: ['gmail', 'googlecalendar'],
limit: 10,
});
Check out our complete example implementations:
The MastraProvider class extends BaseAgenticProvider and provides Mastra-specific functionality.
new MastraProvider(options?: MastraProviderOptions)
Options:
apiKey: Your Mastra API keyapiUrl: Custom API base URLdebug: Enable debug loggingmodifiers: Custom execution modifiersexecutionStrategy: Custom tool execution strategywrapTool(tool: Tool, executeTool: ExecuteToolFn): MastraToolWraps a tool in the Mastra format.
const tool = provider.wrapTool(composioTool, executeTool);
wrapTools(tools: Tool[], executeTool: ExecuteToolFn): MastraToolCollectionWraps multiple tools in the Mastra format.
const tools = provider.wrapTools(composioTools, executeTool);
executeToolCall(userId: string, toolCall: MastraToolCall, options?: ExecuteToolFnOptions): Promise<string>Executes a tool call from Mastra and returns the result.
const result = await provider.executeToolCall('user123', toolCall, {
connectedAccountId: 'account123',
});
We welcome contributions! Please see our Contributing Guide for more details.
ISC License
For support, please visit our Documentation or join our Discord Community.
FAQs
Agentic Provider for mastra in Composio SDK
We found that @composio/mastra demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies