BrowserCat MCP
BrowserCat MCP Server enables cloud-based browser automation for navigation, screenshots, and JavaScript execution without local installs. It allows LLMs to interact with web pages easily and securely.
How to Install and Use BrowserCat MCP
If you want to automate browser tasks using a cloud service without installing any browser on your computer, BrowserCat MCP is a great choice. It helps you open websites, click buttons, take screenshots, and even run JavaScript directly in a real browser online. Here’s an easy guide on how to install and start using BrowserCat MCP with some simple code examples.
Step 1: Get Your BrowserCat API Key
Before you start, you need to get an API key. This key lets you connect to the BrowserCat cloud browser service. You can get a free key by visiting https://browsercat.xyz/mcp. Keep this key safe because you’ll need it later.
Step 2: Set Up Environment Variable
After you get your API key, you need to tell your system about it. This is done by setting an environment variable called BROWSERCAT_API_KEY. This variable will be used by the BrowserCat MCP server when it runs.
If you are using a terminal, you can set this variable temporarily by running:
export BROWSERCAT_API_KEY="your-api-key-here"
Replace "your-api-key-here" with the actual key you got from the website.
Step 3: Run the BrowserCat MCP Server with NPX
Next, you will start the BrowserCat MCP server using npm's npx command. npx runs packages without needing to install them permanently.
You can start the server by running this command in your terminal:
npx -y @browsercatco/mcp-server
Make sure you have Node.js installed on your computer to use this command. This command uses your BROWSERCAT_API_KEY to connect to the BrowserCat service.
Step 4: Using BrowserCat MCP Tools
Now that the server is running, you can use different tools that BrowserCat MCP offers for browser automation. Here are some basic actions you can perform with the tool:
Navigate to a Webpage
You can tell the browser to open any URL by using the browsercat_navigate tool. It takes the URL as input.
Example input:
{
"url": "https://example.com"
}
Take Screenshots
You can capture a screenshot of the whole page or a specific part by using browsercat_screenshot. You provide a name for the screenshot and optionally a CSS selector for an element.
Example input:
{
"name": "homepage-image",
"selector": "header",
"width": 800,
"height": 600
}
Click on a Page Element
To simulate clicking a button or link, use browsercat_click with a CSS selector for the element.
Example input:
{
"selector": "#submit-button"
}
Fill Out a Text Field
You can fill in form fields using browsercat_fill, giving the CSS selector for the input and the text value you want to enter.
Example input:
{
"selector": "input[name='email']",
"value": "[email protected]"
}
Execute JavaScript Code
To run any JavaScript on the page, use browsercat_evaluate with your script as input.
Example input:
{
"script": "return document.title;"
}
Step 5: Accessing Logs and Screenshots
BrowserCat MCP also lets you access output resources:
- Console logs are available as text at
console://logs. - Screenshots can be accessed using
screenshot://<name>, where<name>is what you chose when taking a screenshot.
By following these simple steps, you can quickly set up and start automating browser tasks remotely with BrowserCat MCP without needing to install local browsers. Just remember to get your API key, run the server with your key, and use the tools provided to control the browser efficiently.