一键启动本地Web项目预览服务,智能识别项目类型并自动运行对应的开发服务器。无论是前端页面还是后端项目,都能快速在本地启动预览,无需手动配置。
Automatically detect the project type and start the appropriate development server IN THE BACKGROUND, then request a Preview URL with MCP Tool request_preview
Detection Logic
Node.js web project
Look for package.json in the workspace root
Check if it contains a dev or start script
Execute npm run dev (or npm start if dev is not available)
Static website
Look for .html files in the workspace (especially index.html)
Execute python3 -m http.server 8000 to serve static files
Other kind of websites
Detect project type and use appropriate server:
PHP projects - Look for .php files or composer.json
Execute php -S localhost:8000 to serve PHP files
If public/index.php exists, serve from public directory
Python projects
Django - Look for manage.py and settings.py
Execute python manage.py runserver 8000
Flask - Look for app.py or wsgi.py
Execute python app.py or flask run --port=8000
Unicorn/uWSGI - Look for gunicorn.conf.py or uwsgi.ini
Execute gunicorn -b 0.0.0.0:8000 app:app (adjust module name)
Generic - Look for requirements.txt or pyproject.toml
Execute python -m http.server 8000
Go projects - Look for go.mod
Execute go run main.go or go run . (usually handles its own server)
Ruby/Rails - Look for Gemfile with rails
Execute rails server -p 8000 or bundle exec rails server -p 8000
Java/Spring Boot - Look for pom.xml (Maven) or build.gradle (Gradle)
Execute mvn spring-boot:run or ./gradlew bootRun
Rust/Axum/Actix - Look for Cargo.toml
Execute cargo run
README-based detection - If standard detection fails:
Search README files (README.md, README.rst, README.txt, doc/README.md)
Look for keywords like run, start, serve, dev, preview
Extract and execute the suggested command
这个技能非常实用,帮我节省了大量时间,强烈推荐!