WP Elementor MCP → Claude Code: 401 “rest_not_logged_in” fix

Site: tres.ovh (Apache + PHP 8.1). Server added via: claude mcp add —transport http —scope user wordpress-elementor
‘https://tres.ovh/index.php?rest_route=/elementor/mcp/’
—header ‘Authorization: Basic ’

Symptom: valid, invalid, and nonexistent users all get identical rest_not_logged_in → WordPress never receives the Authorization header (Apache/CGI/FastCGI strips it).

Fix — top of .htaccess, before # BEGIN WordPress:

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Verify: curl -s -u ‘admin9451:’ ‘https://tres.ovh/index.php?rest_route=/wp/v2/users/me’ → returns user JSON (not 401). Then: claude mcp get wordpress-elementor → ✔ Connected.

Diagnostic trick: a bogus username returning the same error as the real one = header stripped, not a bad password.

Status 2026-09-25

.htaccess fix applied → claude mcp get ✔ Connected. Smoke test elementor-list-posts returned 6 pages (Home #15 published; Inicio — Nuevo Estadio #48 draft, etc.). TODO: rotate app password (was pasted in chat), update header, delete ~/.claude.json.bak-20260924.