Browser MCP MCP server

Browser extension that enables real-time interaction with web pages, allowing retrieval of content as markdown, CSS styling modifications, and browser history searches.
Back to servers
Provider
Randy Lu
Release date
Apr 05, 2025
Language
TypeScript
Package
Stats
152 downloads
71 stars

A browser extension and MCP server that allows you to interact directly with your current browser session. This tool enables capabilities like extracting page content as markdown, modifying page styles, and searching browser history through a Model Context Protocol interface.

Installation

Setup MCP Configuration

To use the browser MCP server, you need to add it to your MCP configuration file:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@djyde/mcp-browser@latest"
      ]
    }
  }
}

Install the Extension

  1. Install the dependencies first:
pnpm i
  1. Build the extension for your browser:
cd extension

# For Chrome
npm run build

# For Edge
npm run build:edge

# For Firefox
npm run build:firefox

After building, locate the extension in the extension/.output directory and install it in your browser.

Install the Server

cd server

# Build the server
npm run build

The MCP server entry point will be available at server/dist/cli.js.

Using the Browser MCP

Once installed, the MCP server provides several tools to interact with your browser.

Available Tools

Get Current Page as Markdown

The get_current_page_markdown tool allows you to extract the content of the current page in markdown format.

Example prompt:

Summarize the current page.

Append CSS Styles

The append_style tool lets you inject custom CSS into the current page.

Example prompt:

Change the current page to dark mode.

Search Browser History

The history_search tool enables searching through your browser history.

Example prompt:

Search the browser history for "github".

Running the Server for Development

If you want to run the server in development mode:

cd server
npm run dev

This will start the MCP server locally, allowing you to test your interactions with the browser extension.

Troubleshooting

If you encounter issues with the extension or server:

  • Make sure both the extension is properly installed in your browser
  • Verify that the MCP configuration is correctly set up
  • Check that the server is running if you're using the local development version

For advanced usage and more detailed information about the available tools, refer to the source code in server/src/tools.ts.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later