MCP
Client implementation for Mastra, providing seamless integration with MCP-compatible AI models and tools.
Install
The installation steps are in the documentation below. Documentation
Documentation
From the project's README on GitHub, refreshed weekly. Links open on GitHub.
@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.
Frequently asked questions
What is MCP?
Client implementation for Mastra, providing seamless integration with MCP-compatible AI models and tools.
How do I install MCP?
Follow the installation steps in its documentation, shown on this page and in its repository.
Is MCP open source?
Its code is public on GitHub, but the repository does not declare a standard license.
Who maintains MCP?
It is published by mastra-ai. AI.tn lists it but does not maintain or endorse it.
From the community awesome-mcp-servers lists and the project's GitHub repository. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.