Agentic Frameworks
Integrate your backend applications and AI agents with Madgicx MCP using OAuth 2.0 client credentials.
Agentic Frameworks
Agentic frameworks are server-side applications that can securely store credentials. Unlike browser-based OAuth flows, these integrations authenticate directly using a Client ID and Client Secret — no user interaction required after initial setup.
This is ideal for backend services, automated pipelines, and AI agent frameworks that need programmatic access to Madgicx MCP.
Getting Your Credentials
Open MCP Integration settings
Navigate to Workspace Settings → MCP Integration in your Madgicx dashboard.
Copy your Client ID
Your Client ID is displayed in the Credentials section. Use the copy button to copy it.
Generate a Client Secret
Click the rotate icon next to the Client ID to generate a new Client Secret. Copy and store it securely — it will only be shown once.
Store your secret securely
The client secret is only displayed once at creation time. Store it in a secrets manager or environment variable — never commit it to source control.
Rotating the Client Secret
You can rotate your client secret at any time from the MCP Integration settings:
- Click the rotate icon next to your Client ID
- Confirm the rotation in the dialog — this will invalidate your current secret immediately
- Copy and deploy the new secret to all services that use it
Secret rotation is immediate
Rotating the secret invalidates the previous one instantly. Any services using the old secret will need to be updated, or they will fail to authenticate.
MCP Server URL
All agentic frameworks connect to:
Environment Variables
All framework integrations below use the same environment variables. Create a .env file or set them in your environment:
Auth Helper
All framework integrations use a shared MadgicxConfidentialClientAuth helper that handles the OAuth 2.0 client credentials flow, including automatic token refresh. Place this in your project as auth.py:
This class:
- Reads credentials from environment variables (or accepts them as constructor arguments)
- Automatically obtains tokens via the
client_credentialsgrant - Refreshes expired access tokens using the refresh token
- Falls back to a full re-authentication if the refresh token is also expired
- Is thread-safe for use in concurrent applications