MCP Integration
Access the Orq.ai workspace directly from Claude Code. Manage experiments, query traces, and configure agents 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 the terminal and development workflow. With the Orq MCP integration, 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:Set the
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.
Available Commands
Once integrated, you can ask Claude Code to perform these operations:Agents
Agents
Create an agent with custom instructions and toolsGet agent configuration for [agent-key]Update agent [agent-key] with new instructions or modelConfigure agent with evaluators and guardrailsInvoke agent [agent-key] with input [message]Retrieve agent response [response-id]
Deployments
Deployments
Create a deployment called [deployment-key]Get deployment configuration for [deployment-key]
Skills
Skills
Create a skill called [skill-key]List all skills in my workspaceGet skill [skill-key]Update skill [skill-key]Delete skill [skill-key]
Analytics
Analytics
Get analytics overview for my workspaceShow me workspace metrics for the last 7 daysQuery analytics filtered by deployment ID
Datasets
Datasets
Create a dataset called "customer-queries"List all datapoints in dataset [dataset-key]Add datapoints to dataset [dataset-key]Update datapoint [datapoint-id]Delete specific datapoints in dataset [dataset-key]Delete dataset [dataset-key]
Experiments
Experiments
Create an experiment from dataset [dataset-key]List all experiment runsExport experiment run [run-id] as CSVRun experiment and auto-evaluate results
Evaluators
Evaluators
Get evaluator configuration for [evaluator-key]Create an LLM-as-a-Judge evaluator for toneCreate a Python evaluator to check response lengthAdd evaluator to experiment [experiment-key]Update evaluator [evaluator-key] with a new promptUpdate Python evaluator [evaluator-key] with revised code
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]
Models
Models
List all available chat modelsList all available embedding modelsInvoke model [model-id] with prompt [message]
Search
Search
Search for datasets named "customer"Find experiments in project [project-id]List directories in project [project-id]
Documentation
Documentation
Search the Orq.ai docs for [topic]
Managing Entities
Managing Entities
Delete agent [agent-key]Delete experiment [experiment-key]Delete evaluator [evaluator-key]Delete prompt [prompt-key]Delete knowledge base [knowledge-base-key]
delete_dataset to delete a dataset along with all its datapoints.Usage Examples
Create an Experiment
- Use
search_entitiesto find the “customer-queries” dataset - Use
create_experimentwith the specified name and dataset ID - Configure task columns with GPT-5.6 Sol and Claude Sonnet 5 models
- Return the experiment ID and configuration details
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
Create a Synthetic Dataset
- Generate 50 synthetic customer questions about e-commerce products
- Use
create_datasetto create a new dataset named “Product Questions” - Use
create_datapointsto add all 50 questions to the dataset - Confirm creation with the dataset ID and summary
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
Complete Experiment Creation
- Read and parse the CSV file
- Use
create_datasetto create a new dataset with an auto-generated name - Use
create_datapointsto add all 100 customer queries from the CSV - Use
create_llm_evalto create an LLM-as-a-Judge evaluator for tone - Use
create_llm_evalagain to create an LLM-as-a-Judge evaluator for accuracy - Use
create_experimentwith the dataset ID and auto-run enabled - Configure two task columns (one for GPT-5.6 Sol, one for Claude Sonnet 5)
- Execute the experiment automatically via the auto-run option
- Summarize the results with evaluation scores for both models
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 the 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 internet connectivity
- 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 three plugins for Claude Code. Add the marketplace once, then install whichever plugins you need:
orq-skills already bundles the MCP server. Don’t install orq-mcp alongside it or the MCP will be registered twice.Skills
Skills extend Claude Code with pre-built agentic workflows for the full Build, Evaluate, Optimize lifecycle. See the Skills page for the full reference.Installation
MCP server only
If you only want the Orq MCP server without the skills bundle, installorq-mcp instead:
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 the environment so the plugin can ship spans to the workspace. Sessions appear under Traces once the next session starts.
Commands
Quick slash-command actions available in Claude Code:Available Skills
Triggered by describing what you need. Claude Code picks the right skill automatically.AI Gateway
Beta Route Claude Code model requests through the Orq.ai AI Gateway. Set an Orq.ai API key asORQ_API_KEY, then choose the credential to use for model requests.
Use the workspace’s provider configuration
Use the Orq.ai API key as the model client’s credential:Shell
x-orq-integration-anthropic with the integration id or its exact display name. See Provider integrations.
Shell
Use a Claude subscription
Sign in to Claude Code with a Claude subscription. Keep that login for Anthropic and send the Orq.ai key separately:Shell
claude setup-token and set the resulting token as CLAUDE_CODE_OAUTH_TOKEN before launching Claude Code. Keep ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY unset so they do not replace the subscription credential.
Use an Anthropic API key
Set an Anthropic API key asANTHROPIC_API_KEY and keep the Orq.ai key in the custom header:
Shell
Enable MCP tool search
Claude Code disables MCP tool search by default whenANTHROPIC_BASE_URL points to a custom host. After configuring the AI Gateway, enable tool search to load MCP tool definitions on demand:
Shell
ENABLE_TOOL_SEARCH=true. Use a compatible Claude model and check the Anthropic tool search configuration for model requirements.
To persist the setting, merge this env setting into ~/.claude/settings.json, preserving existing entries, then start a new session:
JSON
true for on-demand loading. The auto setting loads tool definitions upfront until they reach 10% of the model’s context window, which is 100,000 tokens for a 1M-token model. Remove CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS from shell and settings configuration; contact the administrator if a managed policy sets it.
In the new session, run /mcp to confirm the server is connected and /context to inspect MCP tool loading. Ask Claude Code to list the available Orq.ai models, then ask a follow-up that uses the result. Verify the tool search, actual MCP call, and follow-up all succeed; the context display alone does not verify tool execution.
Deferred MCP tool loading and execution were validated with Claude Code 2.1.301 and Orq.ai responses-api:v4.16.4, using Claude Opus 5.5 through Anthropic and AWS Bedrock. Context savings depend on the configured tools. For Claude Desktop, use the separate Desktop tool-search setting.
Add request metadata
Tag requests withANTHROPIC_CUSTOM_HEADERS. Separate headers with newlines and keep x-orq-api-key when using an Anthropic credential:
Shell
Claude Code requests routed through the AI Gateway appear in Traces.
Troubleshooting
High context usage before the first prompt
High context usage before the first prompt
Follow Enable MCP tool search, then start a new session. Confirm
ENABLE_TOOL_SEARCH=true, keep experimental betas enabled, and check that permissions do not deny ToolSearch. Inspect /context with the same model, MCP servers, Skills, and conversation when comparing usage. Tool search reduces MCP schema loading; system prompts, built-in tools, and conversation history also consume context.400 invalid model format
400 invalid model format
The
ANTHROPIC_MODEL value is missing the provider prefix. Use the provider/model_id format (e.g. anthropic/claude-sonnet-5, not claude-sonnet-5).Claude Code calls Anthropic directly instead of Orq.ai
Claude Code calls Anthropic directly instead of Orq.ai
Set
ANTHROPIC_BASE_URL to https://my.orq.ai/v3/anthropic in the terminal that launches Claude Code, then start a new session.Authentication fails with an Anthropic credential
Authentication fails with an Anthropic credential
Keep the Orq.ai key in
x-orq-api-key. Send the Anthropic credential through the selected setup above. When using a subscription, unset ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY, then run /status to check the active Claude login.Requests not appearing in Orq.ai Traces
Requests not appearing in Orq.ai Traces
Verify
ANTHROPIC_BASE_URL is set to https://my.orq.ai/v3/anthropic. Requests sent to Anthropic’s own endpoint bypass the AI Gateway and produce no Traces.Verification
Start a Claude Code session and send a prompt. The response appears in the terminal and the trace appears in Traces with the model identifieranthropic/claude-sonnet-5 (or whichever model ANTHROPIC_MODEL is set to).