Enables autonomous web browsing and research through Perplexity's Comet browser, providing tools for navigation, data extraction, tab management, screenshot capture, file uploads, and leveraging Perplexity's research modes for comprehensive analysis.
Perplexity Comet MCP
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?
Approach | Limitation |
Search APIs | Static text, no interaction, no login support |
Browser Automation | Single-agent model overwhelms context, fragments focus |
Perplexity Comet MCP | Claude 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)
Feature | Description |
Windows/WSL Support | Full compatibility with Windows and WSL environments |
Tab Management | Track, switch, and close browser tabs with protection |
Smart Completion | Detect response completion without fixed timeouts |
Auto-Reconnect | Exponential backoff recovery from connection drops |
One-Shot Reliability | Pre-operation health checks for consistent execution |
Agentic Auto-Trigger | Automatically triggers browser actions from natural prompts |
Comparison with Original
Capability | Original | Enhanced |
Platform Support | macOS | Windows, WSL, macOS |
Available Tools | 6 | 8 (+comet_tabs, +comet_upload) |
Completion Detection | Fixed timeout | Stability-based |
Connection Recovery | None | Auto-reconnect with backoff |
Tab Management | None | Full registry and control |
Health Monitoring | None | Cached health checks |
Last Tab Protection | None | Prevents browser crash |
Installation
Prerequisites
Node.js 18 or higher
Perplexity Comet Browser installed
Claude Code or compatible MCP client
Install via npm
Install from Source
Configure Claude Code
Add to your Claude Code MCP settings (~/.claude/settings.json or VS Code settings):
Windows Users: Use the full Windows path:
Tools Reference
comet_connect
Establish connection to Comet browser. Auto-launches if not running.
Example:
comet_ask
Send a prompt to Comet and wait for the complete response. Automatically triggers agentic browsing for URLs and action-oriented requests.
Examples:
comet_poll
Check status and progress of ongoing tasks. Returns the response if completed.
Example:
comet_stop
Halt the current agentic task if it goes off track.
comet_screenshot
Capture a screenshot of the current browser view.
comet_tabs
View and manage browser tabs. Essential for multi-tab workflows.
Examples:
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.
Mode | Use Case |
search | Quick web searches |
research | Deep, comprehensive analysis |
labs | Data analytics and visualization |
learn | Educational 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.
Examples:
Workflow for posting images:
Navigate to the post creation page (e.g., Reddit, Twitter)
Use
comet_upload checkOnly=trueto find file inputsUse
comet_upload filePath="..." selector="..."to attach the fileContinue with form submission
Architecture
Key Components
Component | Purpose |
| MCP server and tool handlers |
| Chrome DevTools Protocol client with reconnection logic |
| Perplexity interaction, prompt submission, response extraction |
| TypeScript interfaces for tabs, state, and CDP types |
Configuration
Environment Variables
Variable | Description | Default |
| Custom path to Comet executable | Auto-detected |
| CDP debugging port | 9223 |
Custom Comet Path
Troubleshooting
Connection Issues
Problem: Error: Failed to list targets: ECONNREFUSED
Solutions:
Ensure Comet browser is installed
Close any existing Comet instances
Run
comet_connectto auto-start with correct flags
Problem: WebSocket connection closed during long tasks
Solution: This version handles reconnection automatically. If persistent, increase timeout:
Windows-Specific Issues
Problem: ECONNRESET errors on Windows
Solution: This version includes PowerShell-based fetch workarounds. Ensure:
PowerShell is available in PATH
No firewall blocking localhost:9223
Problem: Comet not found on Windows
Solution: Set custom path:
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
Run in Development
Run Tests
Project Structure
Contributing
Contributions are welcome. Please read CONTRIBUTING.md before submitting a pull request.
Development Guidelines
Maintain TypeScript strict mode compliance
Add tests for new features
Update documentation for API changes
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