Skip to content

MCP

Cloakray runs a Model Context Protocol server, so MCP clients — Claude Code, Codex, Cursor, Claude Desktop and others — can call Cloakray models as tools from inside a conversation. Ask your assistant for a second opinion from another model, or to generate an image, without leaving the client.

  • URL — https://api.cloakray.com/mcp
  • Transport — Streamable HTTP
  • Auth — sign in with OAuth, or send an API key as a Bearer token

This is a different thing from the inference API: you give the URL to an MCP client, not to an OpenAI SDK.

Tools

ToolWhat it does
chatSends messages to any text model and returns the reply.
list-modelsLists available text models and their capabilities.
generate-imageGenerates images from a prompt and returns them to the client.
list-image-modelsLists the image models the project can use.
generate-nano-bananaGenerates an image with Gemini 3 Pro Image.
get-accountReads your remaining balance and credit usage.

Tool calls that run a model are billed like any other request to the key's project, and appear in your logs.

Claude Code

claude mcp add --transport http cloakray https://api.cloakray.com/mcp

Then run /mcp in Claude Code and choose to authenticate; a browser window asks you to approve access. To use a key instead:

claude mcp add --transport http cloakray https://api.cloakray.com/mcp \
  --header "Authorization: Bearer $CLOAKRAY_API_KEY"

Cursor

In ~/.cursor/mcp.json, or .cursor/mcp.json in a project:

{
  "mcpServers": {
    "cloakray": {
      "url": "https://api.cloakray.com/mcp",
      "headers": { "Authorization": "Bearer ckr_..." }
    }
  }
}

Leave out headers to sign in with OAuth instead.

Codex

In ~/.codex/config.toml:

[mcp_servers.cloakray]
url = "https://api.cloakray.com/mcp"
bearer_token_env_var = "CLOAKRAY_API_KEY"

Other clients

Any client that supports remote MCP servers over Streamable HTTP works. Give it the URL; it discovers the OAuth endpoints from /.well-known/oauth-protected-resource/mcp and walks you through sign-in. Clients that only support local (stdio) servers need a bridge such as mcp-remote.

How OAuth sign-in works

When a client signs in, you approve access in the browser for the project currently selected in your console — switch project first if you want another one. The client then gets a token that works only for the MCP server; it can't be used as a general API key. Tokens last one hour, after which the client asks you to sign in again. Each connected client appears on the API keys page as "MCP: " followed by the client's host; delete it there to revoke access.

The server supports the stateless Streamable HTTP transport over POST. The older SSE transport is not offered.