Perplexity Comet Mcp

io.github.RapierCraft由 GitHub 帳號 RapierCraft 發布v2.5.0更新於 Oct 25, 2026

Bridge Claude Code with Perplexity Comet for autonomous browsing and tab management

發布方自己的服務:Alterlab

概覽

AI 產生的概覽

一個本機 MCP 伺服器,將 Claude Code 與 Perplexity Comet 瀏覽器連接,讓助理執行自主瀏覽、研究與分頁管理。

可以做什麼
連接並啟動 Comet 瀏覽器,支援自動重連與健康檢查,並可在任務偏離時停止任務。向 Comet 送出提示並輪詢進度或最終回覆,包括對網址的自主瀏覽與資料擷取。在 search、research、labs 與 learn 之間切換 Perplexity 模式。列出、切換與關閉瀏覽器分頁,並保護最後一個分頁。擷取目前瀏覽器畫面的螢幕截圖。將本機檔案上傳到網頁的檔案輸入元素。
適用情境
適合希望助理在真實且已登入的瀏覽器工作階段中研究網路或操作網站、同時自己繼續寫程式的場景,包括多分頁工作流程以及透過網頁表單發佈或附加檔案。
執行需求
以本機程序方式透過 npm 執行(需要 Node.js 18 或更高版本),並需要安裝 Perplexity Comet 瀏覽器以及相容的 MCP 用戶端(如 Claude Code)。選用環境變數 COMET_PATH(自訂瀏覽器執行檔路徑)與 COMET_PORT(Chrome DevTools Protocol 連接埠,預設 9223)。在 WSL 下可能需要鏡像網路才能存取 Windows 的 localhost 連接埠。
安裝前請注意
此伺服器操作真實瀏覽器工作階段,因此可能作用於已登入帳號,進行導覽、點擊、輸入與送出表單,並上傳你提供路徑的本機檔案。它可以關閉分頁,但最後一個瀏覽分頁受保護。瀏覽活動與頁面內容會經過 Perplexity 的 Comet 瀏覽器與外部網站。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

Perplexity Comet MCP

[npm version] [License: MIT] [Node.js Version] [TypeScript] [MCP Compatible] [Platform]

A production-grade MCP (Model Context Protocol) server that bridges Claude Code with Perplexity's Comet browser for autonomous web browsing, research, and multi-tab workflow management.


Why Perplexity Comet MCP?

ApproachLimitation
Search APIsStatic text, no interaction, no login support
Browser AutomationSingle-agent model overwhelms context, fragments focus
Perplexity Comet MCPClaude codes while Comet handles browsing autonomously

This is a significantly enhanced fork of hanzili/comet-mcp with Windows support, smart completion detection, robust connection handling, and full tab management.


Features

Core Capabilities

  • Autonomous Web Browsing - Comet navigates, clicks, types, and extracts data while Claude focuses on coding
  • Deep Research Mode - Leverage Perplexity's research capabilities for comprehensive analysis
  • Login Wall Handling - Access authenticated content through real browser sessions
  • Dynamic Content - Full JavaScript rendering and interaction support

Enhanced Features (New in This Fork)

FeatureDescription
Windows/WSL SupportFull compatibility with Windows and WSL environments
Tab ManagementTrack, switch, and close browser tabs with protection
Smart CompletionDetect response completion without fixed timeouts
Auto-ReconnectExponential backoff recovery from connection drops
One-Shot ReliabilityPre-operation health checks for consistent execution
Agentic Auto-TriggerAutomatically triggers browser actions from natural prompts

Comparison with Original

CapabilityOriginalEnhanced
Platform SupportmacOSWindows, WSL, macOS
Available Tools68 (+comet_tabs, +comet_upload)
Completion DetectionFixed timeoutStability-based
Connection RecoveryNoneAuto-reconnect with backoff
Tab ManagementNoneFull registry and control
Health MonitoringNoneCached health checks
Last Tab ProtectionNonePrevents browser crash

Installation

Prerequisites

Install via npm

bash
npm install -g perplexity-comet-mcp

Install from Source

bash
git clone https://github.com/RapierCraft/perplexity-comet-mcp.gitcd perplexity-comet-mcpnpm installnpm run build

Configure Claude Code

Add to your Claude Code MCP settings (~/.claude/settings.json or VS Code settings):

json
{  "mcpServers": {    "comet-bridge": {      "command": "node",      "args": ["/path/to/perplexity-comet-mcp/dist/index.js"]    }  }}

Windows Users: Use the full Windows path:

json
{  "mcpServers": {    "comet-bridge": {      "command": "node",      "args": ["C:\\Users\\YourName\\perplexity-comet-mcp\\dist\\index.js"]    }  }}

Tools Reference

comet_connect

Establish connection to Comet browser. Auto-launches if not running.

Parameters: NoneReturns: Connection status message

Example:

> comet_connectComet started with debug port 9223Connected to Perplexity (cleaned 2 old tabs)

comet_ask

Send a prompt to Comet and wait for the complete response. Automatically triggers agentic browsing for URLs and action-oriented requests.

Parameters:  - prompt (required): Question or task for Comet  - newChat (optional): Start fresh conversation (default: false)  - timeout (optional): Max wait time in ms (default: 120000)
Returns: Complete response text

Examples:

# Simple research query> comet_ask "What are the latest features in Python 3.12?"
# Agentic browsing (auto-triggered)> comet_ask "Go to github.com/trending and list top Python repos"
# Site-specific data extraction> comet_ask "Check the price of iPhone 15 on amazon.com"

comet_poll

Check status and progress of ongoing tasks. Returns the response if completed.

Parameters: NoneReturns: Status (IDLE/WORKING/COMPLETED), steps taken, or final response

Example:

> comet_pollStatus: WORKINGBrowsing: https://github.com/trendingCurrent: Scrolling page
Steps:  - Preparing to assist you  - Navigating to github.com  - Clicking on Trending  - Scrolling page

comet_stop

Halt the current agentic task if it goes off track.

Parameters: NoneReturns: Confirmation message

comet_screenshot

Capture a screenshot of the current browser view.

Parameters: NoneReturns: PNG image data

comet_tabs

View and manage browser tabs. Essential for multi-tab workflows.

Parameters:  - action (optional): "list" (default), "switch", or "close"  - domain (optional): Domain to match (e.g., "github.com")  - tabId (optional): Specific tab ID
Returns: Tab listing or action confirmation

Examples:

# List all external tabs> comet_tabs2 browsing tab(s) open:  - AGENT-BROWSING: github.com [ACTIVE]    URL: https://github.com/trending  - AGENT-BROWSING: stackoverflow.com    URL: https://stackoverflow.com/questions
# Switch to a tab> comet_tabs action="switch" domain="stackoverflow.com"Switched to stackoverflow.com (https://stackoverflow.com/questions)
# Close a tab (protected if last tab)> comet_tabs action="close" domain="github.com"Closed github.com

Tab Protection:

  • Cannot close the last external browsing tab (prevents Comet crash)
  • Internal tabs (chrome://, Perplexity UI) are automatically filtered

comet_mode

Switch Perplexity search modes for different use cases.

Parameters:  - mode (optional): "search", "research", "labs", or "learn"
Returns: Current mode or confirmation of switch
ModeUse Case
searchQuick web searches
researchDeep, comprehensive analysis
labsData analytics and visualization
learnEducational explanations

comet_upload

Upload files to file input elements on web pages. Essential for posting images to social media, attaching files to forms, or uploading documents.

Parameters:  - filePath (required): Absolute path to the file to upload  - selector (optional): CSS selector for specific file input  - checkOnly (optional): If true, only checks what file inputs exist
Returns: Success message or error with available inputs

Examples:

# Upload an image to the first file input found> comet_upload filePath="/home/user/screenshot.png"File uploaded successfully: /home/user/screenshot.png
# Check what file inputs exist on the page> comet_upload filePath="dummy" checkOnly=trueFound 2 file input(s) on the page:  1. #image-upload  2. input[name="attachment"]
# Upload to a specific input> comet_upload filePath="/home/user/doc.pdf" selector="#attachment-input"File uploaded successfully: /home/user/doc.pdf

Workflow for posting images:

  1. Navigate to the post creation page (e.g., Reddit, Twitter)
  2. Use comet_upload checkOnly=true to find file inputs
  3. Use comet_upload filePath="..." selector="..." to attach the file
  4. Continue with form submission

Architecture

┌─────────────────┐     MCP Protocol      ┌──────────────────┐│   Claude Code   │ ◄──────────────────► │  Perplexity      ││   (Your IDE)    │                       │  Comet MCP       │└─────────────────┘                       └────────┬─────────┘                                                   │                                          Chrome DevTools                                            Protocol                                                   │                                          ┌────────▼─────────┐                                          │  Comet Browser   │                                          │  (Perplexity)    │                                          └──────────────────┘                                                   │                                          ┌────────▼─────────┐                                          │   External       │                                          │   Websites       │                                          └──────────────────┘

Key Components

ComponentPurpose
index.tsMCP server and tool handlers
cdp-client.tsChrome DevTools Protocol client with reconnection logic
comet-ai.tsPerplexity interaction, prompt submission, response extraction
types.tsTypeScript interfaces for tabs, state, and CDP types

Configuration

Environment Variables

VariableDescriptionDefault
COMET_PATHCustom path to Comet executableAuto-detected
COMET_PORTCDP debugging port9223

Custom Comet Path

bash
# Windowsset COMET_PATH=C:\Custom\Path\comet.exe
# macOS/Linuxexport COMET_PATH=/custom/path/to/Comet.app/Contents/MacOS/Comet

Troubleshooting

Connection Issues

Problem: Error: Failed to list targets: ECONNREFUSED

Solutions:

  1. Ensure Comet browser is installed
  2. Close any existing Comet instances
  3. Run comet_connect to auto-start with correct flags

Problem: WebSocket connection closed during long tasks

Solution: This version handles reconnection automatically. If persistent, increase timeout:

comet_ask prompt="..." timeout=180000

Windows-Specific Issues

Problem: ECONNRESET errors on Windows

Solution: This version includes PowerShell-based fetch workarounds. Ensure:

  1. PowerShell is available in PATH
  2. No firewall blocking localhost:9223

Problem: Comet not found on Windows

Solution: Set custom path:

bash
set COMET_PATH=%LOCALAPPDATA%\Perplexity\Comet\Application\comet.exe

WSL-Specific Issues

Problem: WSL cannot connect to Windows localhost:9223

Explanation: WSL2 uses a separate network namespace by default. The MCP uses Chrome DevTools Protocol (CDP) which requires WebSocket connections to Windows localhost.

Solution: Enable WSL mirrored networking:

  1. Create or edit %USERPROFILE%\.wslconfig (e.g., C:\Users\YourName\.wslconfig):
ini
[wsl2]networkingMode=mirrored
  1. Restart WSL:
powershell
wsl --shutdown
  1. Open a new WSL terminal and try again.

Alternative: Run Claude Code from Windows PowerShell instead of WSL.


Problem: UNC paths are not supported warnings

Explanation: This is a benign warning from PowerShell when launched from WSL. The MCP handles this automatically.


Tab Management Issues

Problem: Cannot close - this is the only browsing tab

Explanation: This is intentional protection. Comet requires at least one external tab. Open another tab first, then close the unwanted one.


Development

Build from Source

bash
git clone https://github.com/RapierCraft/perplexity-comet-mcp.gitcd perplexity-comet-mcpnpm installnpm run build

Run in Development

bash
npm run dev

Run Tests

bash
npm test

Project Structure

perplexity-comet-mcp/├── src/│   ├── index.ts        # MCP server entry point│   ├── cdp-client.ts   # CDP connection management│   ├── comet-ai.ts     # AI interaction logic│   └── types.ts        # TypeScript definitions├── dist/               # Compiled JavaScript├── package.json├── tsconfig.json└── README.md

Contributing

Contributions are welcome. Please read CONTRIBUTING.md before submitting a pull request.

Development Guidelines

  1. Maintain TypeScript strict mode compliance
  2. Add tests for new features
  3. Update documentation for API changes
  4. Follow existing code style

Attribution

This project is an enhanced fork of comet-mcp by hanzili.

Key Enhancements by RapierCraft

  • Windows and WSL platform support
  • Tab management system (comet_tabs tool)
  • Smart completion detection
  • Auto-reconnect with exponential backoff
  • Health check caching
  • Agentic prompt auto-transformation
  • Last tab protection
  • Internal tab filtering

License

MIT License - see LICENSE for details.


Links


Built with precision by RapierCraft

來源:README.md,提交 c3ce9c4

工具

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

版本歷史

1
  1. v2.5.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

其他 Alterlab 整合