Playwright mcp - navigate fails on localhost
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
### Describe the bug
In the agents tab, Playwright MCP browser_navigate never reaches a web server running on localhost. This might be a regression as I have seen this work.
Apologies if this is the wrong place to report this!
### Affected version
cloud
### Steps to reproduce the behavior
1. Create a new repo
2. Include test-ui.js
3. Start new agents tab. Ask co-pilot to start the app and take a screenshot
### Expected behavior
Co-pilot uses browser_navigate tool to access UI on localhost
### Additional context
test-ui.js:
```
#!/usr/bin/env node
/*
* test-ui.js — a minimal, zero-dependency, NO-AUTH frontend.
*
* Purpose: isolate whether the Copilot screenshot problem is Backstage-specific
* or lives in the MCP/screenshot pipeline. This serves a single static page with
* no sign-in, no catalog, no build step, no framework — just Node's built-in http.
*
* Run from the repo root: node test-ui.js
* Then open: http://127.0.0.1:8080 (also http://localhost:8080)
* Override the port with: PORT=1234 node test-ui.js
*/
const http = require('http');
const PORT = Number(process.env.PORT) || 8080;
// Loopback by default: a "normal" app that does NOT do the all-interfaces workaround.
// Flip to all-interfaces for comparison with: HOST=0.0.0.0 node test-ui.js
const HOST = process.env.HOST || '127.0.0.1';
const html = `
Test UI
TEST UI OK
No auth. Static page served by test-ui.js on port ${PORT}.
Screenshot me
`;
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
res.end(html);
});
server.listen(PORT, HOST, () => {
console.log(`test-ui listening on http://${HOST}:${PORT}`);
console.log(`open http://127.0.0.1:${PORT} or http://localhost:${PORT}`);
});
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu từ điểm vào browser_navigate và chạy node test-ui.js từ thư mục gốc của repository. So sánh quyền truy cập vào localhost và 127.0.0.1, sau đó lặp lại với HOST=0.0.0.0 node test-ui.js trong một tab agents mới. Hoàn tất khi Playwright MCP truy cập được trang cục bộ và Copilot có thể chụp ảnh màn hình của trang đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, node.js, playwright
- Lĩnh vực
- devtools, networking
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100