Codex Integration
Codex is OpenAI's AI-powered coding agent. By integrating Oodle with Codex, you can query your observability data directly from the AI assistant while coding.
Prerequisites
- Codex CLI installed on your machine
- An active Oodle instance
Configuration with OAuth (Recommended)
The Oodle CLI provides a one-command setup that handles OAuth authentication automatically, including token refresh — no manual token management required.
Step 1: Install the Oodle CLI
If you don't have the Oodle CLI installed, install it via Homebrew:
brew tap oodle-ai/oodle
brew install oodle
Step 2: Set up Codex
oodle mcp setup codex --deployment DEPLOYMENT
Replace DEPLOYMENT with your deployment identifier (e.g., us1, ap1).
This opens a browser window for authentication (if needed) and patches
~/.codex/config.toml to run an Oodle MCP proxy via stdio. The proxy
injects a fresh OAuth token on every request and refreshes it automatically
when it expires.
Step 3: Restart Codex
Restart Codex for the changes to take effect. That's it — no API keys or tokens to copy.
You can re-run oodle mcp setup codex at any time to update the
configuration. Use the --name flag to customise the MCP server name
(defaults to oodle-ai).
Configuration with API Key
If you prefer not to use the Oodle CLI, you can configure Codex with an API key directly.
Step 1: Get Your API Key
- Log in to your Oodle instance
- Navigate to Settings → Integrations
- Find the Codex (MCP) integration card
- Copy the configuration from the card
Step 2: Configure Codex
Add the following to ~/.codex/config.toml:
[mcp_servers.oodle-ai]
url = "https://YOUR_DEPLOYMENT.oodle.ai/v1/api/instance/YOUR_INSTANCE/mcp"
http_headers = { "X-API-KEY" = "YOUR_API_KEY" }
Replace:
YOUR_DEPLOYMENTwith your Oodle deployment domainYOUR_INSTANCEwith your Oodle instance IDYOUR_API_KEYwith your Oodle API key
You can copy the exact configuration from the Codex (MCP) integration card in your Oodle instance settings. It includes your instance ID and API key pre-filled.
Step 3: Restart Codex
After saving config.toml, restart Codex for the changes to take effect.
Usage
Once configured, you can query your observability data directly in Codex's AI assistant. Here are some example queries:
Query Logs
Show me error logs from the last hour
What are the most common error messages in the auth-service?
Find all logs containing "timeout" from yesterday
Query Metrics
What's the current CPU usage across all services?
Show me the request rate for the API service over the last 24 hours
Is there any metric that shows memory spikes?
Query Traces
Show me slow traces from the checkout service
Find traces that took longer than 5 seconds
Get the trace with ID abc123xyz
Check Alerts
Are there any active alerts right now?
Show me alerts that fired in the last 6 hours
What monitors are configured for the database service?
Query Dashboards
Show me the dashboard for the API service
What's the current value of the "Request Rate" panel?
Find all dashboards related to Kubernetes
Available Tools
The Oodle MCP server provides comprehensive observability tools across the following categories:
Logs
Query and filter logs with flexible time ranges and field-based filtering. Discover available fields and run aggregations to analyze log patterns.
Metrics
Execute PromQL queries to access your metrics data. Search for metrics, explore labels, and validate queries.
Traces
Search distributed traces by service, operation, or custom tags. Retrieve specific trace details and explore available trace attributes.
Alerts
Access active alerts, view monitor configurations, and check historical trigger data to understand your alerting landscape.
Grafana
Interact with Grafana dashboards programmatically. Search, retrieve, update dashboards, and query panel data directly. Dashboard write operations (save/update) require an Editor or Admin API key.
RUM (Real User Monitoring)
Query user sessions, browse session events, and investigate frontend issues and errors reported by the RUM SDK.
Integrations
Discover available integrations and retrieve setup specifications for onboarding new data sources.
Filtering Tools
By default, all tools are available. To limit the MCP server to specific tool categories, the method depends on how you configured Codex.
With OAuth (Oodle CLI)
Pass the --toolsets flag when running setup:
oodle mcp setup codex --deployment DEPLOYMENT --toolsets logs,metrics
With API Key
Append the toolsets query parameter to the MCP URL in ~/.codex/config.toml:
https://YOUR_DEPLOYMENT.oodle.ai/v1/api/instance/YOUR_INSTANCE/mcp?toolsets=logs,metrics
Available toolsets
| Toolset | Description |
|---|---|
logs | Log querying, filtering, field discovery, and aggregations |
metrics | PromQL queries, metric/label discovery, query validation |
traces | Trace search, retrieval, and label exploration |
alerts | Active alerts, monitors, trigger history, anomalies |
grafana | Dashboard search, retrieval, and management |
rum | Real User Monitoring sessions, issues, and errors |
integrations | Integration discovery and setup specifications |
Limiting toolsets reduces the number of tools exposed to the AI assistant, which can improve response quality by reducing context noise when you only need a subset of capabilities.
Troubleshooting
Tools not showing up in Codex
- Verify the MCP server was added successfully by running:
codex mcp list - If using Oodle CLI setup, verify your auth is still valid:
If expired, re-run
oodle auth tokenoodle mcp setup codex --deployment DEPLOYMENT. - If using API key setup, check that the key is valid and has not expired
- Ensure Codex was fully restarted after adding the MCP server
- Check Codex's logs for any MCP-related errors
Authentication errors
- Verify your API key is correct
- Check that your instance ID matches your Oodle instance
- Ensure your API key has not expired
- Try regenerating your API key from the Oodle UI
Tool execution errors
- Verify your Oodle instance is accessible
- Check that your API key role has access to the requested tool — Viewer keys cannot call write tools (e.g., save/update Grafana dashboards)
- Ensure your query parameters are valid (e.g., valid time ranges)
Connection refused
- Check your internet connection
- Verify the Oodle API endpoint URL is correct
- Ensure no firewall or proxy is blocking the connection
Best Practices
- Be specific: Provide clear context in your queries (time ranges, service names, etc.)
- Start broad: Begin with general queries and narrow down as needed
- Use natural language: The AI assistant understands context, no need for exact syntax
- Combine tools: Ask questions that might require multiple tools (e.g., "Show me logs and metrics for errors")
- Iterate: If results aren't what you expected, refine your query with more context
Security
- With the Oodle CLI setup, OAuth tokens are managed automatically and never
stored in Codex's configuration — the
oodle mcp serveproxy injects them at runtime - With API key setup, keys are stored locally in
~/.codex/config.toml - All communication is over HTTPS
- API keys can be rotated from the Oodle UI at any time
- Each API key is scoped to a specific Oodle instance
Support
If you need assistance or have any questions, please reach out to us through:
- Email at [email protected]