# How to Integrate OmniRoute with 33+ Coding Agents: Claude Code, Cursor, and Cline

> Integrate OmniRoute with 33+ coding agents like Claude Code, Cursor, and Cline. Register agents, auto-detect CLIs, and route LLM requests through a single unified endpoint with MCP skills.

- Repository: [Diego Rodrigues de Sa e Souza/OmniRoute](https://github.com/diegosouzapw/OmniRoute)
- Tags: how-to-guide
- Published: 2026-07-27

---

**Integrate OmniRoute with coding agents by registering each agent in the OAuth provider registry, auto-detecting local CLI installations, and invoking MCP skills that route LLM requests through a single unified endpoint.**

OmniRoute, from the `diegosouzapw/OmniRoute` repository, is an open-source routing layer built to integrate with over 33 coding agents without client-side reconfiguration. Whether you are orchestrating Claude Code, Cursor, or Cline, OmniRoute handles provider discovery, header injection, and model translation automatically.

## Register OAuth Providers to Integrate OmniRoute with Coding Agents

Every supported agent starts as a **provider** entry. The central registry lives in [`src/shared/constants/providers.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/providers.ts), while OAuth-based definitions for Claude Code, Cursor, and Cline are stored in [`src/shared/constants/providers/oauth.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/providers/oauth.ts).

Each entry supplies the base URL, authentication header logic, and model aliases. For example, the Claude Code provider is configured as follows:

```typescript
// src/shared/constants/providers/oauth.ts
export const OAUTH_PROVIDERS = {
  // … other providers …
  "claude": {
    name: "Claude Code",
    description: "Anthropic Claude Code CLI — ANTHROPIC_BASE_URL points to OmniRoute",
    authHeaders: (token) => ({
      "Authorization": `Bearer ${token}`,
      "Anthropic-Version": "2023-06-01",
      "User-Agent": getClaudeCodeUserAgent("cli"),
    }),
    compatiblePrefix: CLAUDE_CODE_COMPATIBLE_PREFIX,
  },
  // Cline, Cursor, … follow the same shape
};

```

### Model Aliases and Compatibility Prefixes

The `compatiblePrefix` field—such as `anthropic-compatible-cc-` for Claude Code—tells OmniRoute to treat any model ID beginning with that string as a Claude-Code-compatible model. This enables seamless gateway discovery without manual mapping. The feature flag governing this behavior is defined in [`src/shared/constants/featureFlagDefinitions.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/featureFlagDefinitions.ts).

## Auto-Detect Installed Agents with the CLI Tool Scanner

When OmniRoute starts, [`src/lib/cli-helper/tool-detector.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/cli-helper/tool-detector.ts) runs filesystem checks—using `which`, `stat`, and version parsing—to discover which CLI tools are present. The result is a list of tool descriptors:

```typescript
// src/lib/cli-helper/tool-detector.ts (excerpt)
export const DETECTED_TOOLS = [
  { id: "claude", name: "Claude Code", configPath: "~/.claude/profiles" },
  { id: "cursor", name: "Cursor", configPath: "~/.cursor/config.json" },
  { id: "cline",  name: "Cline",   configPath: "~/.cline/data/globalState.json" },
  // … up to 33+ agents …
];

```

Each descriptor feeds the **MCP tool registry** in [`src/lib/acp/registry.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/acp/registry.ts). This registration powers dashboard cards such as [`CliToolCard.tsx`](https://github.com/diegosouzapw/OmniRoute/blob/main/CliToolCard.tsx) and tells the backend how to construct upstream headers. For Cline-specific header generation, see [`src/shared/utils/clineAuth.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/utils/clineAuth.ts).

## Expose MCP Skills for Agent Orchestration

OmniRoute wraps each detected agent with an MCP or A2A skill that can be invoked via JSON-RPC. The skill catalog is declared in [`src/shared/constants/agentSkills.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/agentSkills.ts):

```typescript
// src/shared/constants/agentSkills.ts (excerpt)
{
  name: "installCodingAgents",
  description:
    "Detect installed CLI coding tools (Claude Code, Codex, Cursor, Copilot, Cline and more), " +
    "search GitHub for matching agent skills, and install them to the detected tools via OmniRoute's built‑in APIs.",
  handler: async (args) => { /* scans DETECTED_TOOLS → installs skill packs */ },
}

```

These skills enable workflows such as installing the latest Claude Code profile, running a Cline sub-agent, or executing a Cursor-based code completion directly from the OmniRoute dashboard or any MCP client.

## End-to-End Request Routing Flow

When you integrate OmniRoute with coding agents, client requests move through a predictable pipeline:

1. **Client sends a request** to `POST /v1/chat/completions` with a model ID such as `claude-sonnet-4-6`.
2. The **router** in [`open-sse/services/combo.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/combo.ts) resolves the model to the Claude Code provider via `isClaudeCodeCompatibleProvider()` (see [`src/shared/constants/providers.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/providers.ts)).
3. The **executor** in [`open-sse/executors/default.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/executors/default.ts) builds the Claude-Code-specific headers using the OAuth token stored in the user profile.
4. The **translator** converts the OpenAI-style payload into the Anthropic-compatible format expected by Claude Code.
5. The **response** is translated back and streamed through SSE, preserving Claude-specific markers such as `message_stop` automatically.

No additional client-side configuration is required beyond having the agent installed and its credentials saved.

## Code Examples for OmniRoute Coding Agent Integrations

The following snippets assume OmniRoute is running locally on port `3000`.

### List Detected Agents via the MCP Tools API

This TypeScript script queries the MCP tools endpoint populated by [`src/lib/acp/registry.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/acp/registry.ts) and filters for Claude Code, Cursor, and Cline:

```typescript
import { fetch } from "node-fetch";

async function listAgents() {
  const res = await fetch("http://localhost:3000/api/mcp/tools", {
    method: "GET",
    headers: { "Accept": "application/json" },
  });
  const { tools } = await res.json();
  console.log("Detected coding agents:");
  tools
    .filter((t) => ["claude", "cursor", "cline"].includes(t.id))
    .forEach((t) => console.log(`- ${t.name} (id=${t.id})`));
}

listAgents();

```

### Sync Claude Code Profiles Automatically

Enable the feature flag from [`src/shared/constants/featureFlagDefinitions.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/featureFlagDefinitions.ts) and trigger the `installCodingAgents` skill to sync profiles:

```typescript
import { fetch } from "node-fetch";

async function syncClaudeProfiles() {
  // Feature flag that auto-creates ~/.claude/profiles from the OmniRoute catalog
  await fetch("http://localhost:3000/api/settings/feature-flags/claude-code-profiles", {
    method: "POST",
    body: JSON.stringify({ enabled: true }),
    headers: { "Content-Type": "application/json" },
  });

  // Trigger the skill that syncs the profiles
  await fetch("http://localhost:3000/api/mcp/execute", {
    method: "POST",
    body: JSON.stringify({ tool: "installCodingAgents", args: {} }),
    headers: { "Content-Type": "application/json" },
  });

  console.log("Claude Code profiles synced from the live catalog.");
}

syncClaudeProfiles();

```

### Route a Chat Completion Through Cursor

Send a prompt through Cursor by targeting a model alias defined in [`providers/oauth.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/providers/oauth.ts). The router uses `isClaudeCodeCompatibleProvider`-style logic and the `DefaultExecutor` injects the required `Authorization` header via [`src/shared/utils/cursorAuth.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/utils/cursorAuth.ts):

```typescript
import { fetch } from "node-fetch";

async function cursorChat(prompt: string) {
  const res = await fetch("http://localhost:3000/v1/chat/completions", {
    method: "POST",
    body: JSON.stringify({
      model: "cursor-codex-1",
      messages: [{ role: "user", content: prompt }],
    }),
    headers: { "Content-Type": "application/json" },
  });

  const data = await res.json();
  console.log("Cursor response:", data.choices[0].message.content);
}

cursorChat("Explain the Observer pattern in TypeScript.");

```

## Summary

- **Provider registry**: [`src/shared/constants/providers/oauth.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/providers/oauth.ts) defines OAuth entries for Claude Code, Cursor, Cline, and others.
- **Auto-detection**: [`src/lib/cli-helper/tool-detector.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/cli-helper/tool-detector.ts) scans the host machine and publishes tool descriptors to [`src/lib/acp/registry.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/acp/registry.ts).
- **Orchestration**: [`src/shared/constants/agentSkills.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/agentSkills.ts) exposes the `installCodingAgents` skill for automated profile and skill-pack management.
- **Routing**: [`open-sse/services/combo.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/combo.ts) and [`open-sse/executors/default.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/executors/default.ts) resolve model aliases, inject headers, and translate payloads transparently.
- **Integration endpoint**: A single `POST /v1/chat/completions` request is enough to reach any detected coding agent.

## Frequently Asked Questions

### Which file defines the Claude Code OAuth provider in OmniRoute?

The provider definition lives in [`src/shared/constants/providers/oauth.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/shared/constants/providers/oauth.ts). It supplies the `authHeaders` callback, the `compatiblePrefix` constant, and descriptive metadata that the router consumes to identify and sign Claude Code requests.

### How does OmniRoute detect whether Cline or Cursor is installed?

On startup, [`src/lib/cli-helper/tool-detector.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/cli-helper/tool-detector.ts) performs filesystem checks to locate CLI binaries and config directories. It emits tool descriptors that are consumed by [`src/lib/acp/registry.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/acp/registry.ts), so the backend and UI both know which agents are available.

### What endpoint routes chat-completion requests to a specific coding agent?

Clients send standard requests to `POST /v1/chat/completions`. OmniRoute’s combo router in [`open-sse/services/combo.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/combo.ts) examines the model ID and routes the request to the correct executor, which attaches provider-specific headers before calling upstream.

### Can I add a new coding agent without modifying OmniRoute’s core routing engine?

Yes. According to the OmniRoute source code, adding an agent requires four steps: register the provider in [`providers/oauth.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/providers/oauth.ts), implement custom header logic if needed, add a detection entry in [`tool-detector.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/tool-detector.ts), and optionally expose an MCP skill in [`agentSkills.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/agentSkills.ts). The router and UI automatically pick up the new agent.