Authentication and authorization is something we are thinking about a lot at the moment, especially for agents that are MCP servers.Our thoughts here are to handle auth the same way that the MCP spec outlines auth (https://modelcontextprotocol.io/specification/2025-03-26). The key thing is to send authorization requests back to the user in a structured way. For example, if Agent A invokes Agent B, which requires user approval for executing a tool call, that authorization request needs to be piped back to the client, and then propagated back to the agent.
This is technically possible to do with the MCP protocol as it exists today, but I think we will want to add that support in mcp-agent itself so it is easy to pause an agent workflow waiting for authentication/authorization.
One nice property of representing agents as MCP servers is that Agent discovery is the same as server discovery.