mcp-session-bridge

v1.4.1
io.github.t3ratech/mcp-session-bridge Checked 2 days ago Published 26 days ago

Drive a browser you are already signed into, through the free T3rnel Browser extension.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

session_install

Return setup instructions for the T3rnel Browser extension and for the free standalone automation browser. Needs no browser and no licence, so it is the one tool that always answers — call it when another tool reports the extension is missing. Returns installation steps as text.

session_health

Report which transport is live and what it can do. Call this first when another tool fails unexpectedly: it separates 'the extension is not running' from 'this browser does not implement that API', which produce very different fixes. Returns {ok, mode, browser, profileDir} in standalone mode, and the connection state plus the available browser APIs when the extension is attached.

session_list_tabs

List every open tab. Returns an array of {id, title, url}. The ids are what every other tool's optional tabId argument accepts; omit tabId and a tool acts on the active tab, which is rarely what you want once you have opened tabs of your own.

session_close_tab

Close a tab, named explicitly by its id from session_list_tabs. Returns {closed, tabId}. Unlike every other tool here, tabId is required and there is no active-tab default: closing a tab is not undoable, and the active tab is the one the user is looking at. Requires the T3rnel Browser extension; the standalone browser refuses it by name.

ParameterTypeDescription
tabId *integerTab to close, from session_list_tabs

session_navigate

Navigate a tab to a URL inside the user's authenticated session, so pages behind a login load as themselves rather than as a signed-out visitor. Reuses the active tab unless newTab is true. Returns {navigated} with the requested URL, and newTab when a tab was created. It returns once navigation is dispatched, not once the page has settled — follow it with session_wait before reading.

ParameterTypeDescription
url *stringAbsolute URL to navigate to, including the scheme
backgroundbooleanDo not focus the tab — open/update it in the background so automation does not steal the user's foreground tab (default false)
newTabbooleanOpen in a new tab instead of reusing the active tab (default false)
tabIdintegerTab id from session_list_tabs; uses the active tab when omitted

session_snapshot

Capture a semantic map of a page for deciding what to act on. Returns {url, title, elements}, where each element is {ref, tag, text} — ref being an @eN handle that session_click, session_fill, session_type, session_select and session_press all accept in place of a CSS selector. Prefer this over session_read_page when the goal is to interact rather than to read: it lists only elements a user could actually operate. Skips zero-size and hidden elements, caps each label at 120 characters, and stops at 200 elements.

ParameterTypeDescription
tabIdintegerTab to snapshot; uses the active tab when omitted

session_read_page

Read a page's visible text, as rendered in the user's authenticated session. Returns {url, title, text, truncated}; text is the body's rendered innerText capped at 50,000 characters, and truncated is true when the page was longer. Prefer this over session_snapshot when the goal is to read or summarise; prefer session_snapshot when the goal is to interact.

ParameterTypeDescription
tabIdintegerTab to read; uses the active tab when omitted

session_click

Click an element, by CSS selector or by an @eN ref from session_snapshot. Scrolls the element into view and dispatches a real mouse press and release at its centre, so handlers that ignore synthetic events still fire. Returns {clicked} naming what was targeted. Fails with 'Element not found' rather than clicking something else when nothing matches.

ParameterTypeDescription
refstringA ref from session_snapshot, such as @e12, used instead of selector
selectorstringCSS selector for the element to click; pass ref instead to use a handle from session_snapshot
tabIdintegerTab to act on; uses the active tab when omitted

session_fill

Set a form field's value in one step — input, textarea, or a rich-text editor such as ProseMirror, Lexical or Slate. Writes through the native value setter and then fires input and change, which is what React and Vue listen for. Returns {filled} naming the field. Use session_type instead when a field only reacts to real keystrokes, and session_select for a dropdown.

ParameterTypeDescription
value *stringText to place in the field, replacing whatever is there
refstringA ref from session_snapshot, such as @e12, used instead of selector
selectorstringCSS selector for the field to fill; pass ref instead to use a handle from session_snapshot
tabIdintegerTab to act on; uses the active tab when omitted

session_type

Type text one character at a time, firing the key events a real keyboard would. Use this instead of session_fill when a field only reacts to keystrokes — search boxes with live suggestions, autocompletes, and inputs with per-character validation. Returns {typed} with the number of characters sent. Slower than session_fill, so reach for it only when session_fill leaves the page unchanged.

ParameterTypeDescription
text *stringText to type, one character at a time
refstringA ref from session_snapshot, such as @e12, used instead of selector
selectorstringCSS selector for the field to type into; pass ref instead to use a handle from session_snapshot
tabIdintegerTab to act on; uses the active tab when omitted

session_select

Choose an option in a <select> dropdown, by value, by visible text, or by index. Filling a select as though it were a text field does nothing — the native value setter belongs to HTMLInputElement and has no effect here — which is the silent failure this tool exists to prevent. Matches value first, then exact visible text, then a substring, then index. Returns {selected, value, text} for the chosen option, and on no match fails with the available options listed.

ParameterTypeDescription
indexintegerZero-based option index to choose; tried last
refstringA ref from session_snapshot, such as @e12, used instead of selector
selectorstringCSS selector for the <select>; pass ref instead to use a handle from session_snapshot
tabIdintegerTab to act on; uses the active tab when omitted
textstringVisible option text to choose; matched exactly first, then by substring
valuestringOption value to choose; tried first

session_press

Press a single keyboard key on the focused element, or on a named element after focusing it. Use it to submit a form with Enter, dismiss a dialog with Escape, or walk a suggestion list with ArrowDown. Returns {pressed} naming the key. Supported keys are Enter, Tab, Escape, Backspace, Delete, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, PageUp, PageDown and Space; anything else fails with the supported list rather than doing nothing.

ParameterTypeDescription
key *stringOne of Enter, Tab, Escape, Backspace, Delete, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, PageUp, PageDown, Space
refstringA ref from session_snapshot, such as @e12, used instead of selector
selectorstringCSS selector for the element to press the key on; uses the focused element when omitted
tabIdintegerTab to act on; uses the active tab when omitted

session_evaluate

Run JavaScript in the page's own context and return its completion value. Use it for what the other tools do not cover — reading computed styles, walking a data structure the page holds, or checking a condition too specific for session_wait. Objects come back as formatted JSON, strings as themselves, and an expression with no value as "undefined". End the code with the expression you want back; a trailing statement returns nothing useful.

ParameterTypeDescription
code *stringJavaScript to run in the page's own context. Its completion value is returned, so end with the expression you want back
tabIdintegerTab to run in; uses the active tab when omitted

session_screenshot

Capture what is currently on screen in a tab. Returns a data: URL holding a base64 PNG or JPEG. This is the visible viewport only — it does not scroll or stitch, so a long page needs the extension's full-page capture instead.

ParameterTypeDescription
formatstringpng (default, lossless) or jpeg (smaller, and the only format quality applies to)
qualityintegerJPEG quality from 0 to 100; ignored for png
tabIdintegerTab to capture; uses the active tab when omitted
windowIdintegerWindow to capture from; uses the current window when omitted

session_wait

Block until a page reaches a known state, so the next tool acts on a settled page rather than a half-loaded one. Waits for the load event, for the URL to contain a string, or for a selector to appear. Returns as soon as the condition holds — {condition, waited} for load, {condition, url} for url, {condition, found} for selector — and fails at the timeout with a named error rather than hanging the client. Polls every 200ms; the default timeout is 10000ms.

ParameterTypeDescription
condition *stringWhat to wait for: load (the load event), url (value appears in the URL), or selector (element appears)
tabIdintegerTab to wait on; uses the active tab when omitted
timeoutMsintegerMaximum wait in milliseconds (default 10000)
valuestringURL substring or CSS selector to wait for; required for the url and selector conditions

session_login

Decrypt stored credentials for a domain and fill them into the page's sign-in form. Requires the T3rnel Browser extension with Pro, because the encrypted vault lives in the extension; the refusal comes from the extension rather than from this bridge, so there is one gate rather than two that can disagree. The standalone browser has no vault — sign in once by hand in its profile instead, and the session persists.

ParameterTypeDescription
domain *stringDomain the credentials are saved for, such as "github.com"
masterPasswordstringPassphrase that unlocks the extension's vault. Never log or persist it
submitbooleanIgnored; kept so older callers do not break
tabIdintegerTab holding the sign-in form; uses the active tab when omitted

session_store_login

Encrypt credentials for a domain and store them in the extension's vault, for session_login to use later. Requires the T3rnel Browser extension with Pro. The password is never returned by this or any other tool, and never appears in a listing or an error.

ParameterTypeDescription
domain *stringDomain the credentials belong to, such as "github.com"
password *stringPassword to encrypt and store. It is never returned by any tool
username *stringUsername or email to store
masterPasswordstringPassphrase that unlocks the extension's vault. Never log or persist it

session_record_start

Begin recording what happens in a tab: clicks, scrolls, keystrokes, form fills, selections and navigations, each with a timestamp. Returns {recording, sessionId, tabId} — keep the sessionId, since every other recording tool needs it. Requires the T3rnel Browser extension. Recording stops on its own if the tab closes or after four hours.

ParameterTypeDescription
maxEventsintegerMaximum events to keep, oldest dropped first (default 10000)
sessionIdstringRecording session id; one is generated when omitted
tabIdintegerTab to record; uses the active tab when omitted

session_record_stop

Stop a recording and return {recording, sessionId, eventCount, durationMs}. The events themselves are read separately with session_record_events, so this is cheap to call on a long recording. Requires the T3rnel Browser extension. With several recordings active, sessionId is required and the error names how many are running.

ParameterTypeDescription
sessionIdstringSession to stop; required only when more than one recording is active

session_record_list

List every recording, running or finished, so a caller can find the id that session_record_events and session_record_replay need. Returns {sessions}, each entry being {id, tabId, active, startedAt, stoppedAt, stoppedReason, eventCount, durationMs}. Requires the T3rnel Browser extension.

session_record_events

Fetch the captured events of a recording, in the order they happened. Returns {events, count}, where count is the total held for the session and events is one page of {type, timestamp, tabId, data}; type is one of click, scroll, keypress, input, navigation, focus, select or resize. Page through long recordings with limit and offset rather than reading them whole, since a session can hold tens of thousands of events. Requires the T3rnel Browser extension.

ParameterTypeDescription
sessionId *stringRecording session to read, from session_record_list
limitintegerMaximum events to return in this page (default 100)
offsetintegerNumber of events to skip, for paging through a long recording (default 0)

session_record_replay

Replay a stopped recording in its original tab, reproducing the recorded interactions in order. Returns {sessionId, totalEvents, replayedEvents, failedEvents, errors}, so a partial replay reports which steps failed instead of appearing to succeed. The tab must still be open. This acts on the live page and its effects are real — it will re-send messages, re-submit forms and re-spend money — so the extension classifies it high risk and gates it behind an approval prompt. Requires the T3rnel Browser extension.

ParameterTypeDescription
sessionId *stringStopped recording session to replay, from session_record_list
speednumberReplay speed multiplier; 1 is the recorded pace, 2 is twice as fast (default 1)