mcp-browser/mcp_browser
Claude4Ξlope 6823d41dd1 Fix server CPU loops and refactor to client/daemon architecture
Major refactoring to fix high CPU usage and improve architecture:

## Fixed Issues
- MCP servers were stuck in infinite loops when stdin closed
- Fixed by checking for EOF (empty string) from stdin.read()
- Fixed indentation error in base.py causing syntax errors

## New Architecture
- Split into separate client and daemon binaries:
  - `mcp-browser`: Smart client that can use daemon or run standalone
  - `mcp-browser-daemon`: Persistent daemon process
  - `mcp-browser-legacy`: Old monolithic version (deprecated)

## Client Features
- Auto-detects and uses daemon if available
- Can auto-start daemon if needed
- Falls back to standalone mode
- Supports `--use-daemon` with modes: auto, always, never
- Works as MCP server (stdin/stdout) or CLI tool

## Daemon Features
- Runs as background process with socket server
- Supports multiple concurrent clients
- Can run in foreground with `--foreground`
- Includes systemd service files for production
- Proper signal handling and cleanup

## Usage Examples
```bash
# CLI usage (auto-uses daemon if available)
mcp-browser tools-list
mcp-browser tools-call builtin:patterns::list_patterns '{}'

# Force standalone mode
mcp-browser --use-daemon never tools-list

# Run daemon manually
mcp-browser-daemon --foreground --log-level DEBUG

# Use as MCP server
echo '{"method":"tools/list"}' | mcp-browser --mode server
```

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-27 17:46:24 +02:00
..
__init__.py Update project metadata for Xilope0 namespace 2025-06-27 12:45:34 +02:00
__main__.py Fix daemon start directory creation 2025-06-27 16:45:21 +02:00
buffer.py Initial prototype of MCP Browser 2025-06-27 12:30:20 +02:00
client_main.py Fix server CPU loops and refactor to client/daemon architecture 2025-06-27 17:46:24 +02:00
config.py Add default config system with ~/.claude/mcp-browser/ directory 2025-06-27 14:37:19 +02:00
daemon.py Replace debug output with proper logging framework 2025-06-27 16:24:24 +02:00
daemon_main.py Fix server CPU loops and refactor to client/daemon architecture 2025-06-27 17:46:24 +02:00
default_configs.py Add default config system with ~/.claude/mcp-browser/ directory 2025-06-27 14:37:19 +02:00
filter.py Fix MCP Browser test suite and add Brave Search integration 2025-06-27 14:11:13 +02:00
logging_config.py Replace debug output with proper logging framework 2025-06-27 16:24:24 +02:00
multi_server.py Replace debug output with proper logging framework 2025-06-27 16:24:24 +02:00
proxy.py Replace debug output with proper logging framework 2025-06-27 16:24:24 +02:00
py.typed Add pip infrastructure and AI development tools 2025-06-27 12:33:43 +02:00
registry.py Initial prototype of MCP Browser 2025-06-27 12:30:20 +02:00
server.py Replace debug output with proper logging framework 2025-06-27 16:24:24 +02:00