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

s2-mcp

v0.0.2

Published

MCP server for S2.dev. Built with Deno's Rusty v8 for Code mode.

Readme

Connect AI agents to S2.dev

s2-mcp connects AI agents to S2, a durable stream store, through the Model Context Protocol (MCP). Agents can manage basins and streams, append records, and read stored or live data.

Install

Run the published package without a global installation:

npx s2-mcp

Or clone the repository and install from source:

git clone https://github.com/eersnington/s2-mcp.git
cd s2-mcp
just install 
# or 
cargo install --path crates/s2-mcp --locked --force

Install just to to be able to run this workspace commands easily.

s2-mcp --version

For local development use just mcp instead of s2-mcp.

Configure an MCP client

Configure the MCP to your preferred agent client like Codex, Claude Code, OpenCode, Pi, etc. Add two separate MCP servers for cloud and development:

{
  "s2-cloud": {
    "command": "npx",
    "args": ["s2-mcp"]
  },
  "s2-dev": {
    "command": "npx",
    "args": ["s2-mcp", "--dev"]
  }
}

Or if you have it installed from source:

{
  "s2-cloud": {
    "command": "s2-mcp"
  },
  "s2-dev": {
    "command": "s2-mcp",
    "args": ["--dev"]
  }
}

Cloud mode reads credentials saved by the S2 CLI.

Dev mode starts a temporary S2 Lite container when needed and reuses it for the MCP process lifetime. Docker or another compatible runtime like OrbStack or Apple Containers is required.

Modes

Code Mode is the default. The agent searches the S2 API, then runs a TypeScript program:

async function run() {
  return await S2.listStreams({ basin: "example-basin" });
}

If your agent client has it's own code mode executor, or if you use a specialized MCP executor, then you can use tools mode instead which exposes all S2 operations as MCP tools and disable code mode.

{
  "s2": {
    "command": "s2-mcp",
    "args": ["--mode", "tools"]
  }
}

CLI reference

s2-mcp [OPTIONS]

Connections

Choose a connection when the process starts. It cannot switch later.

  • Default (s2-mcp): uses S2 Cloud defaults. Reads the S2 CLI config. Honors S2_ACCESS_TOKEN.
  • Dev (s2-mcp --dev): starts a temporary S2 Lite container when needed and reuses it for the process lifetime. Requires Docker or a compatible runtime.
  • Existing endpoint (s2-mcp --dev --endpoint URL): uses one URL for account and basin APIs. Does not start a container.
  • Environment (s2-mcp --dev --from-env): requires both S2_ACCOUNT_ENDPOINT and S2_BASIN_ENDPOINT. A partial pair fails. Never falls back to Cloud.

--endpoint and --from-env require --dev and conflict with each other.

Options

  • --mode <MODE>: code (default) or tools
  • --readonly: hide operations that mutate state
  • --basin <BASIN>: restrict access to one basin
  • --allow-destructive: advertise destructive operations; has no effect with --readonly
  • --dev: use an isolated development connection
  • --endpoint <URL>: with --dev, connect both APIs to one existing server
  • --from-env: with --dev, read endpoints from the environment
  • --log-file <PATH>: write diagnostic logs to a file
  • -h, --help: print help
  • -V, --version: print version

Examples

Read-only Cloud access:

{
  "s2": {
    "command": "s2-mcp",
    "args": ["--readonly"]
  }
}

Tools Mode against one basin:

{
  "s2": {
    "command": "s2-mcp",
    "args": ["--mode", "tools", "--basin", "example-basin"]
  }
}

Development against a local S2 Lite you already run:

{
  "s2-dev": {
    "command": "s2-mcp",
    "args": ["--dev", "--endpoint", "http://127.0.0.1:8080"]
  }
}

Development from environment variables:

S2_ACCOUNT_ENDPOINT=http://account.internal:8080 \
S2_BASIN_ENDPOINT=http://basin.internal:8081 \
s2-mcp --dev --from-env

Read more

License

MIT