Python SDK
The geksy package covers both APIs: Agent works with the app’s local API on this PC, and
Cloud works with the cloud API using an API key.
pip install geksyAgent: profiles on this PC
Section titled “Agent: profiles on this PC”Agent finds the local API port and token by itself in agent.json in the app data folder: Windows —
%LOCALAPPDATA%\Geksy\agent.json, Linux — ~/.local/share/Geksy/agent.json (or $XDG_DATA_HOME/Geksy). The app
must be running and signed in.
from geksy import Agent
agent = Agent()print(agent.status()) # app and engine versions, whether you're signed infor ws in agent.workspaces(): # the account's workspaces print(ws["id"], ws["name"])profiles = agent.profiles("1b7e…") # profiles in a workspaceprint(agent.running()) # profiles running on this PCstart() launches a profile and returns an object with the CDP addresses. Inside a with block the profile closes
by itself and its data goes to the cloud:
with agent.start("1b7e…", "8f0c…", headless=True) as p: # workspace_id, profile_id print(p.cdp_http, p.cdp_ws) # … connect Playwright, Puppeteer or Selenium …Without with, close the profile yourself: p.stop().
With Playwright
Section titled “With Playwright”from geksy import Agentfrom playwright.sync_api import sync_playwright
agent = Agent()with sync_playwright() as pw: ctx = agent.connect("1b7e…", "8f0c…").context(pw) # permanent address; the profile starts by itself page = ctx.pages[0] if ctx.pages else ctx.new_page() page.goto("https://example.com") print(page.title())connect() gives the profile’s permanent CDP address (requires the profile.export and automation.cdp permissions): if the profile isn’t
running, the app starts it on connection and closes it after 5 minutes without connections (idle_timeout_minutes).
context(pw) returns the profile’s own context — browser.contexts[0]; a new context (new_context()) has no cookies
or profile settings. With playwright.async_api — ctx = await conn.context(pw). For Puppeteer and other tools use
conn.ws_endpoint and conn.headers (or conn.ws_url with the token in the address). connect(…, start=True)
starts the profile right away; in a with block it closes on exit.
Cloud: the cloud with an API key
Section titled “Cloud: the cloud with an API key”from geksy import Cloud
cloud = Cloud("https://app.geksy.cc", "ak_…") # cloud address and a member's API keyWS = "1b7e…"
for prof in cloud.profiles(WS, tag="ads"): # filters as in GET /profiles; the SDK follows the cursor print(prof["number"], prof["name"])
new = cloud.create_profile(WS, name="Shop NL 08", tags=["shop"])cloud.update_profile(WS, new["id"], notes="<p>Stock</p>")
cloud.import_proxies(WS, "host:port:user:pass\nhost2:port:user:pass", check=True)print(cloud.proxies(WS))
cloud.request("GET", f"/workspaces/{WS}/usage") # any cloud API callA key sees only its own workspace and acts with its owner’s permissions — see Cloud API.
Geksy proxies: proxy_catalog/proxy_offers, proxy_wallet, proxy_pools/buy_pool, buy_proxies,
geksy_proxies, update_geksy_proxy, rotate_proxy, issue_rotation_link/revoke_rotation_link,
assign_proxy/assign_proxies (to profiles), export_proxies (formats line — host:port:user:pass, at, url, socks5, hostport, json),
proxy_notices/read_proxy_notices — see the example in Geksy proxies.
Scenarios from Python
Section titled “Scenarios from Python”from geksy import Agent
st = Agent().scenario(WS, [pid1, pid2], [ {"goto": "https://example.com"}, {"eval": "document.title"}, {"screenshot": True}, # results get {"screenshot_b64": "…"} (JPEG)], concurrency=2) # waits for the result; wait=None returns {"id"} right awayprint(st["results"][pid1]["results"][0])MCP server for AI agents
Section titled “MCP server for AI agents”Any MCP client can control profiles through the agent on this PC:
pip install "geksy[mcp]"claude mcp add geksy -- python -m geksy.mcpTools: geksy_workspaces, geksy_profiles, geksy_running, geksy_start, geksy_stop, geksy_run (steps in a
new profile tab, screenshots come back as images), geksy_scenario (a group of profiles), and geksy_create_profile
(create a profile in the cloud; needs the GEKSY_SERVER and GEKSY_API_KEY variables).
With the same variables, Geksy proxy tools are available: geksy_proxy_catalog,
geksy_proxy_wallet, geksy_proxy_pools, geksy_buy_pool, geksy_buy_proxies, geksy_list_geksy_proxies,
geksy_update_proxy, geksy_assign_proxy, geksy_rotate_proxy, geksy_rotation_link, geksy_export_proxies,
geksy_proxy_notices.
Toolsets, page actions, configurations for other MCP clients, and the remote MCP server are in AI via MCP.