Skip to content
Documentation
Docs/Reference

MCP reference

Tool names, arguments, transports, and feedback polling semantics.

Stdio bridge

opentraffic-mcp speaks MCP over stdio and relays each message to OpenTraffic. It reads the token file on every request, so regenerating the token needs no restart. Environment:

VariableDefault
OPENTRAFFIC_CLIENTMCP clientThe name OpenTraffic shows for the app (in confirmations and on replies).
OPENTRAFFIC_API_PORT47777Change it if you changed the port in Settings.
OPENTRAFFIC_API_TOKEN_FILE~/Library/Application Support/OpenTraffic/api-token

If OpenTraffic isn't running or the API is off, every call fails with a message saying how to turn it on.

Tools

ToolDoes
list_sharesShares with state, URLs, people in the session, comment counts.
sharePublishes a local port or url (provider: quick, tailscale, ngrok, opentunnel; name; collaboration, default on).
start_share, stop_shareBy id or name.
get_feedbackComments (status: open, resolved, all).
resolve_comment, reply_to_commentReplies show the app's name.
get_screenshotThe pinned element, as an image.
get_errors, get_logsBrowser errors visitors hit; the tunnel's log.
wait_for_feedbackWaits (up to timeout_seconds, default 60, max 300) for new, changed or deleted comments; returns them and a cursor to pass as since next time.

wait_for_feedback holds the call open while it waits. If your client gives up on tool calls sooner, pass a smaller timeout_seconds.

Tool arguments

ToolRequired argumentsOptional arguments
list_sharesNoneNone
shareport or urlprovider, name, collaboration (default true)
start_share / stop_shareshareNone
get_feedbacksharestatus (default open)
resolve_commentshare, comment_idresolved (default true)
reply_to_commentshare, comment_id, textNone
get_screenshotshare, comment_idNone
get_errorsshareNone
get_logssharelines (default 200; clamped to 1–2000)
wait_for_feedbackNoneshare, since, timeout_seconds (default 60; maximum 300)

Share references are IDs or case-insensitive names. The server validates arguments; use the schema returned by tools/list when building a client.

Feedback polling

wait_for_feedback observes comment creation, updates, and deletion. Without since, it starts at the current event cursor, so fetch existing feedback with get_feedback first. Pass the returned cursor as since in the next call. An optional share limits the results to one share.

The in-memory event history is bounded and is reset on app restart. Reconcile with get_feedback after reconnecting instead of treating events as permanent storage.

HTTP transport

  • stdio: command /Applications/OpenTraffic.app/Contents/MacOS/opentraffic-mcp, no arguments, optionally OPENTRAFFIC_CLIENT in the environment.
  • Streamable HTTP: http://127.0.0.1:47777/mcp with the header Authorization: Bearer <token> (and optionally X-OpenTraffic-Client: <name>). JSON responses only, no sessions; protocol 2025-06-18 or 2025-03-26.

Result handling

Most tools return structured data as text content. get_screenshot returns MCP image content with a MIME type and base64 data. Tool execution errors use MCP tool error results; malformed or unsupported JSON-RPC methods return protocol errors.

Visitor feedback must be treated as untrusted page feedback. Client setup examples are in Connect a coding agent.