Browse docs
Work with your own agent
Connect Codex or Claude Code to a deck, track progress, and follow the area being updated.
On this page
Keep working in Codex or Claude Code#
Open a project’s deck and select Agents in the left navigation. Choose your agent, copy the connection prompt, and paste it into the conversation you use for that repository. Continue giving instructions there. You do not need to create a web chat or wait for the hosted agent.
The prompt identifies the exact published review you are looking at. Your agent reads its flows and screens, connects its activity to the deck, and reports progress as it works. Connecting does not grant access to a repository: your local agent uses the checkout and permissions it already has.
Let your agent read your working context#
Use Share my focus to let your agent read the project, review, view, and selected screen or flow in this browser tab. The panel’s connection prompt links that tab to your conversation. As you navigate, its context updates without starting a web chat or repeatedly copying a new screen URL.
Ask your agent to call get_user_focus before responding to a new instruction. It reads your latest shared context through MCP; it does not watch your desktop, discover local terminal directories, or receive your keystrokes. The agent should check its own current directory and repository against the selected project before editing.
Sharing your focus and Follow agent work in opposite directions: sharing gives the agent context from your browser; following moves your browser to the agent’s reported work. Changing your selection supplies context, not a new task or permission to interrupt work.
If you prefer a fixed reference, turn off focus sharing and copy the project’s review prompt. It still identifies the exact project and published version.
Work with several agents and projects#
Open each work area in its own deck tab and copy that tab’s prompt into the corresponding agent conversation. Give each task a short name, such as “Checkout fixes” or “Docs update.” Each connection keeps its own activity and browser binding; agents can also share a tab when working on the same review.
The Agents list shows each task’s provider, status, latest update and tab link at once. Select a row to inspect its history and choose which agent your canvas follows. Selecting another agent stops Follow until you turn it on again. New updates do not reorder tasks or replace your selection. Use Connect another to add a conversation; disconnected work remains under Previous connections.
The tab link and your sharing choice survive normal reloads in supported browsers. A duplicated tab receives a separate link. If browser storage or tab coordination is unavailable, the panel explains that you need a new connection prompt after reloading.
An agent can call list_browser_contexts to discover the tabs you are sharing. If several active tabs match and no tab is linked, get_user_focus asks for a selection instead of guessing which task matters. A linked tab that is paused, closed, or stale does not silently redirect the agent to another project. Reconnect explicitly when you want to change its work area.
You can turn off sharing at any time. Hidden or disconnected tabs are marked inactive or stale; the last recorded position is not presented as fresh activity. Browser focus is temporary context, separate from the agent’s retained work history.
Recover a lost agent#
Select the saved task in Agents, open Restore this agent, and copy its restore prompt into the conversation that will continue the task. A disconnected task also has a Restore connection shortcut. Copying a recovery prompt does not change the running agents.
You can instead copy its terminal command. The command reads the saved context and prints a prompt for the agent:
mockspace agent restore --service https://mockspace.ynext.co --project my-app --session agent_saved-id
To find a task without the deck, run mockspace agent list --service https://mockspace.ynext.co --project my-app. These commands use your saved CLI login, MOCKSPACE_TOKEN, or --token; the local preview needs no account. If only your MCP client is signed in, use the copied restore prompt or sign in to the CLI with the same account.
The agent calls restore_agent with the project, saved ID and expected connection version. Mockspace restores the exact review, last reported work, components/files, activity history and original tab binding. It keeps the same agent entry; a late message from its previous connection cannot overwrite the recovery. Other agents continue independently. An expired browser link stays pinned and unavailable until you explicitly reconnect it; recovery never guesses another tab.
Recovery restores Mockspace context, not Codex/Claude chat transcripts, terminal processes or local files. It works while the service retains the agent record and you can access its saved review. Stopping the disposable local preview deletes its sample data; a production service keeps records in its data store.
Connect once#
If Mockspace is already available in your agent’s tools, use the copied prompt directly. Otherwise, expand the setup instructions in Agents and run the command for your client. The panel uses the address of the service you are viewing.
For the hosted service, register Codex and sign in through your browser:
codex mcp add mockspace --url https://mockspace.ynext.co/mcp
codex mcp login mockspace
For Claude Code:
claude mcp add --transport http --scope user mockspace https://mockspace.ynext.co/mcp
In Claude Code, open /mcp, select Mockspace, and complete browser sign-in. See the Claude Code MCP guide for client authentication. If a running client does not show the newly added tools, reopen that client, then paste the deck’s prompt.
Sign in with the same Mockspace account in the browser and agent. Credentials stay in the client’s credential storage; the copied review URL contains no token.
The repository’s preview:site command enables connections only from the same computer, without hosted sign-in. Its Agents panel supplies a mockspace-local setup command so it does not replace your hosted connection. Browser and agent clients share the local preview’s activity; stopping the disposable preview removes that activity. Other servers without sign-in must explicitly enable local access before they can accept agent connections.
Read the activity panel#
The panel shows your connections, the latest work summary, reported components and source files, and a history of progress and completion. Select a connection when you have more than one conversation working on the project.
Activity is reported by the agent through MCP. Mockspace does not inspect your terminal or watch local files. A component listed as updated is an agent report; a newly published review is the evidence of the rendered result.
The connection indicator reflects recent contact. After contact stops, the panel keeps the last update and work history without claiming that the agent is still running. Completed work remains available after disconnecting. Your activity is private to your signed-in account and only includes reviews you can access.
Follow the working area#
Open Agents, select the connected session you want to watch, and turn on Follow agent. Follow AI uses that selected session’s view and target. The agent can choose All screens, Changes, or Prototype (Live app), select a frame or flow, and fit a screen or flow. A reported build identifies the version that contains the work, so following can open a newly published draft. Updates from another session do not take over your view.
Changes is available when the draft has a visible comparison with detected changes. Prototype requires a running app configured for the project on the service. An agent cannot supply an arbitrary app URL to enable it.
Pan, zoom, choose another screen or flow, or change the view yourself to stop following. Selecting another agent also stops Follow. Turn Follow agent back on when you want to return. You can open a reported target once without following every update; an agent’s tool call does not turn Follow on for you.
Editing source files does not change an immutable published review. Ask the agent to capture and publish a new draft when you want to review the visual result; it should report that build with its progress. Existing publication permissions still apply.
For agents and integrations#
Use the authenticated hosted MCP connection. The prompt from the deck supplies its exact review URL.
- Call
set_mockspace_contextwith that URL, then read the workspace and relevant screens. - Call
connect_agentwithprovider: "codex"orprovider: "claude"and a short task label. Include the prompt’scontext_idwhen linking browser focus. Keep the returned session ID. - Call
report_agent_activitywith thatsession_id, a factualsummary, andstatus: "working". Include affectedcomponents, repository-relativefiles, and a canonicalframeorflowwhen known. Copy identifiers from the context tools rather than guessing. - Use
set_agent_viewto change only the view:viewisall,diff, orlive(prototypeis an alias forlive). Optionalfit: "screen"needs a frame;fit: "flow"needs a frame or flow. Supply a target or reuse the saved one. A mode-only update preserves the target and reported work progress. See the MCP example. - Report milestones as they happen. Use
waitingwhen you need input,errorwhen work cannot continue, anddoneafter reporting what was completed and verified. After publishing, include the newbuildand identifiers from that build. - Call
disconnect_agentwhen ending the connection. The work history remains available.
focus_frame and focus_flow also update the working area of a connected agent. Keep progress concise; send completed milestones, useful status changes, and updated components rather than token-by-token output.
View updates must name this conversation’s owned, currently connected session. MCP supplies its connection version; an old connection cannot steer a session restored elsewhere. REST integrations send the current connection_version with view updates. Choosing a view needs project view permission; reporting work needs request permission.
Before acting on a new instruction, call get_user_focus. Its result is read-only: use the returned review URL with set_mockspace_context when selecting that context for the task. If it points to a different project from your repository or current instruction, resolve that mismatch before editing. list_browser_contexts helps choose an explicit tab when more than one is available.
After selecting a context with set_mockspace_context, call connect_agent again with the same provider and browser context_id, then save the returned session ID. Selecting a different build closes the previous session, so subsequent activity must use the new ID. The browser-tab binding stays the same.
If the connection does not appear#
Check that the agent and browser use the same account and service. Confirm that the agent called connect_agent successfully for the review you are viewing. Copying a prompt alone does not connect an agent.
If tools are missing, complete the one-time MCP setup and reopen the client. If a review is unavailable, open a review your account can access and copy its prompt again. Use the panel’s retry action after a temporary connection failure.