WebMCP in the Frontend: Direct Agent Control for Data Tables

X postCodeHagenDemo

Developer CodeHagen demonstrated an open-source table integrating WebMCP to provide tools directly to an AI agent. The agent manipulates real UI state instead of relying on screenshots or simulated mouse clicks.

Key points

  1. WebMCP equips the AI agent with frontend tools directly, avoiding screenshot analysis or simulated clicking.
  2. The tool get_table_state inspects columns, active filters, and currently visible table rows.
  3. Tools set_filters and set_sort apply state updates directly to the underlying user interface.
  4. Additional functions include clear_filters_and_sort for state resets and add_row for appending data.
  5. A natural language prompt like 'Show only companies in Oslo, sorted by revenue' triggers direct UI filtering and sorting.

Why it matters

Exposing native tools directly tied to UI state makes web agents faster and far more deterministic than screen-scraping or visual computer-use methods.

Analysis

AI agents operating inside web interfaces typically rely on computer-use pipelines: capturing screenshots, inferring layout structure, and issuing synthetic mouse or keyboard events. While flexible, this approach tends to be brittle, slow, and resource-heavy.

CodeHagen demonstrates a more deterministic approach by integrating WebMCP into an open-source table component built with uisdk. Rather than forcing the agent to interpret pixels, the web page exposes structured tools directly into the agent's context:

  • get_table_state: Reads active columns, applied filters, and visible rows.
  • set_filters and set_sort: Directly mutates the table's active state.
  • clear_filters_and_sort and add_row: Provides clean control over state resets and record creation.

Because the agent interacts with the exact state powering the UI, ambiguity is reduced. Changes are immediately reflected in the visual controls, allowing users to inspect or refine the filters manually. This paradigm highlights how modern web applications can expose structured APIs directly to in-browser agents for reliable, bidirectional interaction.

Original post

CodeHagen

@CodeHagen · 3 December 2026

Yesterday I wrote about building with @uisdk. Today I pushed it further. I added WebMCP to my open source Table. The page hands the agent its own tools, so it doesn't click around or read screenshots. I typed "Show only companies in Oslo, sorted by revenue". The table filtered, t.co/7LLsRL4SUz

130 likes8 replies161 bookmarks6.1k views

View on X
Selected replies (5)
  • @amilkoff @CodeHagen @uisdk ok now I want to add WebMCP to all my apps tonight
  • @kostyniuk00 @CodeHagen @uisdk beautiful 😻
  • @dezign_ash @CodeHagen @uisdk Having the agent and UI use the same state makes so much sense. Does undo work for agent changes too? I'd want that before letting it add rows.
  • @kleytonsolinho @CodeHagen @uisdk I like that the result is visible in the table itself. For a request like “companies in Oslo,” being able to see the filters and adjust them feels like a natural way to work together.
  • @sharpeshooter87 @CodeHagen @uisdk This is very cool

Summary generated by AI (Gemini 3.8 Flash, 4 December 2026). It may contain errors – the original source is authoritative.

Similar in content, found by the AI search.

  • X post:shadcn

    shadcn Previews Agent-First UI SDK for Component Architectures

    shadcn highlighted a video by orcdev discussing the upcoming UI SDK built with an agent-first approach. With AI agents becoming both creators and users of interfaces, the project re-evaluates how core component abstractions should be designed.

    353bookmarks26.3kviews

    AI & LLMs· Announcement

  • X post:Viktor Oddy

    MotionSites AI MCP: Supplying AI Agents with Curated UI Prompts and Designs

    Viktor Oddy has introduced an MCP (Model Context Protocol) server for MotionSites, allowing AI agents to access curated website designs, animated backgrounds, UI sections, and design prompts to improve the quality of AI-generated frontend code.

    2.6kbookmarks99.3kviews

    AI & LLMs· Tool

  • X post:Tobi

    AI Design Agent Powered by MCP and Fable 5.2

    A post presents an AI design agent connecting a custom design library to Fable 5.2 via MCP. According to the author, the agent creates high-converting designs that outperform most human designers. The setup is shared within a community and receives daily design updates to refine the agent's capabilities.

    4.9kbookmarks149.6kviews

    AI & LLMs· Announcement

  • Repository:alibaba/page-agent

    Page Agent: In-Page GUI Agent for Controlling Web Interfaces via Natural Language

    Alibaba's Page Agent is a TypeScript library that enables natural-language control of web pages directly inside the browser. Loaded as a single JavaScript script, it executes actions through text-based DOM manipulation without requiring headless browsers, Python backends, or screenshots.

    29kstarsTypeScript

    AI & LLMs· Tool

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.