Skip to content

Instantly share code, notes, and snippets.

@jeremyben
Last active February 9, 2026 10:18
Show Gist options
  • Select an option

  • Save jeremyben/fb771b641208c635f258365844526c62 to your computer and use it in GitHub Desktop.

Select an option

Save jeremyben/fb771b641208c635f258365844526c62 to your computer and use it in GitHub Desktop.
claude code config

Chrome DevTools MCP

https://github.com/ChromeDevTools/chrome-devtools-mcp#connecting-to-a-running-chrome-instance

Simple sur navigateur existant

claude mcp add chrome-devtools --scope user -- npx chrome-devtools-mcp@latest --autoConnect

Puis: chrome://inspect/#remote-debugging

Sur WSL

Connexion à Chrome Windows

https://github.com/dbalabka/chrome-wsl

claude mcp add chrome-devtools --scope user -- npx chrome-devtools-mcp@latest --browser-url http://127.0.0.1:9222 
volta install @dbalabka/chrome-wsl
chrome-wsl

Connexion à Chrome Linux

Installation de Chrome.

wget -P /tmp https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i /tmp/google-chrome-stable_current_amd64.deb

Script pour scaler et positionner Chrome.

~/.claude.json

"mcpServers": {
  "chrome-devtools": {
    "type": "stdio",
    "command": "bash",
    "args": ["/home/jeremy/.claude/chrome-mcp.sh"],
    "env": {
      "DISPLAY": ":0",
      "WAYLAND_DISPLAY": "wayland-0",
      "XDG_RUNTIME_DIR": "/mnt/wslg/runtime-dir"
    }
  }
}

~/.claude/chrome-mcp.sh (chmod +x)

#!/bin/bash

# Script de lancement Chrome pour le MCP chrome-devtools.
#
# Logique :
# 1. Cherche un écran connecté correspondant aux résolutions dans TARGET_RES (par ordre de préférence)
# 2. Si aucun trouvé, fallback sur le premier écran connecté
# 3. HiDPI + écran principal → scale 1.5, pas de position
#    HiDPI + écran secondaire → scale 1.5 + position xrandr
#    Non-HiDPI → position xrandr, pas de scale

# Résolutions cibles par ordre de préférence. Fallback: premier écran connecté.
TARGET_RES=("1920x1080" "2560x1600")

XRANDR_OUTPUT=$(xrandr)
TARGET_INFO=""

for RES in "${TARGET_RES[@]}"; do
  TARGET_INFO=$(echo "$XRANDR_OUTPUT" | grep " connected" | grep "$RES" | head -1)
  [ -n "$TARGET_INFO" ] && break
done

# Fallback : premier écran connecté
if [ -z "$TARGET_INFO" ]; then
  TARGET_INFO=$(echo "$XRANDR_OUTPUT" | grep " connected" | head -1)
fi

POS=$(echo "$TARGET_INFO" | grep -oP '\d+x\d+\+\K\d+\+\d+' | tr '+' ',')
RES_WIDTH=$(echo "$TARGET_INFO" | grep -oP '\d+(?=x\d+\+)')

# Détecte si l'écran est HiDPI : résolution >= 2000px et taille physique inconnue ou petite (< 400mm)
PHYS_MM=$(echo "$TARGET_INFO" | grep -oP '\d+(?=mm)' | head -1)
HIDPI=false
if [ -n "$RES_WIDTH" ] && [ "$RES_WIDTH" -ge 2000 ]; then
  if [ -z "$PHYS_MM" ] || [ "$PHYS_MM" -eq 0 ] || [ "$PHYS_MM" -lt 400 ]; then
    HIDPI=true
  fi
fi

ARGS=(
  "chrome-devtools-mcp@latest"
  "--executablePath=/usr/bin/google-chrome"
  "--usageStatistics=false"
  "--chromeArg=--no-sandbox"
  "--chromeArg=--disable-setuid-sandbox"
)

# Détecte si c'est l'écran principal (premier connecté)
PRIMARY_INFO=$(echo "$XRANDR_OUTPUT" | grep " connected" | head -1)
IS_PRIMARY=false
[ "$TARGET_INFO" = "$PRIMARY_INFO" ] && IS_PRIMARY=true

if [ "$HIDPI" = true ]; then
  ARGS+=("--chromeArg=--force-device-scale-factor=1.5")
fi

# Position : pas de position pour l'écran principal en HiDPI (non fiable sous WSL2)
if [ -n "$POS" ]; then
  if [ "$HIDPI" != true ] || [ "$IS_PRIMARY" != true ]; then
    ARGS+=("--chromeArg=--window-position=$POS")
  fi
fi

exec npx "${ARGS[@]}"

Serena

https://docs.astral.sh/uv/getting-started/installation/ https://oraios.github.io/serena/02-usage/030_clients.html#claude-code

Optimal pour la refacto, pas la recherche.

Augment Context Engine MCP (Payant)

https://docs.augmentcode.com/context-services/mcp/quickstart-claude-code

Mongo

~/.claude.json

"mongodb": {
  "type": "stdio",
  "command": "npx",
  "args": ["-y", "mongodb-mcp-server"],
  "env": {
    "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/main",
    "MDB_MCP_READ_ONLY": "true"
  }
}

~/.claude/settings.json

{
	"statusLine": {
		"type": "command",
		"command": "~/.claude/statusline.sh",
		"padding": 0
	}
}

~/.claude/statusline.sh (chmod +x)

#!/bin/bash

input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
CURRENT_DIR=$(echo "$input" | jq -r '.workspace.current_dir')
PERCENT_USED=$(echo "$input" | jq -r '.context_window.used_percentage // 0')

LINES_ADDED=$(echo "$input" | jq -r '.cost.total_lines_added')
LINES_REMOVED=$(echo "$input" | jq -r '.cost.total_lines_removed')

GIT_BRANCH=""
if git rev-parse --git-dir > /dev/null 2>&1; then
    BRANCH=$(git branch --show-current 2>/dev/null)
    if [ -n "$BRANCH" ]; then
        GIT_BRANCH="|$BRANCH"
    fi
fi

echo "[$MODEL] ${CURRENT_DIR##*/}$GIT_BRANCH (+${LINES_ADDED}-${LINES_REMOVED}) ctx:${PERCENT_USED}%"

Comments are disabled for this gist.