Skip to main content
Glama
Comet MCP Server

Comet MCP Server

by AdilShaikh1

What it does

The server talks to Claude over MCP stdio and to Comet over the Chrome DevTools Protocol (CDP), on port 9222 by default. Each tool acts in your own Comet window.

comet_search opens a new tab for each query and returns at once. Perplexity streams the answer in that tab. Claude reads it with comet_read_page about 15 to 20 seconds later, or 30 to 45 seconds later in research mode. The server keeps at most 5 search tabs and closes the oldest first.

The results of comet_search, comet_search_finance, comet_navigate, comet_read_page, comet_citations and comet_evaluate pass through a ContentFilter before Claude sees them. comet_connect, comet_click, comet_screenshot and comet_tabs check page titles against the filter's injection patterns and withhold a flagged title. They show URLs as they are. The filter strips hidden characters and HTML comments, scans for 39 prompt-injection patterns and starts the result with a header. The header names the source and its trust tier, or lists the patterns it found. docs/security.md lists the patterns, the tiers and which tools are filtered.

Tool

What it does

comet_connect

Connects to a running Comet over CDP. Call it first.

comet_search

Starts a Perplexity search in a new tab, in search or research mode.

comet_search_finance

Opens a Perplexity Finance page in the active tab (market, quote, screener, earnings or predictions).

comet_navigate

Opens a URL in the active tab and returns a text preview.

comet_read_page

Reads the page text, or only the part a CSS selector matches.

comet_citations

Lists the sources an answer cites inline, with the number of times each is cited.

comet_screenshot

Takes a screenshot and returns it as a base64 PNG.

comet_click

Clicks an element by CSS selector or by text=....

comet_type

Types into an input field.

comet_tabs

Lists, opens, switches or closes tabs.

comet_evaluate

Runs a JavaScript expression in the page.

comet_wait

Waits for a selector to appear or for a number of seconds.

comet_security_scan

Scans the page for hidden elements, HTML comments and injection patterns.

docs/tool-reference.md documents every parameter and default.

Related MCP server: Perplexity Comet MCP

When to reach for it

Reach for it when Claude needs a Perplexity answer, a page that only loads in a real browser, or market data from Perplexity Finance. Once the server is configured, Claude picks the tools when a request needs the web. You can also name a tool in the request, for example "use comet_search to look up the latest uv release".

The browsing tools work on any site. Use comet_security_scan on a page that looks suspicious before Claude acts on its content.

Install

Requirements. The server needs Perplexity's Comet browser on Windows or macOS, Python 3.10 or newer, and uv.

Start Comet with remote debugging. The server reaches Comet on the CDP port, so Comet must run with --remote-debugging-port=9222. Start Comet with one of these commands before you use the server. When Comet is already open without the flag, quit it fully first. The server never starts or closes Comet.

On Windows (PowerShell):

& "$env:LOCALAPPDATA\Perplexity\Comet\Application\comet.exe" --remote-debugging-port=9222

On macOS:

/Applications/Comet.app/Contents/MacOS/Comet --remote-debugging-port=9222

Claude Desktop. Add the server to claude_desktop_config.json, then restart Claude Desktop. The file lives at %APPDATA%\Claude\claude_desktop_config.json on Windows and ~/Library/Application Support/Claude/claude_desktop_config.json on macOS.

{
  "mcpServers": {
    "comet": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/AdilShaikh1/comet-mcp-desktop@v0.2.0", "comet-mcp-desktop"]
    }
  }
}

Claude Code. Run:

claude mcp add comet -- uvx --from git+https://github.com/AdilShaikh1/comet-mcp-desktop@v0.2.0 comet-mcp-desktop

Both configs pin the v0.2.0 release tag. On first run, uvx installs the server from that tag and resolves its dependencies.

From source. Clone the repo and run the server with uv:

git clone https://github.com/AdilShaikh1/comet-mcp-desktop.git
cd comet-mcp-desktop
uv sync
uv run comet-mcp-desktop

The server then waits for an MCP client on stdio. docs/configuration.md shows a client config that points at a clone, and it lists the environment variables (COMET_CDP_URL, COMET_TIMEOUT and COMET_MAX_CONTENT).

Usage

Ask Claude for something on the web. Claude calls comet_connect once, then the tools the request needs.

You say

Claude calls

"Search Perplexity for the latest AI news"

comet_search, then comet_read_page once the answer has streamed in

"Open Hacker News and summarize the front page"

comet_navigate, then comet_read_page

"Click the first link and read the article"

comet_click, then comet_read_page

"Show me the NVDA quote on Perplexity Finance"

comet_search_finance with mode="quote" and ticker="NVDA", then comet_read_page(selector="main")

"Take a screenshot of what you see"

comet_screenshot

"Is this page safe?"

comet_security_scan

comet_search_finance has five modes. The market, quote, earnings and predictions pages are ready to read after about 3 to 5 seconds. The screener mode types a natural-language query into the Finance screener and submits it. The screener runs Perplexity's Computer feature, so each screener query uses your Perplexity account.

Common questions

Does it run on Linux? No. Comet runs on Windows and macOS, and it has no Linux build.

Does it need a paid Perplexity plan? Not for searches and Finance pages, which were tested on a free account. The screener mode was not tested on one.

What happens if Comet is already open without the flag? comet_connect fails with a tool error that says the CDP URL didn't accept a connection and gives the command that starts Comet with the flag. Quit Comet fully, run that command and call comet_connect again. On a managed machine, the RemoteDebuggingAllowed policy can block remote debugging.

The connection dropped mid-session. What now? Call comet_connect again. It reconnects without restarting the server. The search tabs stay open in Comet, but the server stops tracking them.

comet_read_page shows "Searching the web". Is it stuck? The answer is still streaming. Wait a little longer and call comet_read_page again.

How does it compare with a search API or a browser automation server? It covers both jobs in one server. comet_search hands the query to Perplexity and Claude reads the answer as text. The browsing tools open, click, type and read pages in Comet, and the ContentFilter checks the text the reading tools return.

It's working if

  • comet_connect answers Connected to Comet at http://localhost:9222, followed by the open tab count and the active page.

  • A comet_search followed by comet_read_page returns an answer.

  • Text from a page starts with a Source: <url> | Trust: <tier> header, or with a security warning when the filter found an injection pattern.

Tests

uv run python test_comet.py runs 29 static tests with no browser. They cover syntax, tool registration, parameter checks and the ContentFilter.

uv run python test_comet.py --with-browser adds the live tier, for 57 tests in total, against a Comet started with --remote-debugging-port=9222. When the CDP port doesn't answer, the run records cdp_connection as failed and skips the rest of the live tier. The live tests use the Perplexity account Comet is signed in to, and they never submit a Finance screener query.

--test NAME runs one test, for example uv run python test_comet.py --test finance_validation. Results land in test_results/, which git ignores.

Repository layout

  • comet_mcp.py: the server and its 13 tools

  • content_filter.py: the ContentFilter and its injection patterns

  • test_comet.py: the static and live tests

  • main.py: a second entry point, uv run python main.py

  • docs/: the tool reference, the security notes and the configuration guide

  • pyproject.toml and uv.lock: the package config and the locked dependencies

  • requirements.txt: the dependency list in requirements format

  • setup.sh: runs uv sync and prints how to start Comet

  • CHANGELOG.md: the release notes

  • CONTRIBUTING.md: how to propose a change

  • README.md, LICENSE, .gitignore, .gitattributes and .python-version: this page, the MIT license and the repo settings

License

This repo is MIT licensed (see LICENSE). Issues are welcome. Please describe what you asked Claude, what the server returned and what you expected.

Available Tools

12 tools
comet_clickA

Click an element on the current Comet page.

Use 'text=...' for visible text matching (preferred over brittle CSS selectors). Waits after click for page to settle. If element not found, returns error — use comet_read_page first to verify the element exists.

Args: selector: CSS selector or 'text=Something' for text matching. wait_after: Seconds to wait after clicking (default 2).

Inputs: selector (required), wait_after. Returns: result

comet_connectA

Connect to the Comet browser via CDP. Auto-launches Comet if needed.

ALWAYS call this first before using any other comet tool. On success, returns connection info plus a workflow guide for optimal results.

If connection is lost mid-session, call this again to reconnect.

Inputs: no named parameters. Returns: result

comet_evaluateA

Evaluate a JavaScript expression in the current Comet page.

Powerful but use with care — string results are sanitized for injection detection. Use for DOM queries, data extraction, or page manipulation that other tools don't cover.

Args: expression: JavaScript expression to evaluate (e.g. 'document.title').

Inputs: expression (required). Returns: result

comet_navigateA

Navigate Comet to a specific URL in the active tab.

Use this to visit specific pages (docs, APIs, articles). For web searches, prefer comet_search instead. Content is auto-sanitized for injection detection.

Args: url: The URL to navigate to. wait_for: Wait condition -- 'load', 'domcontentloaded', or 'networkidle'.

Inputs: url (required), wait_for. Returns: result

comet_read_pageA

Read the text content of the current page (or active tab) in Comet.

PRIMARY USE: Call this after comet_search to retrieve the streamed answer. Wait ~30-45s (research mode) or ~15-20s (search mode) before calling. If the answer is still loading ("Searching the web" in output), wait longer and call again.

Also use to drill into specific page sections or re-read content. Content is auto-sanitized — if injections are detected, run comet_security_scan.

Args: selector: Optional CSS selector to read specific content (e.g. 'main'). include_links: Whether to include href URLs from links. max_length: Maximum characters to return (default 50000).

Inputs: selector, max_length, include_links. Returns: result

comet_screenshotA

Take a screenshot of the current Comet page. Returns base64 PNG.

Uses raw CDP (not Playwright) to avoid font-renderer hangs. Useful for visual verification after navigation or to capture charts/images that text extraction misses.

Args: full_page: Whether to capture the full scrollable page (not just viewport).

Inputs: full_page. Returns: result

comet_search_financeA

Search Perplexity Finance for market data, stock quotes, or screener results.

Navigates the active tab to the appropriate Perplexity Finance page and returns immediately. Call comet_read_page(selector="main") after ~3-5s to retrieve the full data. Screener mode returns after typing the query.

Modes:

  • "market": Dashboard — indices, sectors, movers, crypto, AI market summary

  • "quote": Stock/ETF/crypto detail — price, P/E, EPS, 52W range, AI analysis

  • "screener": Natural-language stock screener — type a query, get matches. The screener runs on Perplexity's Computer feature.

  • "earnings": Earnings calendar for the current week

  • "predictions": Prediction markets (Polymarket) — rates, oil, elections

Args: mode: One of 'market', 'quote', 'screener', 'earnings', 'predictions'. ticker: Ticker symbol for 'quote' mode (e.g., 'NVDA', 'BTCUSD', 'XLK'). query: Natural language query for 'screener' mode (e.g., 'semiconductor stocks with revenue growth > 20%').

Inputs: mode, query, ticker. Returns: result

comet_security_scanA

Deep security scan of current page for prompt injection and hidden content.

Run this when: content filter flags injections, page seems suspicious, or you want to verify a page is clean before trusting its content. Checks CSS-hidden elements, zero-width chars, HTML comments, and 39 injection patterns.

Inputs: no named parameters. Returns: result

comet_tabsA

Manage tabs in the Comet browser. Each comet_search opens a new tab (tagged [search] in list output). Use 'list' to see all tabs, 'switch' to go back to a previous search result, 'close' to free memory.

Tab hygiene: list tabs periodically and close old ones. Max 5 search tabs are kept (oldest auto-closed). Closing a tab removes it from search tracking.

Args: action: 'list' (show all), 'new' (open tab), 'switch' (by index), 'close' (by index). tab_index: Tab index for 'switch' or 'close' (0-based, from 'list' output). url: URL for 'new' tab action (opens blank if omitted).

Inputs: url, action, tab_index. Returns: result

comet_typeA

Type text into an input field in the current Comet page.

For Perplexity searches, prefer comet_search (URL-based, no selectors needed). Use this for form inputs on other sites. Clears the field by default before typing.

Args: selector: CSS selector of the input field. text: Text to type into the field. press_enter: Whether to press Enter after typing. clear_first: Whether to clear the field before typing (default true).

Inputs: text (required), selector (required), clear_first, press_enter. Returns: result

comet_waitA

Wait for a specific element to appear or a fixed duration.

Use after comet_click or comet_navigate when content loads asynchronously. Provide either selector OR seconds, not both. comet_search returns before the answer is ready, so wait with comet_wait or a fixed delay, then call comet_read_page.

Args: selector: CSS selector to wait for (e.g. 'div.results'). seconds: Fixed seconds to wait (0-120).

Inputs: seconds, selector. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 12 tools

    Disambiguation4/5

    Each tool maps to a distinct browser primitive (navigate, read, click, type, wait, evaluate, screenshot, tabs) and the few adjacent pairs are explicitly separated in their descriptions (comet_search opens a new tab vs comet_navigate reuses the active tab; comet_search vs comet_search_finance differ by surface). The main residual ambiguity is the search→wait→read_page sequence, where an agent could misjudge whether comet_wait or comet_read_page is the right next call, but the workflow guidance mitigates this.

    Naming Consistency5/5

    Every tool uses the same comet_ prefix with snake_case verb or verb_noun forms (comet_connect, comet_read_page, comet_search_finance, comet_security_scan). The convention is uniform and predictable across all 12 tools, with no mixing of casing or verb styles.

    Tool Count5/5

    Twelve tools is well within the ideal 3-15 band and each tool earns its place: one connection, two search entry points, and the core page-interaction primitives. Nothing appears redundant or missing at the count level.

    Completeness4/5

    The surface covers the full browse lifecycle: connect, navigate, read, click, type, wait, screenshot, evaluate, tab management, and a security scan. Minor gaps remain for common actions like history back/forward, scrolling, key presses beyond Enter, and hover/select interactions, but most can be worked around via comet_evaluate or comet_navigate.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Connects Claude to Perplexity Comet's agentic browser for autonomous web browsing, deep research, and real-time task monitoring. Enables Claude to delegate web research tasks and receive comprehensive results through multiple browsing modes.
      6
      67 npm
      183
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Bridges Claude with Perplexity's Comet browser for autonomous web browsing, research, and multi-tab workflow management. Supports dynamic content interaction, login wall handling, file uploads, and intelligent completion detection across Windows, macOS, and WSL platforms.
      8
      231 npm
      54
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that connects Claude to Perplexity Comet for agentic web browsing and deep research via an isolated browser instance. It enables Claude to delegate complex navigation, login flows, and real-time task monitoring to Perplexity's specialized research intelligence.
      8
      MIT