Preview MCP: launch.json runtimeArgs path ignored — server always serves Desktop directory
Resolved 💬 3 comments Opened Apr 16, 2026 by MarvinGuss Closed Apr 20, 2026
Bug Description
The Claude Preview MCP tool (preview_start) ignores the directory path specified in launch.json runtimeArgs and always serves from the user's Desktop directory instead.
Steps to Reproduce
- Configure
launch.jsonwith a specific serve path:
{
"version": "0.0.1",
"configurations": [
{
"name": "ae-report-preview",
"runtimeExecutable": "npx",
"runtimeArgs": ["serve", "-l", "3456", "C:/Users/MarvinGuss/AppData/Local/Temp/pipeline-csvs"],
"port": 3456
}
]
}
- Call
preview_startwith the configuration name - Take a screenshot or snapshot of the served page
Expected Behavior
The server should serve files from C:/Users/MarvinGuss/AppData/Local/Temp/pipeline-csvs as configured in runtimeArgs.
Actual Behavior
The server always shows "Index of Desktop/" — serving the user's Desktop directory regardless of the path configured in runtimeArgs.
Verification
Running the exact same command manually in the terminal works correctly:
cd "C:/Users/MarvinGuss/AppData/Local/Temp/pipeline-csvs"
npx serve -l 3457 .
# → correctly shows "Index of pipeline-csvs/"
This confirms the issue is in how preview_start spawns the process, not in npx serve itself. The tool appears to either:
- Drop the path argument from
runtimeArgs, or - Set the working directory to Desktop instead of respecting the configured path
Environment
- Platform: Windows 11 Pro 10.0.26200
- Claude Code Desktop App
- Shell: bash
- The issue persists across sessions and after killing stale processes on the port
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗