npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

margin-mcp-server

v2.2.0

Published

MCP server that exposes Margin browser automation tools to Claude Code, Codex, Cursor, and other MCP clients.

Downloads

577

Readme

margin-mcp-server

MCP server for the Margin Chrome extension. It lets MCP clients — Claude Code, Codex, Cursor, and others — drive your real browser through Margin: take page snapshots, click and fill elements, navigate, inspect network traffic, and more.

How it works

MCP client  ──stdio──▶  margin-mcp-server  ◀──ws://127.0.0.1──  Margin extension

The server speaks MCP over stdio to your client and accepts one mutually authenticated WebSocket connection from the Margin extension on loopback. Tool definitions are pushed by the extension at connect time, so the server never goes stale when Margin adds or changes tools — it exposes exactly what your extension version implements and what you have enabled in Margin's Tool Access settings. No tools are exposed until the extension connects and authenticates.

Setup

  1. Install the Margin extension and open Settings → MCP Server Connector.
  2. Enable the bridge and copy the generated shared secret (32+ bytes, required).
  3. Add the server to your MCP client:
{
  "mcpServers": {
    "margin": {
      "command": "npx",
      "args": ["-y", "margin-mcp-server@latest"],
      "env": {
        "MARGIN_MCP_PORT": "9229",
        "MARGIN_MCP_TOKEN": "paste-token-from-extension-settings"
      }
    }
  }
}

For Claude Code: claude mcp add margin -e MARGIN_MCP_TOKEN=<token> -- npx -y margin-mcp-server@latest

Keep the Margin side panel open while tools run — the extension executes browser tools in the panel.

Environment variables

| Variable | Required | Default | Purpose | | --- | --- | --- | --- | | MARGIN_MCP_TOKEN | yes | — | Shared secret; must match the extension's generated token. It is never sent over the bridge | | MARGIN_MCP_PORT | no | 9229 | Loopback port the extension connects to | | MARGIN_MCP_HOST | no | 127.0.0.1 | Bind address (loopback only) |

Security

  • Binds to loopback only and rejects non-loopback peers, and browser connections must carry a chrome-extension:// origin.
  • The extension and the server authenticate each other with an HMAC-SHA256 challenge-response. The token is never transmitted: the extension sends a random nonce, the server answers with HMAC(token, "margin-bridge-server:" + clientNonce) and its own nonce, and the extension replies with HMAC(token, "margin-bridge-client:" + serverNonce). Both proofs are compared in constant time, and the distinct prefixes stop either side's proof from being replayed at the other. A process that squats the port learns nothing and is dropped by the extension before any tool traffic.
  • Tools disabled in Margin's Tool Access settings are neither listed nor callable — including web search — and pushed tool definitions are validated before being served.

Compatibility

Requires Margin extension v1.6 or newer, which performs the mutual handshake above and pushes tool schemas over the bridge. Older extensions fail authentication and cannot connect.

License

MIT