MCP Integration
Access your Orq.ai workspace directly from Claude Code. Query traces and models using natural language.
AI Gateway Beta
Route Claude Code’s model calls through the AI Gateway.
MCP
Claude Code is Anthropic’s official CLI that brings Claude’s capabilities to your terminal and development workflow. With the Orq MCP integration, you can access all Orq.ai features directly through Claude Code’s conversational interface.Prerequisites
- Claude Code CLI installed
- Active Orq.ai account
- Orq.ai API key
Installation
Add the Orq MCP server to Claude Code with a single command:Make sure to set your
ORQ_API_KEY environment variable before running the command:Verify Installation
Check that the Orq MCP is installed:orq in the list of available MCP servers.
What You Can Do
Once integrated, you can ask Claude Code to perform these operations:Analytics
Analytics
Get analytics overview for my workspaceShow me workspace metrics for the last 7 daysQuery analytics filtered by deployment ID
Models
Models
List all available chat modelsList all available embedding modelsInvoke model [model-id] with prompt [message]
Traces
Traces
List traces from the last 24 hoursShow me traces with errorsGet span details for trace [trace-id]Find the slowest traces from todayShow all traces for thread [thread-id]
Search
Search
Search for deployments in project [project-id]List directories in project [project-id]
Usage Examples
Query Trace Analytics
- Calculate the time range for the last 24 hours
- Use
list_traceswith error status filter - Analyze the error data
- Provide a summary of total error count, error types and frequencies, affected traces, and time distribution
Performance Analysis
- Use
query_analyticswith a 7-day time range - Analyze average latency trends over time
- Review token usage patterns and cost variations
- Compare error rate changes across the week
- Provide insights on model performance comparisons and trends
Trace Investigation
- Calculate yesterday’s date range
- Use
list_traceswith latency sorting (descending) and limit of 10 - Use
list_spansto retrieve span information for each trace - Analyze the execution patterns and span durations
- Provide performance insights identifying bottlenecks
- Suggest optimization opportunities based on the data
Troubleshooting
Authentication Errors
Authentication Errors
- Verify your API key is valid:
echo $ORQ_API_KEY - Check the API key has the necessary permissions
- Re-add the MCP with the correct API key
Connection Issues
Connection Issues
- Verify the endpoint URL is correct
- Check your internet connection
- Try removing and re-adding the integration
Tool Not Found
Tool Not Found
- Get MCP server details:
claude mcp get orq - Verify the MCP is properly installed:
claude mcp list
Plugins
Theorq-ai/assistant-plugins marketplace exposes two plugins for Claude Code. Add the marketplace once, then install whichever plugins you need:
| Plugin | Purpose |
|---|---|
orq-mcp | Standalone Orq MCP server. Gives Claude access to Orq.ai platform tools (agents, analytics, traces, experiments). |
orq-trace | Automatically traces Claude Code sessions to orq.ai: captures sessions, turns, tool calls, and LLM responses as hierarchical OTLP spans. |
MCP server
Session tracing
Theorq-trace plugin captures every Claude Code session as a hierarchical trace in orq.ai: useful for reviewing past coding sessions, sharing context with teammates, or analyzing tool-call patterns across runs.
ORQ_API_KEY in your environment so the plugin can ship spans to your workspace. Sessions appear under Traces once the next session starts.
AI Gateway
Beta Set the following environment variables before launching Claude Code. Once set, every model call Claude Code makes is automatically routed through the Orq.ai AI Gateway for the duration of that session.Claude Code requests routed through the AI Gateway appear in Traces.