# Evidence-Bounded GEO Workbench for WebMCP An open-source, local-demo Labs application that lets a human and an in-browser agent inspect the same bounded GEO assessment evidence without granting the agent authority to run providers, spend credits, or change the immutable baseline. Live demo: Video demo: ## The problem Evidence-heavy GEO work is difficult to review from a chat summary alone: a recommendation needs to remain tied to reviewed observations, the human needs to see the same filtered records as the agent, and consequential work must remain under human control. This demo makes that collaboration explicit. WebMCP exposes narrow, typed browser tools over the same local `GeoDemoService` and repository operations used by the visible application. WebMCP is useful here because an agent can retrieve bounded context, inspect retained evidence, create a deterministic local follow-up draft, and prepare a quote while the human sees the corresponding view, filter, highlight, or draft immediately. It is not a route to hidden data or autonomous execution. ## Human + agent collaboration ```mermaid flowchart LR H[Human reviewer] <--> UI[Visible React workspace] A[Browser agent] --> MC[document.modelContext] MC --> T[Eight direct WebMCP tools] T --> S[GeoDemoService] UI <--> S S --> R[DemoRepository] R --> F[Sanitised immutable fixture] S --> L[Local demo state] ``` The browser UI and the tools share local demo state. For example, an evidence search with `showInUi: true` opens Evidence and highlights the returned records; an opportunity request can open Opportunities; a follow-up edit opens and highlights the changed draft question. The agent cannot: - call a live provider, production API, production database, or remote MCP service; - access social evidence, raw source answers, credentials, or private inputs; - edit the immutable completed 22-question baseline; - confirm, load, or execute a run; - settle billing or credits; or - claim an overall GEO score, citation provenance that was not retained, ranking control, causality, or commercial attribution. The visible **Load demo execution** control remains human-only. It loads clearly labelled pre-captured demo evidence; it does not execute a live run. ## WebMCP tools The direct registrations are intentionally easy to review in [src/webmcp/registerGeoTools.ts](src/webmcp/registerGeoTools.ts). | Tool | Purpose | | --- | --- | | `geo_project_context` | Returns concise generic project and coverage context. | | `geo_assessment_summary` | Returns retained AI-evidence patterns, counts, and a claims-safe limitation. | | `geo_question_plan` | Returns the immutable completed baseline, with bounded decision-area, type, and limit filters. | | `geo_search_evidence` | Searches retained evidence and can synchronise the visible Evidence view. | | `geo_opportunities` | Returns only retained evidence-supported opportunities and can highlight one in the UI. | | `geo_create_followup` | Creates a deterministic local draft with 5–20 questions; it never calls an LLM. | | `geo_update_question` | Edits a local follow-up draft question only and highlights it. | | `geo_prepare_run` | Calculates a hypothetical local quote only; it requires human confirmation and cannot execute. | The implementation uses the browser API directly: ```ts document.modelContext.registerTool({ name: 'geo_project_context', description: 'Return concise generic project context.', inputSchema: { type: 'object', additionalProperties: false, properties: {} }, execute: async () => getService().projectContext(), }) ``` ## Demo data and isolation This repository is independent of the separate production ChinaMarketing.AI repository. It contains a sanitised, immutable demonstration fixture and local browser state only. The fixture is built from a private-source workflow that is protected by `.gitignore`; `private-input/` and `private-output/` are intentionally excluded from Git and deployment. Provider execution in this demo is pre-captured, not live. No provider-returned citations were retained for this particular source assessment, and the application never fabricates citations. Social findings are excluded. The retained records are illustrative bounded evidence, not a claim about live rankings, causality, visibility guarantees, or commercial attribution. ## Development Requirements: Node.js 20+ and npm. ```bash npm install npm run dev ``` Useful checks: ```bash npx tsc -b npm run lint npm test npm run fixture:build npm run build git diff --check ``` ## Deployment The app is deployed as a Cloudflare Worker through Wrangler. Authenticate with an account authorised for this demo Worker, then run: ```bash npm run deploy ``` The production-like demo response deliberately includes `noindex,nofollow`; it is a Labs demonstration, not a searchable assessment product. ## WebMCP testing Use a Chrome build that exposes `document.modelContext`, open the live demo, and inspect tools from the page's main world. Confirm there are exactly eight unique names before invoking them. Recommended smoke sequence: 1. Call `geo_project_context`, `geo_assessment_summary`, and a bounded `geo_question_plan` query. 2. Call `geo_search_evidence` with `alternativePresent: true`, `subjectSurfaced: false`, and `showInUi: true`; the visible IDs must match the returned IDs. 3. Call `geo_search_evidence` with `verificationRequired: true` and `showInUi: true`; again compare visible and returned records. 4. Call `geo_opportunities` with `showInUi: true`, create a 10-question follow-up, update a draft question, and prepare a Search Enhanced quote using all five engines. The result must be `10 × 5 × 1.5 = 75 GEO Credits` with `demoOnly: true` and `requiresHumanConfirmation: true`. 5. Verify no tool exists to confirm, load, or execute a run. Use the visible human-only **Load demo execution** button to see the pre-captured-evidence label, then reset with `?reset=1`. The workspace also remains usable as a normal human-facing application when WebMCP is unavailable: the status simply reports it as unavailable and the visible tabs, evidence filtering, follow-up controls, and reset flow remain local UI operations.