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

@sobree/mcp

v0.1.17

Published

MCP server for Sobree — exposes a Y.Doc-backed editor's mutations as Model Context Protocol tools so LLMs can read and edit a Sobree document.

Downloads

2,307

Readme

@sobree/mcp

MCP (Model Context Protocol) server for Sobree.

→ Docs: docs.sobree.dev/api/mcp

Lets an LLM (Claude Desktop, Anthropic API tool-use, any MCP-aware client) read and edit a Sobree document via standardized tool calls. Internally wraps HeadlessSobree, so the same Y.Doc + UndoManager + per-peer-undo guarantees apply: the LLM's Cmd+Z-equivalent reverses only its own edits, never the human's.

Install

pnpm add @sobree/mcp
# or globally so the binary is on PATH:
pnpm add -g @sobree/mcp

CLI

# Local mode — LLM edits its own ephemeral document.
sobree-mcp

# Collab mode — connect to a running @sobree/collab-server.
# The LLM edits live alongside human peers.
sobree-mcp --ws-url ws://localhost:1234 --room demo

Wiring into Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent on your platform:

{
  "mcpServers": {
    "sobree": {
      "command": "npx",
      "args": ["-y", "@sobree/mcp", "--ws-url", "ws://localhost:1234", "--room", "demo"]
    }
  }
}

Restart Claude. The model will see Sobree's tools in its tool palette and can read / mutate the document by calling them.

For the "edit alongside a human" pattern: run @sobree/collab-server locally, point your browser editor at it (?mode=collab in the playground), and configure Claude as above with the same room id. Both peers see each other's edits in real time.

As a library

import * as Y from "yjs";
import { WebsocketProvider } from "y-websocket";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { createSobreeMcpServer } from "@sobree/mcp";

const ydoc = new Y.Doc();
new WebsocketProvider("ws://localhost:1234", "doc-123", ydoc);

const { server, sobree } = createSobreeMcpServer({ ydoc, origin: "agent" });

const transport = new StdioServerTransport();
await server.connect(transport);

// Optional: do non-MCP-mediated work via `sobree`
sobree.on("change", ({ doc, local }) => {
  if (!local) console.log("human typed; new state:", doc.body.length, "blocks");
});

Tools

| name | description | | ----------------------------- | ------------------------------------------------------------- | | get_document | Read all blocks (id, kind, plain text preview, length). | | get_outline | Read the heading outline. | | insert_paragraph_after | Insert a new plain-text paragraph after a block. | | insert_paragraph_before | Insert a new plain-text paragraph before a block. | | replace_paragraph | Replace a paragraph's content with new plain text. | | delete_block | Delete a block by id. | | set_paragraph_alignment | Set alignment (left / center / right / both / distribute). | | undo | Reverse the last LLM-made edit (per-peer undo). | | redo | Re-apply the most recently undone LLM edit. |

The tool surface is intentionally small for v0. Future versions add formatted runs (bold, color, headings), images, tables, and richer structural ops.

Per-peer undo

Y.UndoManager's trackedOrigins is set to this peer's origin (default "mcp"). The undo tool reverses only edits this peer made — the human's parallel edits flow through but never end up on the LLM's undo stack. So if the LLM regrets a paragraph it added, calling undo removes that paragraph cleanly without touching what the human did meanwhile.

License

MIT.