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

ocean-brain

v0.13.2

Published

<!-- npm package README for the public ocean-brain CLI.

Readme

ocean-brain CLI

The npm distribution for Ocean Brain. It provides two commands:

  • ocean-brain serve runs the packaged Ocean Brain web app and server.
  • ocean-brain mcp connects an MCP client to a running Ocean Brain instance over stdio.

For the product overview and screenshots, see the Ocean Brain project.

Requirements

Use Node.js 22.13+ or a newer LTS release. A global installation is not required; the examples below use npx.

serve

serve is the default command, so npx ocean-brain and npx ocean-brain serve are equivalent.

For a password-protected workspace, set both the shared workspace password and a separate session secret:

OCEAN_BRAIN_PASSWORD='choose-a-strong-password' \
OCEAN_BRAIN_SESSION_SECRET='paste-a-long-random-secret-here' \
npx -y ocean-brain serve --host 127.0.0.1

Open http://localhost:6683. Generate the session secret once—for example with openssl rand -hex 32—keep it private, and reuse it across restarts. Startup fails unless password mode or open mode is selected explicitly; do not enable both.

One running instance is one shared workspace. Password mode protects the entire instance with one shared password; it does not provide individual accounts, roles, or per-note permissions. If you bind beyond localhost, keep password mode enabled and place Ocean Brain behind HTTPS.

Local-only open mode

Open mode has no login. Use it only on your own machine and keep the loopback binding:

npx -y ocean-brain serve \
  --host 127.0.0.1 \
  --allow-insecure-no-auth

Options and environment

| Setting | Behavior | |---|---| | -H, --host <host> | Bind address; defaults to 0.0.0.0 | | -p, --port <port> | Listen port; defaults to 6683 | | --allow-insecure-no-auth | Explicitly enable open mode | | HOST, PORT | Override their corresponding CLI options | | OCEAN_BRAIN_PASSWORD | Shared password for password mode | | OCEAN_BRAIN_SESSION_SECRET | Session secret required in password mode | | OCEAN_BRAIN_ALLOW_INSECURE_NO_AUTH=true | Environment equivalent of the open-mode flag | | OCEAN_BRAIN_DATA_DIR | Data directory; defaults to ~/.ocean-brain/data | | OCEAN_BRAIN_IMAGE_DIR | Uploaded-image directory; defaults to ~/.ocean-brain/assets/images | | DATABASE_URL | SQLite file URL; takes precedence over the database path derived from the data directory |

By default, notes are stored in ~/.ocean-brain/data/db.sqlite3 and uploaded images in ~/.ocean-brain/assets/images. The CLI creates the directories and applies bundled database migrations at startup. Stop Ocean Brain and back up both paths together; restore them while the server remains stopped.

Configure the embedding API URL and optional API key under Settings > Search. The saved key stays on the server and is not returned to the browser.

Deleted notes remain in Trash for 30 days. Note snapshots are retained for up to 7 days, with at most 10 snapshots per note. These recovery tools and individual exports do not replace a full backup.

For a long-lived installation, replace ocean-brain in the commands with an exact version such as [email protected].

mcp

The mcp command starts the built-in stdio MCP adapter that forwards tool calls to an existing Ocean Brain instance. It does not start the web app.

The MCP tools can search and read notes, query tags and properties, create notes, make targeted Markdown or metadata edits, and move notes to Trash.

First enable MCP access under Settings > MCP, issue a token, and save it to a local file. Then configure the MCP client, for example:

{
  "mcpServers": {
    "ocean-brain": {
      "command": "npx",
      "args": [
        "-y",
        "ocean-brain",
        "mcp",
        "--server",
        "http://localhost:6683",
        "--token-file",
        "/absolute/path/to/ocean-brain/mcp-token"
      ]
    }
  }
}

Set --server to the Ocean Brain URL reachable from the machine running the MCP client. Replace localhost when the instance is remote or behind a proxy.

Options

| Option | Behavior | |---|---| | -s, --server <url> | Ocean Brain server URL; defaults to http://localhost:6683 | | --token-file <path> | Read the bearer token from a file; takes precedence over --token | | --token <token> | Direct bearer-token fallback |

The built-in adapter expands token-file paths that begin with ~, $HOME, ${HOME}, %USERPROFILE%, or %HOME%. This keeps copied JSON configurations portable even when the MCP client does not run arguments through a shell. Settings > MCP can generate either macOS/Linux shell commands or Windows PowerShell commands.

Prefer --token-file so the token is not stored directly in client configuration. Ocean Brain keeps one active MCP token; rotating or revoking it immediately invalidates the previous token. For a long-lived MCP setup, pin an npm package version compatible with the requirement shown in Settings > MCP.

Links