GPALRestAPI

GPALRestAPI

GPALRestAPI scans for a free port starting at 3000 and, once bound, broadcasts the port number over UDP to 127.0.0.1:47623 so clients find it automatically. GPAL receives this and sets that browser's RestApiBaseUrl for you, readable as browser.RestApiBaseUrl. Each browser hears its own, so two browsers running OttoMagic each address their own server. A browser that never hears a port does not finish starting, so a browser you are holding always has one.

GPALRestAPI is also an MCP server. MCP, the Model Context Protocol, is how AI assistants such as Claude Code, Claude Desktop, Cursor and VS Code are given tools. POST /mcp offers every OttoMagic endpoint in openapi.yaml as a tool, with its parameters as the tool's inputs, so an assistant can drive your own browser, signed in as you, by asking. In Claude Code it is one line: claude mcp add --transport http gpal http://localhost:3000/mcp. The port is the one the server bound, 3000 unless something else had it.

GET /help lists every endpoint and what it takes, read from the same openapi.yaml, grouped as GPALRestAPI, OttoMatic and OttoMagic commands.

NOTE

There isn't much to set up here: download the installer and OttoMagic runs it. GPALRestAPI and OttoMagic work together and are useless separated.

Features

  • REST endpoints for everything: navigation, element interaction and queries, script injection before page load, storage across all storage types, page inspection, and DOM context switching
  • Language agnostic: any client that can make HTTP calls (GPAL, Python, Node.js, or curl) can drive the browser
  • Automatic port discovery: scans for a free port from 3000 and broadcasts it over UDP to 127.0.0.1:47623 so clients connect without configuration
  • OpenAPI documented: a bundled openapi.yaml documents every endpoint and its parameters for non-GPAL clients
  • An MCP server for AI assistants: POST /mcp offers every OttoMagic endpoint as a tool, so Claude and other assistants can drive your own browser; add it with claude mcp add --transport http gpal http://localhost:3000/mcp
  • Typed GPAL client: browser.OttoMagicClient is a ready-made fluent wrapper wired to these endpoints
💬 Ask GPAL