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 for displaying webview with MCP Server integration for AI agents.
Features
π± Web Viewer: Display HTML/SPA in VS Code tab
π€ MCP Server: Standalone server for AI agents (Claude, Cursor, Gemini)
π§ Tools: Open, close, navigate, click, input, scroll, get state
π¦ Resources: State, DOM structure
β‘ 2-file tool addition: Only modify 2 files to add new tools
π Auto MCP Config: Automatically registers in VS Code's mcp.json on install
Installation
From VSIX (Recommended)
Download
web-viewer-0.0.1.vsixIn VS Code:
Ctrl+Shift+Pβ "Extensions: Install from VSIX..."Select the VSIX file
Reload VS Code
MCP server is automatically configured! β¨
From Source
Scripts
Script | Description |
| Build all (webview + extension + MCP bundle) |
| Build webview with Vite |
| Bundle MCP server with esbuild |
| Watch mode for webview |
| Compile TypeScript extension |
Running the Extension
Open project in VS Code
Press
F5to launch Extension Development HostExtension auto-starts (onStartupFinished)
Run command
Open Web viewerfrom Command Palette
MCP Server
Auto Configuration
When you install the extension, it automatically adds the MCP server to:
Windows:
%APPDATA%\Code\User\mcp.jsonmacOS:
~/Library/Application Support/Code/User/mcp.jsonLinux:
~/.config/Code/User/mcp.json
You can also manually trigger this with: Ctrl+Shift+P β "Web viewer: Update MCP Configuration"
Tools
Tool | Description |
| Open Web viewer tab |
| Close Web viewer tab |
| Navigate to route |
| Click element by CSS selector |
| Input text into form field |
| Scroll page (y pixels) |
| Get current state |
Resources
URI | Description |
| Current state (URL, title, forms, links) |
| DOM structure |
Project Structure
Adding New Tools (2 files only)
1. Schema: src/tools/index.ts
2. Handler: src/webview/main.ts
Note: Tool name
web_scrollβ handler namescroll(prefixweb_is auto-stripped)
3. Build
Packaging VSIX
Architecture
Commands
Command | Description |
| Open the webview panel |
| Manually update mcp.json |
License
MIT