MCP — connect your AI

Connect Cursor, VS Code Copilot, Claude Desktop, Claude Code, Codex, OpenCode, and ChatGPT to OrkAI via the Model Context Protocol.

OrkAI exposes a local MCP server so your AI assistant can search indexed knowledge, store sessions, read standards, index code, and run review — without copying context into chat by hand. The CLI command orkai mcp-config detects installed clients and can print a paste block or add/update OrkAI in each client's tool config file.

If the client rejects a large text argument, use the CLI. See Create and update entities.

No MCP connection available? orkai mcp <tool> key=value runs the same tools from a shell. See orkai mcp.

orkai mcp-config

Run this in your terminal. It resolves your local SSE URL and bearer token. On a TTY with no flags it detects installed clients, lets you multi-select, then asks Print versus Add / update in the tool config file. --print and --client still emit paste blocks. --apply --client <name> writes without a menu or a prompt, so it also works in scripts. Pass several clients as --client cursor,vscode.

Each client section below starts with a command you can copy and run. The commands include --force, so running one again replaces an existing OrkAI entry (for example after the port or the token changed). Without --force an existing entry is left unchanged.

orkai mcp-config                          # TTY: detect, then print or add/update
orkai mcp-config --print                 # detect + print paste blocks
orkai mcp-config --client cursor         # Cursor paste block
orkai mcp-config --client windsurf       # Windsurf paste block
orkai mcp-config --client cline          # Cline (VS Code / CLI)
orkai mcp-config --client claude-desktop # Claude Desktop (mcp-remote)
orkai mcp-config --client claude-code    # Claude Code
orkai mcp-config --client codex          # OpenAI Codex CLI
orkai mcp-config --client opencode       # OpenCode v1
orkai mcp-config --client opencode-v2    # OpenCode v2
orkai mcp-config --client vscode         # VS Code Copilot user-profile mcp.json
orkai mcp-config --client chatgpt        # ChatGPT Developer Mode
orkai mcp-config --apply --client cursor # write ~/.cursor/mcp.json

Print output goes to stdout. Merge a paste block into the existing file (do not replace other MCP servers). Add / update writes only the orkai entry.

How OrkAI speaks MCP

OrkAI serves MCP on its MCP port over two transports, with the same tools on both:

  • Streamable HTTP at POST /mcp. It keeps no session and answers both the initialize flow (protocol up to 2025-11-25) and the 2026-07-28 server/discover flow.
  • Classic HTTP + SSE: your client opens an event stream at GET /sse and sends JSON-RPC at POST /message.

/mcp, /sse and /message all require a bearer token in the Authorization header. The token is the base64 form of the username and password in ~/.orkai/credentials, and orkai mcp-config writes it for you. A request with no header, a header that is not Bearer, a token that cannot be decoded, or a wrong username or password gets 401.

Pattern Who uses it When
Native SSE — url or serverUrl + headers Cursor, Cline, Claude Code (url); Windsurf (serverUrl) Client supports remote SSE directly (recommended for these)
Streamable HTTP — type: remote + url (/mcp) + headers OpenCode v2 The entry orkai mcp-config --client opencode-v2 writes. No Node or mcp-remote needed.
stdio bridge — npx mcp-remote Claude Desktop, Codex CLI, VS Code Copilot Client only launches local subprocesses; bridge proxies to OrkAI's SSE URL. Codex stores the bearer in the TOML file. VS Code writes an inline bearer under top-level servers.
Developer Mode UI ChatGPT (cloud) No local config file — paste URL + header in settings; needs public HTTPS

SSE and Streamable HTTP are different transports. Streamable HTTP uses one endpoint, /mcp. orkai mcp-config writes a /mcp entry only for OpenCode v2. Every other client keeps the /sse entry shown below. For Claude Code, use --transport sse, or the mcp-remote bridge if SSE misbehaves.

Client overview

Client --client Config location Transport
Cursor cursor ~/.cursor/mcp.json Native SSE
Windsurf windsurf ~/.codeium/windsurf/mcp_config.json Native SSE (serverUrl + headers)
Cline cline ~/.cline/mcp.json or Cline panel → MCP Servers → Configure Native SSE (url + headers)
Claude Desktop claude-desktop ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) mcp-remote stdio bridge
Claude Code claude-code claude mcp add (user) or ~/.claude.json SSE (type: sse)
OpenAI Codex codex ~/.codex/config.toml mcp-remote stdio + token in file
OpenCode (v1) opencode ~/.config/opencode/opencode.json Remote (type: remote) under mcp
OpenCode v2 opencode-v2 ~/.config/opencode/opencode.json Streamable HTTP (type: remote, /mcp) under mcp.servers
VS Code Copilot vscode User-profile mcp.json (macOS ~/Library/Application Support/Code/User/mcp.json) stdio mcp-remote, inline bearer
ChatGPT chatgpt Settings → Apps → Developer mode Cloud connector (HTTPS required)

Cursor

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client cursor --force
  1. Run orkai mcp-config --client cursor.
  2. Open Settings → MCP or edit ~/.cursor/mcp.json. Merge the mcpServers.orkai entry — keep your other servers.
  3. Restart Cursor if tools do not appear. MCP tools work in Agent mode.

Shape (values filled in by the CLI):

{
  "mcpServers": {
    "orkai": {
      "url": "http://127.0.0.1:8787/sse",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

Windsurf

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client windsurf --force

Windsurf Cascade uses its own dest and object. Run orkai mcp-config --client windsurf and merge into ~/.codeium/windsurf/mcp_config.json. The remote field is serverUrl, not Cursor's url.

Shape (values filled in by the CLI):

{
  "mcpServers": {
    "orkai": {
      "serverUrl": "http://127.0.0.1:8787/sse",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

Cline

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client cline --force

Cline is a VS Code extension (and CLI) that supports remote SSE servers natively. Run orkai mcp-config --client cline and merge the output into ~/.cline/mcp.json, or use the Cline panel: MCP Servers → Configure → Configure MCP Servers to open the settings JSON.

Shape (values filled in by the CLI):

{
  "mcpServers": {
    "orkai": {
      "url": "http://127.0.0.1:8787/sse",
      "headers": {
        "Authorization": "Bearer <token>"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Claude Desktop

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client claude-desktop --force

Claude Desktop does not accept a bare url + headers block. It only starts local stdio processes. OrkAI's output wraps the SSE endpoint with mcp-remote (requires Node.js and npx).

  1. Run orkai mcp-config --client claude-desktop.
  2. Paste into claude_desktop_config.json under mcpServers (macOS: ~/Library/Application Support/Claude/).
  3. Quit Claude Desktop completely and reopen.

Shape:

{
  "mcpServers": {
    "orkai": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://127.0.0.1:8787/sse",
        "--allow-http",
        "--transport",
        "sse-only",
        "--header",
        "Authorization:${ORKAI_AUTH}"
      ],
      "env": {
        "ORKAI_AUTH": "Bearer <token>"
      }
    }
  }
}

Claude Code

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client claude-code --force

Claude Code supports remote SSE. Prefer the CLI printed by orkai mcp-config --client claude-code (or --apply --client claude-code). File fallback is user-scope ~/.claude.json with required type: sse.

Option A — CLI (recommended)

claude mcp add orkai "http://127.0.0.1:8787/sse" -t sse -s user -H "Authorization: Bearer <token>"

Option B — ~/.claude.json (when claude is not on PATH)

{
  "mcpServers": {
    "orkai": {
      "type": "sse",
      "url": "http://127.0.0.1:8787/sse",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

OpenAI Codex

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client codex --force

Codex reads MCP servers from ~/.codex/config.toml. orkai mcp-config --apply --client codex writes an mcp-remote stdio block with the bearer token in the file (not bearer_token_env_var alone).

# ~/.codex/config.toml
[mcp_servers.orkai]
command = "npx"
args = ["-y", "mcp-remote", "http://127.0.0.1:8787/sse", "--allow-http", "--transport", "sse-only", "--header", "Authorization:${ORKAI_AUTH}"]
startup_timeout_sec = 60

[mcp_servers.orkai.env]
ORKAI_AUTH = "Bearer <token>"

OpenCode

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client opencode --force

OpenCode uses a top-level mcp key (not mcpServers). Run orkai mcp-config --client opencode and merge into ~/.config/opencode/opencode.json.

{
  "mcp": {
    "orkai": {
      "type": "remote",
      "url": "http://127.0.0.1:8787/sse",
      "enabled": true,
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

OpenCode v2

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client opencode-v2 --force

OpenCode v2 keeps servers under mcp.servers and has no enabled key. It connects to remote servers over Streamable HTTP, so the entry points at /mcp instead of /sse, with oauth: false and the bearer in headers. No Node or mcp-remote is needed. Run orkai mcp-config --client opencode-v2 (or --apply --client opencode-v2). Only the orkai entry is written; your other servers and settings stay.

{
  "mcp": {
    "servers": {
      "orkai": {
        "type": "remote",
        "url": "http://127.0.0.1:8787/mcp",
        "oauth": false,
        "headers": {
          "Authorization": "Bearer <token>"
        }
      }
    }
  }
}

Both versions read the same opencode.json, and OpenCode v1 rejects the mcp.servers shape ("Configuration is invalid"). If you also run OpenCode v1, use --client opencode: OpenCode v2 reads that shape too.

VS Code Copilot

Install with one command. Copy it and run it in a terminal. It writes the OrkAI entry for this client and leaves your other servers alone.

orkai mcp-config --apply --client vscode --force

Run orkai mcp-config --client vscode. It writes only the user-profile mcp.json. It does not write .vscode/mcp.json.

  • macOS: ~/Library/Application Support/Code/User/mcp.json
  • Linux: ~/.config/Code/User/mcp.json
  • Windows: %APPDATA%\Code\User\mcp.json

Top-level key is servers (not mcpServers). The OrkAI entry is type: stdio, command: npx, with args -y mcp-remote <SSEURL> --allow-http --transport sse-only --header Authorization: Bearer <token>. The bearer is inline. Other servers and inputs are preserved. After the file is written, click Start in Copilot MCP settings. That click is a VS Code limit.

{
  "servers": {
    "orkai": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://127.0.0.1:8787/sse",
        "--allow-http",
        "--transport",
        "sse-only",
        "--header",
        "Authorization: Bearer <token>"
      ]
    }
  }
}

ChatGPT (Developer Mode)

Cloud ChatGPT cannot reach 127.0.0.1. For local OrkAI you need a tunnel (ngrok, Cloudflare Tunnel) or remote mode with a reachable host. Run orkai mcp-config --client chatgpt for paste instructions. ChatGPT has no config file, so --apply does not work for it; print the values instead:

orkai mcp-config --client chatgpt
  • Settings → Apps → Advanced → Developer mode → Create app
  • Connector URL: your public HTTPS SSE URL (or tunneled local URL)
  • Custom header: Authorization: Bearer <token>

Custom MCP on Plus/Pro is read-only; write tools need Business, Enterprise, or Edu plans.

Assign orkai work settings with the tasks tool

The tasks tool takes the orkai work settings as arguments, next to metadata.workflow_id. The tool stores each one under the same key in the task's metadata.

ArgumentMeaning
harnessImplementation harness: claude-code, opencode, or another installed harness. Needed for pickup, with workflow_id and model.
modelA model in that harness's catalog. Needed for pickup.
variantA variant of that model, as the harness lists it. Empty or none means none.
review_harnessHarness for the gatekeeper review. Empty uses harness. When set, review_model is required.
review_model, review_variantModel and variant for the review. With no review keys the review uses the implementation settings.
tasks(action: "update", id: "<task-id>",
  harness: "claude-code", model: "<model>",
  review_harness: "opencode", review_model: "<provider/model>",
  metadata: { "workflow_id": "<workflow-id>" },
  category_ids: ["<project-category-id>"])

orkai mcp tasks action=update id=<task-id> harness=claude-code model=<model>

The same arguments filter list and search. Take harness, model and variant names from orkai workflow harnesses. A client that was connected before you updated orkai keeps the old tool list until you reload MCP. See Run it on a task.

Verify the connection

  1. In your assistant, start a new session (or reload MCP).
  2. Ask the agent to call overview() — you should see recent sessions, standards, and tool names scoped to orkai.
  3. If tools are missing: confirm orkai status, re-run orkai mcp-config (token/port may have changed), and fully restart the client.

Troubleshooting

SymptomLikely causeFix
No credentials found Setup not completed Run orkai serve once
Connection refused Daemon not running orkai start then orkai status
401 or unauthorized No bearer, or a token that is not the one in ~/.orkai/credentials. All of /mcp, /sse and /message require it Re-run orkai mcp-config --client <name> (or --apply), then reload the client
Wrong port in config Stale manual edit Re-run orkai mcp-config — it reads live runtime.json
Claude Desktop silent failure Used Cursor JSON (url only) Use --client claude-desktop (mcp-remote)
Claude Code auth errors Header not forwarded Use claude mcp add … --header "Authorization: Bearer …"
ChatGPT cannot connect Localhost from cloud Tunnel or remote host with HTTPS
VS Code Copilot lists OrkAI but tools stay off Start not clicked Click Start in Copilot MCP settings. That click is a VS Code limit after orkai mcp-config --client vscode

Daemon commands (start, stop, status, ports, logs) are documented on Daemon & MCP. MCP port and auth keys live in Configuration.