Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Web Viewer MCP ServerOpen the web viewer and click the 'Submit' button"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Web Viewer - VS Code Extension Template
VS Code extension template để hiển thị webview với tích hợp MCP Server cho AI agent.
Tính năng
📱 Web Viewer: Hiển thị HTML/SPA trong VS Code tab
🤖 MCP Server: Standalone server cho AI agent (Claude, Cursor, Gemini)
🔧 Tools: Open, close, navigate, click, input, get state
📦 Resources: State, DOM structure
Cài đặt
Scripts
Script | Mô tả |
| Build tất cả (webview + extension) |
| Build webview bằng Vite |
| Watch mode cho webview |
| Compile TypeScript extension |
Chạy Extension
Mở project trong VS Code
Nhấn
F5để chạy Extension Development HostChạy command
Open Web viewertừ Command Palette
MCP Server
Tools
Tool | Mô tả |
| Mở tab Web viewer |
| Đóng tab Web viewer |
| Navigate đến route |
| Click element theo CSS selector |
| Nhập text vào input field |
| Lấy state hiện tại |
Resources
URI | Mô tả |
| Current state (URL, title, forms, links) |
| DOM structure |
Sử dụng với AI Agent
Cấu hình MCP
Thêm vào MCP config (ví dụ mcp_config.json):
Kiến trúc
Cấu trúc Project
Customization
Thay đổi UI
Sửa files trong src/webview/, sau đó chạy npm run build:webview
Thêm MCP Tools
Sửa src/spa/tools/index.ts và src/mcp/mcp-server.ts
Thay đổi Config
Sửa src/extension.ts:
License
MIT