Mastra/mcp
Client implementation for Mastra, providing seamless integration with MCP-compatible AI models and tools.
Install
Install and configure the MCP from https://github.com/mastra-ai/mastra/tree/main/packages/mcp now. Follow the repository's installation instructions, ask me for anything you can't complete yourself, and verify its tools load.@mastra/mcp
Mastra supports the Model Context Protocol (MCP), an open standard for connecting AI agents to external tools and resources. It serves as a universal plugin system, enabling agents to call tools regardless of language or hosting environment.
Mastra can also be used to author MCP servers, exposing agents, tools, and other structured resources via the MCP interface. These can then be accessed by any system or agent that supports the protocol.
Installation
npm install @mastra/mcp
Usage
Provide an MCP server URL or stdio command.
import { MCPClient } from '@mastra/mcp';
const client = new MCPClient({
servers: { docs: { url: new URL('https://example.com/mcp') } },
});
const tools = await client.listTools();
Documentation
Changelog
See the package changelog for version history and release notes.
Support
We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.