Mastra talks to Agent Update over MCP. The server is https://api.tryagentupdate.com/v1/mcp, the transport is Streamable HTTP, and the credential is one header.
Setup
// npm i @mastra/mcp @mastra/core
import { MCPClient } from '@mastra/mcp';
export const agentUpdateMcp = new MCPClient({
id: 'agent-update',
servers: {
agentUpdate: {
url: new URL('https://api.tryagentupdate.com/v1/mcp'), // URL instance, not a string
requestInit: {
headers: { Authorization: `Bearer ${process.env.AGENT_UPDATE_TOKEN}` },
},
timeout: 30_000,
},
},
});
export const assistant = new Agent({
id: 'assistant', name: 'Assistant', model: 'openai/gpt-5.4',
instructions: 'Use agentUpdate_send_message, agentUpdate_ask_question, agentUpdate_check_replies.',
tools: await agentUpdateMcp.listTools(),
});Before you file a bug
url is typed URL; a string doesn't typecheck. getTools()/getToolsets() were **renamed** to listTools()/listToolsets() in v1, so every pre-v1 blog post is wrong. listTools() **namespaces** tools as <serverKey>_<toolName>, so write your instructions against those names. listToolsets() does not namespace them. connectTimeout defaults to 3000ms. For per-user PATs, build the client per request, pass toolsets: to generate(), then disconnect().
Check it worked
Ask the agent to text you. A 401 means the token is wrong, or the word Bearer is in there twice. No tool at all means the transport string is wrong. Both are covered in troubleshooting.
Next
The five tools and their arguments are on the MCP page. The same tools over plain HTTP are on the REST page. Every other tool is on the docs index.