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 over a private connection that only OpenTraffic's own signed tools can use. Like the opentraffic command, it's part of the app: it needs no token, works with the local API off, and doesn't ask before sharing. If OpenTraffic isn't running, the bridge starts it in the background. Environment:

VariableDefault
OPENTRAFFIC_CLIENTMCP clientThe name OpenTraffic shows for the app (on replies and in the activity log).

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). Each says whether it's open, working (and who's on it), resolved, or confirmed, and carries context (selector, styles, component, source file), suggested edits to apply as given, and area for a comment on a region.
claim_comment, release_commentSay you're working on a comment (with optional progress), or stop. The session sees the app at the element; other apps' claims are refused. A claim lapses after 15 minutes unless claimed again.
resolve_comment, reply_to_commentReplies and fixes show the app's name; the commenter is told it's fixed and can confirm or reopen it.
get_screenshotThe pinned element, as an image; which: after for the picture of it once fixed.
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)
claim_commentshare, comment_idprogress (at most 120 characters)
release_commentshare, comment_idNone
reply_to_commentshare, comment_id, textNone
get_screenshotshare, comment_idwhich (before or after; default before)
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. While an app is in it (and for 90 seconds after), OpenTraffic counts the share as watched, and leaves new comments to that app instead of starting the agent command. 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.