Commit Graph

2 Commits

Author SHA1 Message Date
gpt-5-codex 18d94d8913 docs: provide hardened nginx and systemd templates 2025-10-10 23:18:46 +02:00
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