概览
What is Browser JavaScript Evaluator?
Browser JavaScript Evaluator is an MCP (Model Control Protocol) server that lets you execute arbitrary JavaScript code in a browser from Python. It uses a web server with SSE (Server-Sent Events) and a REST API to relay code to a connected browser and return results.
How to use Browser JavaScript Evaluator?
Add the server to your Claude Desktop configuration using uv pointing to the repository directory and the browser_server.py script. After launching Claude, open a browser to http://127.0.0.1:8000 to connect. The server provides two tools: execute_javascript (run any JavaScript) and add_numbers (add two numbers via browser execution).
Key features of Browser JavaScript Evaluator
- Executes arbitrary JavaScript in a connected browser
- Provides two MCP tools: execute_javascript and add_numbers
- Uses SSE for real-time communication with the browser
- Returns results synchronously via REST API
- Web server and MCP server are split into separate components
Use cases of Browser JavaScript Evaluator
- Perform browser‑based calculations from an MCP client (e.g., add_numbers)
- Run custom JavaScript to manipulate or inspect a live browser page
- Test and debug JavaScript code in a real browser environment
- Automate browser interactions within an AI‑assisted workflow
FAQ from Browser JavaScript Evaluator
What does Browser JavaScript Evaluator do?
It allows you to execute JavaScript code in a browser from Python via MCP. A web server sends code to a connected browser using SSE, and the browser returns results.
How do I install and run it?
Add the server to your Claude config with the uv command pointing to the repository, then launch Claude. Open a browser at http://127.0.0.1:8000 to connect. Alternatively, run python web_server.py to start only the web server.
What MCP tools are available?
Two tools: execute_javascript (runs any JavaScript) and add_numbers (adds two numbers using JavaScript).
Is there a security warning?
Yes. The server can execute arbitrary JavaScript in your browser, which is potentially dangerous. Use at your own risk and be aware of the implications.
What are the dependencies or runtime requirements?
The server runs with Python and uses the uv package manager. A browser must be open and connected to the web server (default at port 8000) for code execution to work.