OpenAI Agents SDK
Connect Madgicx MCP to the OpenAI Agents SDK using client credentials authentication.
OpenAI Agents SDK
Build AI agents with the OpenAI Agents SDK that have access to all Madgicx MCP tools.
Prerequisites
- Python 3.10+
- Madgicx client credentials
- An LLM API key (e.g., OpenAI)
Installation
Setup
1. Configure environment variables
2. Add the auth helper
Copy the MadgicxConfidentialClientAuth helper into your project as auth.py. You can also create a custom auth handler if your setup requires different authentication logic.
3. Create the agent
How It Works
MadgicxConfidentialClientAuthobtains an access token using your client credentials- The token is passed as an HTTP header to
MCPServerStreamableHttp - The agent discovers all available Madgicx tools via the MCP protocol
- When the agent calls a tool, the SDK sends the request to the MCP server with the Bearer token