comet-mcp
CLAUDE.md180 starsChanged 11 months agoMITView on GitHub
Response extraction (comet-ai.ts:getAgentStatus): - Takes LAST prose element (not longest) - conversation threads show newest last - Filters out UI text (Library, Discover, etc.) and questions (ends with ?) Follow-up detection (index.ts): - Captures old prose count/text before sending - Waits for NEW response (different text or more elements) Prompt normalization: - Strips bullet points, collapses newlines to spaces Manual testing only (integration code, external DOM dependency).
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Prompt not submitted: If response shows 0 steps + COMPLETED, prompt may not have been submitted.
- Distinctive: line 50
Stale poll response: If poll returns unrelated response, the previous prompt failed.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
What This Is
MCP server connecting Claude Code to Perplexity's Comet browser via Chrome DevTools Protocol (CDP).
Architecture
Claude Code → MCP Server (index.ts) → CometAI (comet-ai.ts) → CDP Client (cdp-client.ts) → Comet Browser6 Tools
comet_connect- Start/connect to Comet browsercomet_ask- Send prompt, wait for response (15s default, use poll for longer)comet_poll- Check status of long-running taskscomet_stop- Stop current taskcomet_screenshot- Capture current pagecomet_mode- Switch Perplexity modes (search/research/labs/learn)
Key Implementation Details
Response extraction (comet-ai.ts:getAgentStatus):
- Takes LAST prose element (not longest) - conversation threads show newest last
- Filters out UI text (Library, Discover, etc.) and questions (ends with ?)
Follow-up detection (index.ts):
- Captures old prose count/text before sending
- Waits for NEW response (different text or more elements)
Prompt normalization:
- Strips bullet points, collapses newlines to spaces
Build & Test
npm run build
pgrep -f "node.*comet-mcp" | xargs kill # Restart MCPManual testing only (integration code, external DOM dependency).
Test Cases
- Quick queries - Simple questions (math, facts) should return within 15s
- Non-blocking - Short timeout returns "in progress", use poll to get result
- Follow-up - Second question in same chat detects NEW response correctly
- Agentic task - "Take control of browser and go to X" triggers browsing
- newChat after agentic -
newChat: trueresets CDP state after browser control - Mode switching -
comet_modechanges search/research/labs/learn
Known Edge Cases
- Prompt not submitted: If response shows 0 steps + COMPLETED, prompt may not have been submitted. Retry or use newChat.
- Stale poll response: If poll returns unrelated response, the previous prompt failed. Send again.
- Research mode: Takes longer than search mode, may need multiple polls.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

