oxagenDocs
MCP server

Connecting to the MCP server

How to connect Claude Code, Cursor, Claude Desktop, and other MCP clients to the Oxagen MCP server.

Prerequisites

You need an Oxagen API key. Create one on the workspace's Settings → API keys tab. A workspace key acts as a Member of its workspace, never as the person who created it. An organization key from Organization → API keys also connects, but its calls run at the organization level with no workspace. See Authentication.

The MCP server endpoint is:

https://mcp.oxagen.sh/mcp

Transport: streamable HTTP (the current MCP protocol standard).

Manual configuration by client

Claude Code

Register the server from a terminal. The URL is a positional argument:

bash
claude mcp add --transport http oxagen https://mcp.oxagen.sh/mcp \
  --header "Authorization: Bearer $OXAGEN_API_KEY"

Add --scope project to write the entry to .mcp.json at the repository root, so everyone who clones the repo gets the server. That file looks like this:

.mcp.json
{
  "mcpServers": {
    "oxagen": {
      "type": "http",
      "url": "https://mcp.oxagen.sh/mcp",
      "headers": {
        "Authorization": "Bearer ${OXAGEN_API_KEY}"
      }
    }
  }
}

Run claude mcp list to confirm the server connects.

Claude Desktop

Sign in with oxagen login, then run oxagen agent connect --app claude-desktop. The command adds an oxagen entry that reaches the local collector without an API key in the app's config. Restart Claude Desktop to load it. Claude Desktop is a connected app.

The following setup connects Claude Desktop with an API key.

Claude Desktop's config file starts only local (stdio) servers, and its remote connectors sign in with OAuth, which the Oxagen MCP server does not use. Bridge to the HTTP endpoint with mcp-remote, which needs Node.js on your machine. Add this to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

claude_desktop_config.json
{
  "mcpServers": {
    "oxagen": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.oxagen.sh/mcp", "--header", "Authorization:${OXAGEN_AUTH_HEADER}"],
      "env": {
        "OXAGEN_AUTH_HEADER": "Bearer ox_…"
      }
    }
  }
}

The header value goes through env because some launchers split an argument that contains a space. Restart Claude Desktop after saving.

Cursor

Add this to ~/.cursor/mcp.json (%USERPROFILE%\.cursor\mcp.json on Windows), or to .cursor/mcp.json in a project. Replace ox_… with your workspace API key:

mcp.json
{
  "mcpServers": {
    "oxagen-api": {
      "url": "https://mcp.oxagen.sh/mcp",
      "headers": {
        "Authorization": "Bearer ox_…"
      }
    }
  }
}

Reload Cursor, then confirm that the Oxagen tools appear in its tool list.

A key entry like this one serves every other Oxagen tool, but not steering. search_steering, read_steering and the other steering reads answer only an agent Oxagen wraps, so a call through a key entry is refused with no_wrapped_run. To give Cursor its steering, enroll the machine, as Enrolled hosts describes. Enrollment writes its own entry named oxagen, which is why the key entry here is named oxagen-api.

Dashboard rule

A Cursor team admin can add a rule that asks the agent to read the workspace's steering records before each task. Team rules need a Cursor Team or Enterprise plan.

  1. In Oxagen, open Agents, choose the Cursor agent, and open Steering.
  2. Under Dashboard rule, select Copy in the Cursor team dashboard readout.
  3. Open Rules in the Cursor dashboard.
  4. Add a team rule and paste the copied text.
  5. Leave the file pattern empty, enable the rule, and save it.

Select Enforce this rule if team members must keep it enabled. Cursor's team rule guide explains these settings.

The rule calls search_steering for the task's repository, then read_steering for the records the task needs. It reads every always-on result and follows mentions of other records.

Enrolled hosts

Enroll the machine with oxagen agent enroll --harness cursor to install the hooks that the Cursor editor and CLI both read. Enrollment also delivers steering at the start of a run and records its manifest, which lists what was included or cut. See Wrap an agent.

Enrollment also adds an oxagen MCP server to ~/.cursor/mcp.json, which reaches Oxagen through the machine's local gateway. The dashboard rule's search_steering and read_steering calls go through it, so Oxagen answers them as calls from a wrapped run. Enrollment keeps a server you already named oxagen and warns that it did. Rename yours and enroll again. Cursor's hook also sees each call through this entry, and the record keeps the call once, on the run. Cursor sends model calls to its own servers, so Oxagen's model gateways do not add steering to those calls.

Codex

bash
export OXAGEN_API_KEY=ox_…
codex mcp add oxagen-api --url https://mcp.oxagen.sh/mcp --bearer-token-env-var OXAGEN_API_KEY
codex mcp list

This writes the entry to ~/.codex/config.toml. Codex reads the key from OXAGEN_API_KEY when it connects, so the key never lands in the file:

~/.codex/config.toml
[mcp_servers.oxagen-api]
url = "https://mcp.oxagen.sh/mcp"
bearer_token_env_var = "OXAGEN_API_KEY"

A key entry like this one serves every other Oxagen tool, but not steering: the steering reads refuse it with no_wrapped_run. Enrolling the machine with oxagen agent enroll --harness codex writes an entry named oxagen that reaches Oxagen through the machine's local gateway, and the steering reads answer through it. Enrollment keeps a table you already named mcp_servers.oxagen and warns that it did. Rename yours and enroll again.

VS Code (with MCP extension)

Add this to your VS Code settings.json:

json
{
  "mcp": {
    "servers": {
      "oxagen": {
        "type": "http",
        "url": "https://mcp.oxagen.sh/mcp",
        "headers": {
          "Authorization": "Bearer ox_…"
        }
      }
    }
  }
}

Programmatic (Node.js / TypeScript)

Install version 2 of the TypeScript MCP SDK with npm install @modelcontextprotocol/client, then connect:

typescript
import {
  Client,
  StreamableHTTPClientTransport,
} from "@modelcontextprotocol/client";

const transport = new StreamableHTTPClientTransport(
  new URL("https://mcp.oxagen.sh/mcp"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${process.env.OXAGEN_API_KEY}`,
      },
    },
  }
);

const client = new Client(
  { name: "my-app", version: "1.0.0" },
  { capabilities: {}, versionNegotiation: { mode: "auto" } }
);

await client.connect(transport);

// List available tools
const tools = await client.listTools();

// Call a tool
const result = await client.callTool({
  name: "list_workspace_memories",
  arguments: { harness: "claude-code" }
});

versionNegotiation: { mode: "auto" } asks the server which MCP versions it speaks before the first call and uses the newest one both sides support, 2026-07-28 or a 2025 version. Without it, the SDK opens with the 2025 handshake only, which a server that speaks only 2026-07-28 refuses.

A tool has the name of the capability behind it, with no translation step: verb-first snake_case, such as list_workspace_memories or list_agent_tools. See MCP tools for the list.

Enrolled machines

On a machine you enrolled with oxagen agent enroll --all or oxagen agent enroll --harness <name>, no config file needs an API key. Enrollment adds an oxagen MCP server for each harness it wraps: Claude Code's user config (~/.claude.json), Codex's ~/.codex/config.toml, Cursor's ~/.cursor/mcp.json, and stella's $STELLA_HOME/mcp.toml. That entry holds no Oxagen key. It reaches Oxagen through the collector on the machine, which holds the credential.

  • Calls go out under the machine's gateway key. Among Oxagen's own tools, that key can call only those that change nothing and are not high-sensitivity.
  • The connection also lists the tools of the workspace's own MCP servers. See External MCP servers.
  • record_reflection and remember_lesson work only through this entry. Called with an API key, they refuse with no_watched_run.
  • The steering reads (search_steering, read_steering, get_steering_index, get_steering_skill and get_published_steering) answer only through this entry, and only in a harness Oxagen wraps: Claude Code, Codex, Cursor or Stella. Called with an API key, or from Claude Desktop, a connected app, they refuse with no_wrapped_run.
  • Enrollment keeps a server you already named oxagen and warns that it did. oxagen agent unenroll removes only the entry enrollment wrote.
  • Each entry names the harness it was written for. A machine enrolled before that keeps its steering until its entries are rewritten, which happens the next time oxagen agent status runs, or at the next Codex, Cursor or Stella session start. From then on, a call that names no harness is refused. Codex and Cursor gain their entry the same way.

Claude Code loads the entry in its next run.

Request limits

The server holds every request to these limits:

  • A request body is at most 10 MiB. A larger one gets HTTP 413.
  • A JSON-RPC batch, which only 2025-03-26 clients send, holds at most 4 entries. A larger batch gets HTTP 400 with code batch_too_large.
  • An upload_asset call goes in a request of its own. Sent in a batch with any other entry, it gets HTTP 400 with code asset_call_not_alone.
  • When the server is at capacity, it answers HTTP 503 with a Retry-After header. Wait that many seconds and send the request again.

Scope and isolation

Every connection to the MCP server runs in the org the API key belongs to, and in its workspace when it is a workspace key. The server routes each tool call to that tenant. A caller cannot reach another org's data through the connection, even with that org's resource IDs.

Verifying the connection

The tool list loads with any well-formed key, so call a tool to confirm the key works. get_install_instructions makes a safe first call. The client field is required:

json
{
  "name": "get_install_instructions",
  "arguments": { "client": "claude-code" }
}

Supported client values: claude-code, cursor, claude-desktop, codex, vscode. The tool returns copy-ready setup steps for that client, with placeholders for your key. Add an enrollmentToken, and the claude-code, codex, and cursor steps enroll the machine instead.

Troubleshooting

401 Unauthorized: The request has no Authorization: Bearer header, or the header is malformed. Check the header in your client's config.

A tool call fails with MCP request unauthorized: Oxagen refused the key, and the message names the reason. invalid_token means an unknown or revoked key. The others are expired_token, workspace_archived, and sso_required, which means the organization requires single sign-on and the key's creator has not signed in through it. Create a new key on the workspace's Settings → API keys tab.

Tool call denied: A key acts with its own role, never its creator's. A workspace key is a Member of its workspace, or a custom role on Enterprise, so a tool that needs an Owner or Admin refuses it with forbidden. A rule can also hold the call for a person's approval. See Authentication and RBAC and roles. Oxagen records each denial as a capability.invoke_denied event in Organization → Audit.

Tool not in the list: The server lists the same Oxagen tools for every key, and a rule answers each call when the call is made. An Oxagen tool missing from the list is not exposed on the MCP surface. See MCP tools. The tools of the workspace's own MCP servers appear only on an enrolled machine's connection. See Enrolled machines.

Connection drops during a long tool call: A proxy between your client and the server may close a long-held connection. Long-running capabilities, such as starting a background task, return a task ID at once, and Inngest runs the work in the background.

On this page