A fast, organized Model Context Protocol (MCP) server for Doh.js projects. It exposes powerful local code intelligence, headful browser automation, full-stack debugging (client and server), and cloud instance management via a simple SSE transport.
This README focuses on what the system offers at a glance, highlighting capabilities designed to be used by LLMs while remaining intuitive for human operators.
# Start the MCP server (SSE on port 4000 by default)
doh mcp
# PM2-managed (optional)
doh mcp-pm2 setup # initial setup (creates process)
doh mcp-pm2 restart # restart the MCP server process
http://localhost:4000/sse (SSE transport).cursor/ and manages .gitignore entriesEach tool is exposed as an MCP method, validated with zod, returning structured, human-readable results.
search — Advanced codebase search (code + docs)mcp.search.ripgrep.crossline_window_lines (alias: window_lines)--pcre2 when neededgrep_search — Fast exact regex search across the workspacefile_search — Fuzzy file/path finderoutline_code — AST-based file outline (functions/classes/exports/calls)get_local_server_logs — Get recent logs from the local Doh server processrestart_local_server — Restart the local Doh server process via PM2Requires mcp.browser_tools_enabled: true.
browser_goto — Navigate to a URL; auto-launches a single persistent, headful browser instancebrowser_execute_js — Run JS in page context; structured results and robust error capturebrowser_get_console_logs — Retrieve recent console output with type filteringbrowser_reload — Hard reload of current pagebrowser_prompt_user — Compact, draggable dialog for human collaborationai_prompt_restorationNotes
bunx playwright install-deps if neededRequires mcp.browser_debugging_enabled: true and/or mcp.bun_inspector_tools_enabled: true.
target: browser | bun per callws://localhost:6499/inspectCore tools (prefix: inspector_)
evaluate, call_function, get_propertiesset_breakpoint, remove_breakpointstep (over/into/out), pause, resumeget_events (console/network/debugger), get_response_bodyclear_event_bufferRequires mcp.cloud_tools_enabled: true, anchoring the local instance, and remote instances must explicitly opt-in with cloud.mcp_controllable: true.
Core tools
cloud_list_instances — Discover controllable instances you owncloud_get_status — Detailed status for a single instancecloud_restart_instances — Restart one or more instances with optional delaycloud_get_logs — Tail recent logs from a remote instancecloud_run_command — Execute a shell command with timeout/workingDircloud_sync_files_from_local_to_instances — Upload/download files or folderscloud_sync_files_cross_instance — Server-side compare and sync between instances (fast, MD5-aware, with dry-run)Security
mcp_controllable: true instances are visible/controllableXenova/all-MiniLM-L6-v2) entirely on-device. Vectors are cached in SQLite with mtime freshness; loaded into an in-memory vector store at startup for low-latency queries.embedder: noop).outline_code parses JS structure to quickly map large files (functions, classes, methods, exports, calls) with minimal cognitive load.@lvce-editor/ripgrep) honors .gitignore, supports glob/pattern filters, and is guarded by filesize limits to avoid runaway scans.withTimeout, withBatchTimeout) and CircuitBreaker guard long or flaky operations; failures return actionable, human-friendly messages.MCPErrorHandler adds context-aware guidance, suggestions, and compact technical detail toggles to keep results helpful yet calm.ai_prompt_restoration module revives interrupted prompts via localStorage and cleans up state post-completion.cloud.mcp_controllable: true are visible; every operation is validated and logged.Configure via Pod files (pod.yaml, boot.pod.yaml) and module defaults.
mcp pod section (common)mcp:
port: 4000
search_engine: bm25 # docs: BM25 ranking
embedder: local # local | noop (disables embeddings)
vector_store: inmemory
read_whole_files: false
# Browser
browser_tools_enabled: true # enable Playwright-powered tools
browser_debugging_enabled: true # enable browser inspector tools
browser_devtools_port: 9222 # DevTools port for browser debugging
browser_user_data_dir: "/.doh/browser_data" # persistent profile
# Inspector
bun_inspector_tools_enabled: true # enable Bun server inspector tools
# Cloud
cloud_tools_enabled: true # enable cloud management tools
# Error handling
error_handling:
show_technical_details: false
include_error_codes: true
max_error_length: 2000
debug_mode: false
auto_suggest_alternatives: true
context_aware_guidance: true
# Search tuning
search:
definition_results: 5
instance_results: 10
explanation_results: 5
example_results: 5
cache:
default_duration: 30000
pattern_duration: 60000
complex_duration: 45000
low_confidence_factor: 0.7
cleanup_age_multiplier: 2
thresholds:
min_specific_matches_for_context_skip: 5
min_results_before_enhanced_search: 10
max_enhanced_results: 5000
max_candidates_multiplier: 5
min_candidates: 15
boost:
doc_boost_factor: 1.0
heading_boost_factor: 1.5
paragraph_boost_factor: 1.0
priority_doc_boost: 2.0
priority_explanation_multiplier: 2
definition_heading_boost: 2.5
usage_paragraph_boost: 1.5
concept_heading_boost: 2.0
rrfSymbolBoostFactor: 0.1
rrf:
default_k: 60
score_weights:
normalized_rrf: 0.4
similarity: 0.6
docs:
fetch_multiplier: 5
base_fetch_add: 10
ripgrep:
symbol_limit: 50
pattern_limit: 30
related_terms_limit: 40
context_search_limit: 100
enhanced_search_limit: 50
filename_search_limit: 25
crossline_window_lines: 2 # Lines above/below when de-noising OR-mode matches
# Alias supported if the above is absent:
window_lines: 2
# Optional self-improvement helpers
self_improve: false # if true, enables get/restart MCP server helpers
# Optional rule/hook management for editors
manage_claude_md: true
claude_managed_files:
- .cursor/rules/doh-reference.mdc
- .cursor/rules/codebase.mdc
hooks:
manage_hooks: true
hook_files:
- .cursor/hooks/doh-path-suggestions.json
cloud pod section (remote instances)cloud:
endpoint: http://localhost:3000 # or your cloud manager
mcp_controllable: true # required for remote control
/sse) for events; /messages?sessionId=... for requestsmcp.port in your pod before doh mcpsearch intent-aware flowbunx playwright install-deps (or npx), or install listed system librariescloud.mcp_controllable: truemcp.search.thresholds.min_specific_matches_for_context_skip and mcp.search.ripgrep.crossline_window_lines to shift recall vs precision.--pcre2 when needed; ensure your ripgrep build supports PCRE2 if errors appear..cursor/mcp.json and rule files automatically for editor integrationdoh mcp-pm2 (supports start/stop/restart/log/inspect)ai_prompt_restoration transparently restores in-page prompts after navigation and cleans its state to avoid residue