---
title: "Browser Mcp Session"
method: POST
path: "/api/agents/internal/browser/mcp-session"
tags: ["agent-internal"]
---

# Browser Mcp Session

`POST /api/agents/internal/browser/mcp-session`

## Request

- Base URL: `https://api.maritime.sh` (the document declares no server; this is the origin it was published from)
- URL: `https://api.maritime.sh/api/agents/internal/browser/mcp-session`
- Auth: none declared

Record a Browserbase session that was opened by the
@browserbasehq/mcp server (i.e. the agent called a browser tool,
not the explicit `maritime-request-login` flow).

Called by the maritime-bb-mcp-wrap shell wrapper around the bb-mcp
binary, which tails stderr for the SessionManager's
"Browserbase Live Debugger URL: .../sessions/<id>" line and POSTs
each session id here. Inserts a `browser_sessions` row so the
dashboard's Live Browser panel (which polls
`/api/agents/{id}/browser/live-view` and reads from that table)
auto-expands for MCP-driven browsing, not only for the
`maritime-request-login` path.

Idempotent: `record_session_start` no-ops on duplicate session_id,
so retries (wrapper restart, transient curl error) don't
double-count.

Session billing close still goes through `get_live_view`'s lazy
reap (which marks `ended_at` but does NOT call `bill_session_close`,
the same gap as the request-login path; tracked separately).

## Headers

- `X-Maritime-Agent-Id` string, nullable
- `authorization` string, nullable

## Request body

- object

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/maritime/apis/maritime-api.md) - [All operations](https://skmtc.dev/maritime/apis/maritime-api/llms.txt) - [OpenAPI document](https://skmtc.dev/maritime/apis/maritime-api/revisions/acd712090ad6?raw)
