What is MCP Web Worker Demo?
MCP Web Worker Demo is a browser-based demonstration of a Model Context Protocol (MCP) client implemented using a Shared Web Worker architecture. It shows how to run MCP in a browser with a decoupled, pure JavaScript design requiring no build step.
How to use MCP Web Worker Demo?
Install the TypeScript SDK, build it with npm run build, then start a web server from the webworker-demo directory using ./start.sh or npx http-server -p 3000. Open http://localhost:3000/webworker-demo/ in Chrome or Edge, click “Connect to MCP”, and explore the Tools, Resources, and Prompts tabs.
Key features of MCP Web Worker Demo
- Client runs in a Shared Web Worker background thread.
- No external dependencies or build step required.
- Single worker instance serves multiple tabs or windows.
- Mock server with tools, resources, and prompts for testing.
- Interactive demo UI showing connection state and server info.
- Built-in diagnostics and detailed logging for troubleshooting.
Use cases of MCP Web Worker Demo
- Demonstrating how to integrate MCP into a browser environment.
- Testing MCP features like tool calling and resource reading.
- Evaluating the performance benefits of offloading MCP to a worker.
- Prototyping multi-tab applications that share a single MCP connection.
评论