Skip to content

Conversation

@ctufts
Copy link
Contributor

@ctufts ctufts commented Dec 1, 2025

Description

  • Add HTTP server with StreamableHTTP transport for ChatGPT Apps integration
  • Introduce interactive map widgets that render search results, routes, and isochrones visually in ChatGPT
  • Enable widget support across multiple Mapbox tools

Changes

New HTTP Server (src/http-server.ts)

  • StreamableHTTP transport for ChatGPT Apps compatibility
  • Serves on http://localhost:3000/mcp

Widget System

  • New WidgetTemplatesResource serves widget HTML with text/html+skybridge MIME type
  • Widget config added to BaseTool for _meta[openai/outputTemplate] in tool descriptors
  • React-based map widget (widgets/) with Mapbox GL JS, built to self-contained HTML with inlined JS/CSS

Widget-Enabled Tools

  • category_search_tool - Place search by category
  • search_and_geocode_tool - Location search/geocoding
  • directions_tool - Route visualization
  • isochrone_tool - Reachable area polygons

Documentation

  • Comprehensive setup guide (docs/chatgpt-integration.md) covering widget builds, tokens, ngrok setup, and example prompts

Testing

Screenshot 2025-12-01 at 3 01 14 PM Screenshot 2025-12-01 at 3 01 26 PM

Local Test Plan

  • Set environment variables: export MAPBOX_ACCESS_TOKEN=pk.xxx and export ENABLE_CHATGPT_WIDGETS=true
  • Build widgets: cd widgets && npm install && npm run build
  • Start HTTP server: npm run dev:http
  • Test via ngrok + ChatGPT App with sample prompts
  • Verify map widget renders for each enabled tool

Checklist

  • Code has been tested locally
  • Unit tests have been added or updated
  • Documentation has been updated if needed

Additional Notes

   - Add WidgetTemplatesResource to serve widget HTML with text/html+skybridge MIME type
   - Add widget config to BaseTool for _meta[openai/outputTemplate] in tool descriptors
   - Enable widget support in CategorySearchTool
   - Add widgets/ React project with map-widget for rendering search results
   - Widget build outputs self-contained HTML with inlined JS/CSS
@ctufts ctufts closed this Dec 17, 2025
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