Web Viewer MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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
npm install
npm run buildScripts
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
βββ media/ # Build output (Vite)
βββ src/
β βββ extension.ts # Entry point
β βββ core/ # Generic modules (don't modify)
β β βββ ViewerProvider.ts
β β βββ HttpBridge.ts
β β βββ McpConfigUpdater.ts # Auto-update mcp.json
β βββ mcp/
β β βββ mcp-server.ts # MCP server (don't modify)
β βββ tools/
β β βββ index.ts # β Tool schemas
β βββ webview/
β βββ bridge.ts # Core handlers (don't modify)
β βββ main.ts # β Custom handlers
βββ vite.config.ts
βββ package.jsonAdding New Tools (2 files only)
1. Schema: src/tools/index.ts
{
name: 'web_scroll',
description: 'Scroll page by pixels',
inputSchema: {
type: 'object',
properties: {
y: { type: 'number', description: 'Pixels to scroll' },
},
required: ['y'],
},
},2. Handler: src/webview/main.ts
registerHandler('scroll', (payload: { y: number }) => {
window.scrollBy(0, payload.y);
return true;
});Note: Tool name
web_scrollβ handler namescroll(prefixweb_is auto-stripped)
3. Build
npm run buildPackaging VSIX
# Build and package
npm run build
npx @vscode/vsce package --allow-missing-repository
# Install locally
code --install-extension web-viewer-0.0.1.vsixArchitecture
AI Agent <--stdio--> MCP Server <--HTTP:54321--> VS Code Extension <--postMessage--> Webview
| | |
tools/index.ts extension.ts bridge.ts
(auto-forward) (defaultHandler) main.tsCommands
Command | Description |
| Open the webview panel |
| Manually update mcp.json |
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
AI-powered web automation. Navigate websites using AI agents for one page or a thousand