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.