Browser JavaScript Evaluator
This is a reference design for a MCP server that hosts a web page that connects back to the server via sse and allows Claude to execute javascript on the page.
Overview
This project provides a way to execute JavaScript code in a browser from Python using MCP (Model Control Protocol).
To use this project, add the MCP server to your Claude configuration and launch it. Then, open a browser and navigate to the provided local URL to connect to the web server.
- Executes arbitrary JavaScript code in the browser from Python. - Provides a REST API for executing JavaScript. - Supports Server-Sent Events (SSE) for real-time communication.
- Running JavaScript code snippets for testing and debugging.
- Integrating JavaScript execution into Python applications.
- Automating browser tasks using JavaScript.
Add to your AI client
Use these steps to connect Browser JavaScript Evaluator in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-py-sse-browser-control-matdmiller": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-py-sse-browser-control-matdmiller"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-py-sse-browser-control-matdmiller": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-py-sse-browser-control-matdmiller"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-py-sse-browser-control-matdmiller": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-py-sse-browser-control-matdmiller"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-py-sse-browser-control-matdmiller": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-py-sse-browser-control-matdmiller"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-py-sse-browser-control-matdmiller": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-py-sse-browser-control-matdmiller"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-py-sse-browser-control-matdmiller": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-py-sse-browser-control-matdmiller"
]
}
}
}FAQ
Is it safe to use this project?
This project can execute arbitrary JavaScript in your browser, which can be dangerous. Use at your own risk.
How do I run the web server independently?
You can run the web server independently by executing `python web_server.py` in your terminal.