Prerequisites
- Python 3.10+
- A Caylex Navigator Instance with an API key (create one here)
- Users authenticated with your project’s servers (set up auth links)
Installation
Full example
main.py
Step-by-step
1
Set environment variables
2
Create the MCP server connection
Use
MCPServerStreamableHttp to connect to the Caylex Navigator. The params dict must include the url and headers with your API key and user email.3
Create an agent with Caylex tools
Pass the Caylex server to your agent’s
mcp_servers list. The agent automatically discovers all available tools through MCP.4
Run the agent
Use
Runner.run() to execute the agent with a user query. The agent uses Caylex tools to interact with external systems.Dynamic user email
In a production application, the user email typically comes from your application’s authentication context rather than an environment variable:Further reading
- OpenAI Agents SDK MCP documentation
- Connecting Your Agent — details on how the Navigator works
- Server Authentication for user-level vs project-level auth