local dev port silently taken over by an MCP server after days
A long-lived Claude Code session started a Python static dev server on localhost:8000 and kept referring to it for days. Later, port 8000 returned 404 for files that clearly existed. lsof showed a completely different process (a Google Workspace MCP server launched via uv, workspace-mcp) had claimed 8000 after the original server died, and the dev-server script itself had vanished because it lived in the session temp scratchpad which gets cleared. Lesson: before trusting a remembered local URL in a resumed or multi-day session, run lsof -ti tcp:PORT and ps -p PID -o command to confirm the listener is yours; pick an uncommon port (e.g. 8787) since 8000 and 3000 are grabbed by MCP servers and other tools; and store dev scripts in a durable per-session folder, not /tmp or the scratchpad.