Skip to content

Spike: open Mapbox Maps next to a chat and let the model draw on it - #333

Draft
zmofei wants to merge 9 commits into
feat/chatgpt-sidebar-appfrom
feat/chatgpt-thread-entrypoint
Draft

zmofei wants to merge 9 commits into
feat/chatgpt-sidebar-appfrom
feat/chatgpt-thread-entrypoint

Conversation

@zmofei

@zmofei zmofei commented Nov 11, 2026

Copy link
Copy Markdown
Member

Stacked on #316. Adds the thread entrypoint from the OpenAI MCP Extensions spec, so the map can stay open next to a conversation.

  • Thread entrypoint: map_explorer_tool registers { type: "thread" }. Users open Mapbox Maps as a tab in a chat from "+" → "More tools".
  • Map to chat: while the explorer is open it shares its view (center, zoom, bounds) as background context through ui/update-model-context, and the selected place as a titled item in the composer. A place the user removes isn't attached again until they select another.
  • Chat to map (WebMCP): the map app registers read_map, search_map, add_places and move_map on document.modelContext, so "show coffee bars on it" draws on the open map instead of opening a second one. This also works for a render_map_tool map expanded into a tab.
  • The server instructions and the render_map_tool description point the model at these tools when a map is already open.

Verified in ChatGPT Desktop 26.1106.51428 with a local dev server:

  • Mapbox Maps opens from the thread tab bar.
  • The model answers "what area am I looking at?" from the shared view, with no tool call.
  • In Codex, the model calls read_map, and "show some coffee bars on it", "mark Helsinki Cathedral on it" and "move the map to Tampere" all change the open map.

Not verified: the selected-place item in the composer, and whether the routing text is needed for the model to pick the WebMCP tools.

Known limit: in an Instant chat the model is not offered the WebMCP tools, so a follow-up still opens a new inline map there. Routes and isochrones can't be drawn on an open map yet.

map_explorer_tool registers a thread entrypoint. While open, the map
shares its view (background context) and the selected place (a titled,
removable item) through ui/update-model-context.
The map app registers read_map, search_map, add_places and move_map on
document.modelContext, so a follow-up request updates the map the user
has open instead of opening another one. The explorer's view now goes
to the model as structuredContent.
@zmofei
zmofei force-pushed the feat/chatgpt-sidebar-app branch from e963e07 to 9c9b9d5 Compare November 11, 2026 10:58
…n next to the chat

render_map_tool is now the thread entrypoint: called with {} it opens the
explorer, and map_explorer_tool is gone. In ChatGPT a map the model draws
opens as a tab beside the chat, shares its view, and tells the model to
use its own WebMCP tools for follow-ups instead of opening another map.
The map app registers redraw_map, which takes render_map_tool's arguments,
has the server render them and draws the result in place, so routes,
isochrones and layers reach the open map too. Every data tool's render
hint now points at it when a map is open.
Pins from add_places or a hand-composed marker have no card, so nothing
marked them selected and the model was told no place was selected.
In ChatGPT the model kept calling render_map_tool for follow-ups, opening
a new map tab each time, until it had called one of the map's WebMCP
tools once. The result of a render_map_tool call that opens a map now
asks it to call read_map on the open map first, if that tool is offered.

Tested in ChatGPT Desktop (Codex): after the first map, the hotels and
the isochrone follow-ups were drawn through redraw_map on the same map.
A click on a point of interest of the Standard base map (the poi
featureset) selects it like a pin: it is shared with the model as a
titled place, with its name, category and coordinates, and marked with
the base map's select state. The base map gives no mapbox_id for it.

Checked in a browser with the map page and a stub host: clicking the
Aleksis Kivi statue sent "Aleksis Kiven muistopatsas, monument" with its
coordinates as the selected place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant