docs/src/course/02-agent-tools-mcp/15-updating-mcp-config-github.md
Now, let's update your MCP configuration in src/mastra/agents/index.ts to include the GitHub server:
const mcp = new MCPClient({
servers: {
zapier: {
url: new URL(process.env.ZAPIER_MCP_URL || ''),
requestInit: {
headers: {
Authorization: `Bearer ${process.env.ZAPIER_MCP_API_KEY}`,
},
},
},
github: {
url: new URL('https://api.githubcopilot.com/mcp/'),
requestInit: {
headers: {
Authorization: `Bearer ${process.env.GITHUB_PERSONAL_ACCESS_TOKEN}`,
},
},
},
},
})
This configuration adds the GitHub MCP server alongside the Zapier server we added in the previous step. The github key is a unique identifier for this server in your configuration.
How it works:
url property points to GitHub's hosted remote MCP serverrequestInit.headers property passes your Personal Access Token for authenticationBy adding multiple servers to your MCP configuration, you're building a more versatile agent that can access a wider range of tools and services. Each server adds its own set of capabilities to your agent.