MCP-FE
What is MCP-FE?
MCP-FE is an architectural pattern and reference implementation that allows AI agents to reason about real user interface state by exposing frontend context via Model Context Protocol (MCP).
Instead of relying solely on backend data or analytics-style event streams, MCP-FE makes the browser an active, queryable context provider.
Why does this exist?
Modern AI agents often lack visibility into what the user is actually seeing or doing in the frontend.
Common approaches fall short:
- Analytics events are delayed and lossy
- Polling frontend state is inefficient
- Backend-only MCP servers cannot observe UI state
MCP-FE solves this by enabling on-demand, session-scoped access to frontend context.
High-Level Architecture
MCP-FE introduces a frontend edge layer that participates in the MCP ecosystem.
The backend MCP server acts as a session-aware router and proxy, while the frontend edge exposes real-time UI context when requested.
Key Concepts
- Frontend MCP Edge — runs in a Shared/Service Worker and observes UI state
- Session-scoped context — each browser session is isolated
- On-demand querying — no continuous event streaming
Current Status
MCP-FE is currently published as an open-source reference implementation. The focus is on:
- Validating the architecture
- Defining a clean MCP request envelope
- Exploring session routing strategies