Skip to content

Connect a tool to 9Login#

Ready-made settings for AI clients (MCP) and for scripts that call the 9Login API. First turn the API on (see API and MCP), then replace YOUR_API_KEY with the key from the API & MCP screen. If you changed the port there, change 37286 too. The Connect a tool section of the app shows the same settings with your key already filled in.

AI clients (MCP)#

Claude Code (run in a terminal)#

claude mcp add --transport http --scope user 9login http://127.0.0.1:37286/mcp --header "Authorization: Bearer YOUR_API_KEY"

Cursor (~/.cursor/mcp.json)#

{
  "mcpServers": {
    "9login": {
      "url": "http://127.0.0.1:37286/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}

VS Code (.vscode/mcp.json)#

{
  "servers": {
    "9login": {
      "type": "http",
      "url": "http://127.0.0.1:37286/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}

Scripts (REST)#

curl#

curl -H "Authorization: Bearer YOUR_API_KEY" "http://127.0.0.1:37286/v1/status"
curl -H "Authorization: Bearer YOUR_API_KEY" "http://127.0.0.1:37286/v1/profiles?limit=5"
curl -X POST "http://127.0.0.1:37286/v1/profiles/start" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["<profile id>"], "wait": true}'

Python (requests)#

import requests

BASE = "http://127.0.0.1:37286"
KEY = "YOUR_API_KEY"

def api(method, path, body=None):
    r = requests.request(method, BASE + path, headers={"Authorization": "Bearer " + KEY}, json=body, timeout=130)
    data = r.json()
    if not data["ok"]:
        raise RuntimeError(data["code"] + ": " + data["message"])
    return data["data"]

print(api("GET", "/v1/profiles")["total"])
job = api("POST", "/v1/profiles/start", {"ids": ["<profile id>"], "wait": True})
print(job["result"])

Node.js 18+#

const BASE = "http://127.0.0.1:37286";
const KEY = "YOUR_API_KEY";

async function api(method, path, body) {
  const res = await fetch(`${BASE}${path}`, {
    method,
    headers: { Authorization: `Bearer ${KEY}`, ...(body ? { "Content-Type": "application/json" } : {}) },
    body: body ? JSON.stringify(body) : undefined,
  });
  const data = await res.json();
  if (!data.ok) throw new Error(`${data.code}: ${data.message}`);
  return data.data;
}

console.log((await api("GET", "/v1/profiles")).total);

MCP (AI clients)#

AI clients such as Claude Code, Cursor and VS Code connect to http://127.0.0.1:37286/mcp with the key in the Authorization header. The Connect a tool section of the API & MCP screen has ready-made settings for each.

Protocol versions 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26. Answers are JSON; there is no streaming.

Each tool runs the endpoint listed beside it, with the same fields, checks and per-item results. A refusal comes back as a tool result with isError and a code from Responses and errors.

The tools follow Allow changes, Allow deleting and Allow automation and the permissions of a sub-user; the window tools exist on Windows only. After a switch changes, newer clients pick up the list within a minute; reconnect older ones.

With Allow automation on, an AI client also works inside running profiles: list_tabs, get_page_digest, screenshot and run_code, with macro_docs and validate_code to write the code. A profile in a Sync control session refuses them (inSync).

Every endpoint has a tool, with the same fields and defaults.

api_docs hands an AI client this reference, so it can write scripts and programs that call the endpoints. The key never appears in it.

proxy_script_docs hands it the reference of proxy scripts (the script of a script entry in the proxy list), get_proxy_script reads a saved one, and test_proxy_script runs one without saving it, so it can write or fix a script for a provider, try it, then save it with add_proxy_script or update_proxies.

Tool Endpoint
get_status GET /v1/status
get_account GET /v1/account
get_options GET /v1/options
api_docs GET /v1/docs
list_profiles GET /v1/profiles
get_profile GET /v1/profiles/{id}
get_logs GET /v1/profiles/{id}/logs
create_profiles POST /v1/profiles/create
update_profiles POST /v1/profiles/update
tag_profiles POST /v1/profiles/tags
duplicate_profiles POST /v1/profiles/duplicate
regenerate_fingerprints POST /v1/profiles/regenerate-fp
upgrade_user_agent POST /v1/profiles/ua-upgrade
export_cookies POST /v1/profiles/export-cookies
import_cookies POST /v1/profiles/import-cookies
clear_cookies POST /v1/profiles/clear-cookies
clear_browser_data POST /v1/profiles/clear-data
upload_browser_data POST /v1/profiles/upload
download_browser_data POST /v1/profiles/download
delete_profiles POST /v1/profiles/delete
start_profiles POST /v1/profiles/start
stop_profiles POST /v1/profiles/stop
list_running GET /v1/running
get_job GET /v1/jobs/{id}
arrange_windows POST /v1/windows/arrange
focus_window POST /v1/windows/focus
window_bounds POST /v1/windows/bounds
list_proxies GET /v1/proxies
get_proxy_script GET /v1/proxies/{id}/script
add_proxies POST /v1/proxies/add
add_proxy_script POST /v1/proxies/add-script
check_proxies POST /v1/proxies/check
test_proxy_script POST /v1/proxies/test-script
update_proxies POST /v1/proxies/update
delete_proxies POST /v1/proxies/delete
proxy_script_docs GET /v1/proxies/script-docs
list_extensions GET /v1/extensions
install_extensions POST /v1/extensions/install
delete_extensions POST /v1/extensions/delete
list_scripts GET /v1/scripts
get_script GET /v1/scripts/{id}
save_script POST /v1/scripts/save
delete_scripts POST /v1/scripts/delete
list_tasks GET /v1/tasks
get_task GET /v1/tasks/{id}
save_task POST /v1/tasks/save
delete_tasks POST /v1/tasks/delete
run_task POST /v1/tasks/run
cancel_task_run POST /v1/tasks/cancel
list_task_runs GET /v1/tasks/{id}/runs
get_task_run GET /v1/task-runs/{id}
list_tabs GET /v1/profiles/{id}/tabs
get_page_digest GET /v1/profiles/{id}/digest
screenshot GET /v1/profiles/{id}/screenshot
run_code POST /v1/profiles/{id}/exec
macro_docs GET /v1/macro/docs
validate_code POST /v1/macro/validate
curl -X POST "http://127.0.0.1:37286/mcp" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'