Charlotte

io.github.TickTockBent由 GitHub 帳號 TickTockBent 發布v0.1.3更新於 Oct 24, 2026

Renders web pages into structured, agent-readable representations using headless Chromium.

概覽

AI 產生的概覽

Charlotte 是本地 MCP 伺服器,透過無頭 Chromium 讓 AI 助理取得精簡、結構化、節省 token 的網頁檢視。

可以做什麼
瀏覽網頁並管理上一頁、下一頁、分頁與視窗尺寸,抵達頁面時回傳精簡的頁面概覽。以三種詳細程度觀察頁面,依文字、類型或 CSS 選擇器尋找元素,並截圖、列出與刪除截圖。與頁面互動:點擊、輸入、選取、切換、送出、捲動、懸停、拖曳、按鍵、等待條件、上傳檔案、批次填表與處理對話框。監控主控台輸出與 HTTP 請求紀錄,管理 Cookie、請求標頭、網路限速與 URL 封鎖。啟動本機靜態伺服器並監看檔案變更,注入 CSS 或 JS,稽核無障礙、效能、SEO、對比度與失效連結。在頁面環境中執行任意 JavaScript,並對頁面結構做差異比較。
適用情境
適合助理需要閱讀或操作真實網站、同時控制上下文開銷的情境,尤其是內容繁多的頁面,完整無障礙樹快照代價很高。也適合本機前端開發:啟動網站、注入樣式並執行無障礙或 SEO 稽核。
執行需求
本機程序,需要 Node.js 20 或更新版本與 npm,或使用 Docker。可從 npm 套件安裝或以 npx 執行,透過 stdio 通訊。未宣告帳號、API 金鑰或環境變數。Chromium 以無頭模式執行;沙箱預設開啟,在核心沙箱不可用的環境(如容器)中需明確關閉。
安裝前請注意
此伺服器操控真實瀏覽器:可點擊、送出表單、上傳檔案、設定 Cookie 與請求標頭,並在頁面環境執行任意 JavaScript,因此對線上網站的操作可能修改或傳送資料。造訪的頁面由本機瀏覽器請求,會向其暴露你的網路位址。關閉 Chromium 沙箱會失去針對不可信頁面的重要防護。可選的遠端 HTTP 模式會公開連接器 URL 與操作員權杖,重新啟動後會輪換。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Charlotte,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Charlotte

The Web, Readable.

Your AI agent burns ~50,000 characters of accessibility tree just to look at the Hacker News front page. Charlotte does it in 364.

Charlotte is an MCP server that gives AI agents structured, token-efficient access to the web. Instead of dumping the full accessibility tree on every call, Charlotte returns only what the agent needs: a compact page summary on arrival, targeted queries for specific elements, and full detail only when explicitly requested. On content-heavy pages that orientation is up to ~140x smaller than a full accessibility-tree snapshot from Playwright MCP; on trivially small pages the two are roughly the same size.

Why Charlotte?

Most browser MCP servers dump the entire accessibility tree on every call — a flat text blob that can exceed a million characters on content-heavy pages. Agents pay for all of it whether they need it or not.

Charlotte decomposes each page into a typed, structured representation — landmarks, headings, interactive elements, forms, content summaries — and lets agents control how much they receive with three detail levels. When an agent navigates to a new page, it gets a compact orientation (364 characters for Hacker News) instead of the full element dump (~50,000 characters). When it needs specifics, it asks for them.

Benchmarks

Measured on Charlotte v0.8.0 against Playwright MCP v0.0.79, by characters returned per tool call on real websites (npx tsx benchmarks/run-benchmarks.ts --suite comparison), 2026-08-08. This section is a summary — the canonical benchmarks page (including per-task cost and release drift) is charlotte.mintlify.site/benchmarks; methodology, instruments, and raw results: benchmarks/.

Orientation cost (what an agent pays to "see" a page on arrival):

A Charlotte navigate returns a usable orientation by default — landmarks, headings, and interactive element counts grouped by page region. To get the equivalent with Playwright MCP, an agent calls browser_snapshot, which returns the full accessibility tree. (Playwright's browser_navigate alone returns only a short confirmation, not the page content, so it isn't a like-for-like comparison.)

SiteCharlotte navigatePlaywright browser_snapshotSmaller by
example.com4154651.1x
httpbin form6191,8473.0x
GitHub repo3,77838,98310x
Wikipedia (AI article)22,1341,137,92851x
Hacker News36450,706139x

The advantage scales with page complexity: on content-heavy pages the structured orientation is ~10–140x smaller than the full snapshot, while on a trivially small page like example.com the two are within ~20% of each other (and on a page that small, the structured representation can be the larger of the two — there is simply nothing to summarize away). Charlotte's value shows up precisely where Playwright's flat dump hurts most. When an agent needs more than the orientation, it calls observe or find for exactly the part it wants instead of paying for the whole tree up front.

Tool definition overhead (invisible cost per API call):

ProfileToolsDef. tokens/callSavings vs full
full438,500—
browse (default)234,372~49%
core72,186~75%

Tool definitions are sent on every API round-trip. With the default browse profile, Charlotte carries ~49% less definition overhead than loading all 43 tools; the minimal core profile cuts it by ~75%. See the profile benchmark report for full results.

The workflow difference: A Playwright agent that reads the full snapshot receives ~50,000 characters every time it looks at Hacker News, whether it's reading headlines or hunting for a login button. A Charlotte agent gets 364 characters on arrival, calls find({ type: "link", text: "login" }) to get exactly what it needs, and never pays for the rest.

How It Works

Charlotte maintains a persistent headless Chromium session and acts as a translation layer between the visual web and the agent's text-native reasoning. Every page is decomposed into a structured representation:

┌─────────────┐     MCP Protocol     ┌──────────────────┐│   AI Agent  │<────────────────────>│    Charlotte     │└─────────────┘                      │                  │                                     │  ┌────────────┐  │                                     │  │  Renderer  │  │                                     │  │  Pipeline  │  │                                     │  └─────┬──────┘  │                                     │        │         │                                     │  ┌─────▼──────┐  │                                     │  │  Headless  │  │                                     │  │  Chromium  │  │                                     │  └────────────┘  │                                     └──────────────────┘

Agents receive landmarks, headings, interactive elements with typed metadata, bounding boxes, form structures, and content summaries — all derived from what the browser already knows about every page.

Features

Navigation — navigate, back, forward, reload

Observation — observe (3 detail levels, structural tree view), find (spatial + semantic search, CSS selector mode, output_file for large result sets), screenshot (with persistent artifact management), screenshots, screenshot_get, screenshot_delete, diff (structural comparison against snapshots)

Interaction (iframe-aware) — click, click_at (coordinate-based), type (with slow typing support), select, toggle, submit, scroll, hover, drag, key (single/sequence with element targeting), wait_for (async condition polling), upload (file input), fill_form (batch form fill), dialog (accept/dismiss JS dialogs)

Monitoring — console (all severity levels, filtering, timestamps), requests (full HTTP history, method/status/resource type filtering)

Session Management — tabs, tab_open, tab_switch, tab_close, viewport (generic presets or named devices such as "iPhone 15" with DPR, touch, and user agent emulation), network (throttling, URL blocking), set_cookies, get_cookies, clear_cookies, set_headers, configure

Development Mode — dev_serve (static server + file watching with auto-reload), dev_inject (CSS/JS injection), dev_audit (a11y, performance, SEO, contrast, broken links)

Utilities — evaluate (arbitrary JS execution in page context)

Tool Profiles

Charlotte ships 43 tools (42 registered + the charlotte_tools meta-tool), but most workflows only need a subset. Startup profiles control which tools load into the agent's context, reducing definition overhead by up to ~75%.

bash
charlotte --profile browse    # 23 tools (default) — navigate, observe, interact, tabscharlotte --profile core      # 7 tools — navigate, observe, find, click, type, submitcharlotte --profile full      # 43 tools — everythingcharlotte --profile interact  # 31 tools — full interaction + dialog + evaluatecharlotte --profile develop   # 34 tools — interact + dev_serve, dev_inject, dev_auditcharlotte --profile audit     # 14 tools — navigation + observation + dev_audit + viewport

Agents can activate more tools mid-session without restarting:

charlotte_tools enable dev_mode    → activates dev_serve, dev_audit, dev_injectcharlotte_tools disable dev_mode   → deactivates themcharlotte_tools list               → see what's loaded

Self-Hosting (Charlotte Remote)

Run Charlotte as a remote MCP server and connect it to claude.ai — one command:

bash
docker run --cap-add SYS_ADMIN --shm-size 2g -p 3737:3737 ghcr.io/ticktockbent/charlotte

It prints a public connector URL and an operator token. In claude.ai: Settings → Connectors → Add custom connector — paste the URL, leave the OAuth Client ID/Secret fields blank, and enter the token on Charlotte's consent page when it appears. That's it; you're browsing.

The demo URL and token are ephemeral (both rotate on restart). Running it for real — stable domain, your own tunnel or reverse proxy, docker compose: Self-Hosting. Trust model and network guards: Security. Container and sandbox internals: Docker.

Quick Start

Prerequisites

  • Node.js >= 20
  • npm

Installation

Charlotte is listed on the MCP Registry as io.github.TickTockBent/charlotte and published on npm as @ticktockbent/charlotte:

bash
npm install -g @ticktockbent/charlotte

Docker images are available on Docker Hub and GitHub Container Registry:

bash
# Alpine (default, smaller)docker pull ticktockbent/charlotte:alpine
# Debian (if you need glibc compatibility)docker pull ticktockbent/charlotte:debian
# Or from GHCRdocker pull ghcr.io/ticktockbent/charlotte:latest

Or install from source:

bash
git clone https://github.com/ticktockbent/charlotte.gitcd charlottenpm installnpm run build

Run

Charlotte communicates over stdio using the MCP protocol:

bash
# If installed globally (default browse profile)charlotte
# With a specific profilecharlotte --profile core
# If installed from sourcenpm start

MCP Client Configuration

Claude Code

Create .mcp.json in your project root:

json
{  "mcpServers": {    "charlotte": {      "type": "stdio",      "command": "npx",      "args": ["@ticktockbent/charlotte"],      "env": {}    }  }}
Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "charlotte": {      "command": "npx",      "args": ["@ticktockbent/charlotte"]    }  }}
Cursor

Add to .cursor/mcp.json:

json
{  "mcpServers": {    "charlotte": {      "command": "npx",      "args": ["@ticktockbent/charlotte"]    }  }}
Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "charlotte": {      "command": "npx",      "args": ["@ticktockbent/charlotte"]    }  }}
VS Code (Copilot)

Add to .vscode/mcp.json:

json
{  "servers": {    "charlotte": {      "type": "stdio",      "command": "npx",      "args": ["@ticktockbent/charlotte"]    }  }}
Cline

Add to Cline MCP settings (via the Cline sidebar > MCP Servers > Configure):

json
{  "mcpServers": {    "charlotte": {      "command": "npx",      "args": ["@ticktockbent/charlotte"]    }  }}
Amp

Add to ~/.amp/settings.json:

json
{  "mcpServers": {    "charlotte": {      "command": "npx",      "args": ["@ticktockbent/charlotte"]    }  }}

See docs-internal/mcp-setup.md for the full setup guide, including development mode, generic MCP clients, verification steps, and troubleshooting.

Configuration

Charlotte resolves settings from four sources, highest precedence first: CLI arguments → environment variables → config file → built-in defaults. See docs/configuration.md for the complete reference.

Config file

Pass a JSON config file with --config, or drop a charlotte.config.json in the working directory and Charlotte loads it automatically:

bash
charlotte --config charlotte.config.json
json
{  "browser": { "headless": true, "noSandbox": false },  "tools": { "profile": "browse" },  "rendering": { "includeIframes": false, "iframeDepth": 3 },  "output": { "dir": "./charlotte-output" },  "limits": {    "maxInteractiveElements": 2000,    "maxFullContentChars": 200000,    "maxResponseBytes": 1000000,    "maxEvaluateBytes": 256000  }}

Every section is optional; an empty {} is valid. The file is validated with zod — unknown keys, wrong types, or invalid enum values produce a clear startup error on stderr and Charlotte exits non-zero. Four settings also have environment variables: CHARLOTTE_NO_SANDBOX, CHARLOTTE_OUTPUT_DIR, CHARLOTTE_CDP_ENDPOINT, and CHARLOTTE_INIT_SCRIPT. Scripts that should run on every new document before page JS go in browser.initScripts or --init-script <path> (repeatable); see Init scripts.

The Chromium sandbox is on by default

v0.7.0 behavior change: Earlier releases baked --no-sandbox into every Chromium launch. As of v0.7.0 the Chromium sandbox is enabled by default — the primary defense between an untrusted page and the account Charlotte runs as. You must opt out explicitly where the kernel sandbox is unavailable.

bash
charlotte --no-sandbox                  # CLI flagCHARLOTTE_NO_SANDBOX=1 charlotte        # environment variable# or "browser": { "noSandbox": true }   in the config file

Migration note (Docker / bare-metal): Containers usually cannot set up the kernel sandbox, so the provided Dockerfiles set CHARLOTTE_NO_SANDBOX=1 for you, and docker-compose.yml now keeps Docker's default seccomp filter (it no longer runs seccomp=unconfined). If you run Charlotte bare-metal as root, Chromium refuses to launch with the sandbox enabled — run as a non-root user (recommended) or pass --no-sandbox. Existing setups that previously relied on the implicit --no-sandbox and run in an environment where the sandbox can't initialize must now set CHARLOTTE_NO_SANDBOX=1 (or the flag/config equivalent) to keep working.

Running Charlotte Remote (HTTP mode) over the network raises additional trust-boundary and network-guard questions beyond the sandbox — see Security.

Output-size limits

The limits.* keys bound how much a single tool response can return so a pathological page (100k links, an infinite-scroll feed, a giant document body) cannot overflow the agent's context window. When a page response exceeds maxResponseBytes it degrades to a compact summary and suggests writing the full result to disk via output_file; charlotte_evaluate results are capped independently by maxEvaluateBytes. Truncated responses carry a truncation marker. See docs/configuration.md for the keys and defaults.

Crash recovery

A Chromium crash no longer wedges the server. The next tool call automatically relaunches the browser, clears the dead tab and CDP-session caches, and opens a fresh blank tab — so an agent can keep working after a renderer crash without restarting the MCP server.

Usage Examples

Once connected, an agent can use Charlotte's tools:

Browse a website

navigate({ url: "https://example.com" })// → 612 chars: landmarks, headings, interactive element counts
find({ type: "link", text: "More information" })// → just the matching element with its ID
click({ element_id: "lnk-a3f1c2" })

Fill out a form

navigate({ url: "https://httpbin.org/forms/post" })find({ type: "text_input" })type({ element_id: "inp-c7e29b", text: "[email protected]" })select({ element_id: "sel-e8a3f5", value: "option-2" })submit({ form_id: "frm-b1d4e7" })

Local development feedback loop

dev_serve({ path: "./my-site", watch: true })observe({ detail: "full" })dev_audit({ checks: ["a11y", "contrast"] })dev_inject({ css: "body { font-size: 18px; }" })

Page Representation

Charlotte returns structured representations with three detail levels that let agents control how much context they consume:

Minimal (default for navigate)

Landmarks, headings, and interactive element counts grouped by page region. Designed for orientation — "what's on this page?" — without listing every element.

json
{  "url": "https://news.ycombinator.com",  "title": "Hacker News",  "viewport": { "width": 1280, "height": 720 },  "structure": {    "headings": [{ "level": 1, "text": "Hacker News", "id": "hdg-a1b2c3" }]  },  "interactive_summary": {    "total": 93,    "by_landmark": {      "(page root)": { "link": 91, "text_input": 1, "button": 1 }    }  }}

Summary (default for observe)

Full interactive element list with typed metadata, form structures, and content summaries.

json
{  "url": "https://example.com/dashboard",  "title": "Dashboard",  "viewport": { "width": 1280, "height": 720 },  "structure": {    "landmarks": [      { "id": "rgn-b2c1d0", "role": "banner", "label": "Site header", "bounds": { "x": 0, "y": 0, "w": 1280, "h": 64 } },      { "id": "rgn-d4e5f6", "role": "main", "label": "Content", "bounds": { "x": 240, "y": 64, "w": 1040, "h": 656 } }    ],    "headings": [{ "level": 1, "text": "Dashboard", "id": "hdg-1a2b3c" }],    "content_summary": "main: 2 headings, 5 links, 1 form"  },  "interactive": [    {      "id": "btn-a3f1c2",      "type": "button",      "label": "Create Project",      "bounds": { "x": 960, "y": 80, "w": 160, "h": 40 },      "state": {}    }  ],  "forms": []}

Full

Everything in summary, plus all visible text content on the page.

Detail Levels

LevelTokensUse case
minimal~50-200Orientation after navigation. What regions exist? How many interactive elements?
summary~500-5000Working with the page. Full element list, form structures, content summaries.
fullvariableReading page content. All visible text included.

Navigation tools default to minimal. The observe tool defaults to summary. Both accept an optional detail parameter to override.

Element IDs

Element IDs are stable across minor DOM mutations. They're generated by hashing a composite key of element type, ARIA role, accessible name, and DOM path signature:

btn-a3f1c2  (button)    inp-c7e29b  (text input)lnk-d4b910  (link)      sel-e8a3f5  (select)chk-f1a204  (checkbox)  frm-b1d4e7  (form)rgn-e0d2a8  (landmark)  hdg-0f4063  (heading)dom-b2c3d9  (DOM element, from CSS selector queries)

v0.7.0 ID format change: element-ID hashes are now 6 hex characters (e.g. btn-a3f1c2), up from 4 in earlier releases. This drastically reduces cross-element hash collisions on large pages. Agents that hard-coded or pattern-matched 4-character IDs should re-find elements rather than reuse cached IDs across the upgrade.

IDs survive unrelated DOM changes and element reordering within the same container. When an agent navigates at minimal detail (no individual element IDs), it uses find to locate elements by text, type, or spatial proximity — the returned elements include IDs ready for interaction.

Development

bash
# Run in watch modenpm run dev
# Run all testsnpm test
# Run only unit testsnpm run test:unit
# Run only integration testsnpm run test:integration
# Type checknpx tsc --noEmit

Project Structure

src/  browser/          # Puppeteer lifecycle, tab management, CDP sessions  renderer/         # Accessibility tree extraction, layout, content, element IDs  state/            # Snapshot store, structural differ  tools/            # MCP tool definitions (navigation, observation, interaction, session, dev-mode)  dev/              # Static server, file watcher, auditor  types/            # TypeScript interfaces  utils/            # Logger, hash, wait utilitiestests/  unit/             # Fast tests with mocks  integration/      # Full Puppeteer tests against fixture HTML  fixtures/pages/   # Test HTML files

Architecture

The Renderer Pipeline is the core — it calls extractors in order and assembles a PageRepresentation:

  1. Accessibility tree extraction (CDP Accessibility.getFullAXTree)
  2. Layout extraction (CDP DOM.getBoxModel)
  3. Landmark, heading, interactive element, and content extraction
  4. Element ID generation (hash-based, stable across re-renders)

All tools go through renderActivePage() which handles snapshots, reload events, dialog detection, and response formatting.

Sandbox

Charlotte includes a test website in tests/sandbox/ that exercises all tools without touching the public internet. Serve it locally with:

dev_serve({ path: "tests/sandbox" })

Five pages cover navigation, forms, interactive elements, popups, delayed content, scroll containers, and more. See docs-internal/sandbox.md for the full page reference and a tool-by-tool exercise checklist.

Known Issues

Shadow DOM — Open shadow DOM works transparently. Chromium's accessibility tree pierces open shadow boundaries, so web components (e.g., GitHub's <relative-time>, <tool-tip>) render their content into Charlotte's representation without special handling. Closed shadow roots are opaque to the accessibility tree and will not be captured.

Roadmap

Session & Configuration

Feature Roadmap

Video Recording — Record interactions as video, capturing the full sequence of agent-driven navigation and manipulation for debugging, documentation, and review.

See docs-internal/playwright-mcp-gap-analysis.md for the full gap analysis against Playwright MCP, including lower-priority items (vision tools, testing/verification, tracing, transport, security) and areas where Charlotte has advantages.

Full Specification

See docs-internal/CHARLOTTE_SPEC.md for the complete specification including all tool parameters, the page representation format, element identity strategy, and architecture details.

License

MIT

Community

  • Open a bug report for reproducible defects, regressions, or MCP-client-specific problems.
  • Open a feature request for workflow improvements or new capabilities.
  • Open a tool request if you want to propose a new tool, parameter surface, or profile placement.
  • Browse open issues to find current work and discussion.
  • Check the planned good first issue filter as maintainers tag starter-friendly tasks.

Contributing

See CONTRIBUTING.md for guidelines.

Contributors

Thanks to everyone who has contributed to Charlotte! See CONTRIBUTORS.md.


Part of a growing suite of literary-named MCP servers. See more at github.com/TickTockBent.

來源:README.md,提交 942158c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分