#Connect your agent (MCP)
Operlance runs a hosted MCP server named operlance. It exposes every tool from the reference over HTTP (Streamable HTTP), authenticated with your agent token in the Authorization header. Nothing to install for Claude Code, Cursor, Gemini CLI or Codex.
#Connect your client
Replace agt_… with the agent token from the panel (AI → Agents). Never commit a config file that contains the token; rotate it from the panel if it leaks (AI → Agents → Rotate token).
Claude Code (the token can come from an environment variable):
claude mcp add --transport http operlance https://mcp.operlance.app/mcp --header "Authorization: Bearer $OPERLANCE_TOKEN"
Cursor (.cursor/mcp.json, Cursor connects to remote servers natively):
{
"mcpServers": {
"operlance": {
"url": "https://mcp.operlance.app/mcp",
"headers": { "Authorization": "Bearer agt_…" }
}
}
}
Gemini CLI (~/.gemini/settings.json):
{
"mcpServers": {
"operlance": {
"httpUrl": "https://mcp.operlance.app/mcp",
"headers": { "Authorization": "Bearer agt_…" }
}
}
}
Codex (~/.codex/config.toml, the token comes from an environment variable):
[mcp_servers.operlance]
url = "https://mcp.operlance.app/mcp"
bearer_token_env_var = "OPERLANCE_TOKEN"
default_tools_approval_mode = "approve"
Then add the token to your shell profile (~/.zshrc or ~/.bashrc) and open a new terminal:
export OPERLANCE_TOKEN="agt_…"
Perplexity (Beta), Mac app: Settings → Connectors → Add connector → Advanced, a local server through the same mcp-remote bridge as Claude Desktop (needs Node.js 18 or newer):
{
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.operlance.app/mcp", "--transport", "http-only", "--header", "Authorization:${OPERLANCE_AUTH}"],
"env": { "OPERLANCE_AUTH": "Bearer agt_…" }
}
Claude Desktop: claude_desktop_config.json starts local servers only, and remote servers added as Connectors need OAuth, which is not available yet. Until then use the mcp-remote bridge (needs Node.js 18 or newer). The header has no space after the colon and the token sits in env, because Claude Desktop on Windows breaks arguments that contain spaces:
{
"mcpServers": {
"operlance": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.operlance.app/mcp", "--transport", "http-only", "--header", "Authorization:${OPERLANCE_AUTH}"],
"env": { "OPERLANCE_AUTH": "Bearer agt_…" }
}
}
}
Cursor cannot read shell variables in headers, so the token is pasted into the file: keep that file out of any repository. The same goes for the Claude Desktop config above. The transport is stateless: every request is authenticated on its own.
#First call
Ask the agent to run get_onboarding. It returns what Operlance is, which businesses the agent can see, its grants and limits, the available tools and a few worked examples, about 2 000 tokens, no secrets. The same text is available as the MCP resource operlance://onboarding.
#What the server does
- One tool = one (sometimes two) REST calls. No business logic lives in the server.
- Every result carries
coverage,fx(when currencies were converted) andrequest_id. - Writes take
idempotency_keyandreason; results areexecutedorpending_approval. - Errors are the same codes as the REST API.