From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)
Execute the HR policy agent with MCP
From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)
Execute the HR policy agent with MCP
- [Speaker] Let's now run the HR policy agent and observe the results. The HR MCP server path is correctly built by the agent. It then initializes the MCP connection after starting up the MCP server. During this process, the embedding model is also downloaded. Then the tools and the prompt are loaded and printed. The prompt is loaded as a human message that can be readily consumed by the React agent. Then the agent is invoked to answer the query. The agent then sends the query to the MCP HR policy server. The MCP server uses vector retrieval to get the top three answers and returns back to the agent. The agent then generates the final output. This code shows a template for agents that can be built to use MCP servers.