WebMCP / navigator.modelContext

FanChat exposes 10 tools to any local browser agent.

Via navigator.modelContext

Any local browser agent with WebMCP support can discover and call FanChat tools directly without a remote server.

What is WebMCP?

A draft browser API for app-to-agent tool exposition.

WebMCP (Web Model Context Protocol) is a draft specification that defines how browser applications can expose tools to local AI agents running in the same browser. It is the browser-native equivalent of the Model Context Protocol (MCP) popularized by Anthropic for server-side tool exposition.

Instead of a remote MCP server, the application registers tools on navigator.modelContext. Any local agent that reads this object discovers all available tools and can call them directly, without any network hop.

FanChat is an early adopter. We expose all 10 tools below on every page as soon as the user is authenticated.

10 tools exposed

Navigation, reading and writing. Registered on navigator.modelContext.

search_charactersNavigation

Search public AI characters by name or description.

open_characterNavigation

Navigate to a character's chat page.

open_chat_sessionNavigation

Navigate to a specific chat session for a character.

list_my_charactersNavigation

List characters created by or shared with the current authenticated user.

get_current_characterReading

Get the AI character currently displayed on the page.

get_session_messagesReading

Read messages from a chat session belonging to the current authenticated user.

export_sessionReading

Export a chat session as JSON, Markdown or PDF. Returns a download URL.

send_messageWriting

Send a message to a character in an existing chat session and return the assistant response.

start_new_sessionWriting

Create a new chat session for a character. Returns the new sessionId.

create_characterWriting

Create a new AI character with a name and description. Returns the new characterId.

How to enable

WebMCP requires Chrome 146+ with the experimental flag enabled.

1

Install Chrome 146+

Download Chrome Canary or Chrome Dev from google.com/chrome.

2

Enable the WebMCP flag

Navigate to chrome://flags/#enable-experimental-web-platform-features and enable it.

3

Open FanChat

Sign in and navigate to any character. Tools are registered automatically.

4

Connect your agent

Point your local browser agent to navigator.modelContext. It will discover all 10 tools.

Code example

Call FanChat tools from your local browser agent.

browser-agent.js
// Example: list my characters and open the first one
const tools = await navigator.modelContext.getTools()
const listTool = tools.find(t => t.name === 'list_my_characters')
const result = await listTool.call({ limit: 5 })

const first = result.data[0]
const openTool = tools.find(t => t.name === 'open_character')
await openTool.call({ characterId: first.id })

Ready to connect your agent?

Start chatting with AI characters and let your local agent interact with FanChat.