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

opencode-pencil-sync

v0.4.1

Published

Syncs Pencil MCP server port from ~/.claude.json to OpenCode config

Readme

opencode-pencil-sync

Automatic Pencil MCP server integration for OpenCode. Just install the plugin and Pencil works.

What it does

  1. Auto-setup: If Pencil is running but not configured, automatically adds it to your global config
  2. Auto-sync: If Pencil port changes, automatically updates the config
  3. Manual tools: Provides tools for the agent to manage Pencil integration

Installation

Add to your opencode.jsonc:

{
  "plugin": ["opencode-pencil-sync"]
}

That's it. When you start OpenCode with Pencil running, it will automatically configure itself.

Tools

pencil_status

Check current Pencil status. Shows:

  • Whether Pencil app is running
  • Current port from Pencil
  • Whether global/project configs have Pencil configured
  • Whether ports are in sync

pencil_setup

Add Pencil MCP server to OpenCode config. The agent will ask you:

"Do you want to add Pencil to your global config (all projects) or just this project?"

Parameters:

  • scope: "global" or "project"

Global: Adds to ~/.config/opencode/opencode.jsonc - Pencil available in all projects

Project: Adds to ./opencode.json - Pencil available only in this project

pencil_sync

Sync the port when Pencil restarts with a new port. Use this if Pencil tools fail with connection errors.

Requires Pencil to already be configured - use pencil_setup first if not.

How it works

  1. Pencil app writes its MCP config to ~/.claude.json when running
  2. Plugin reads the port and command from there
  3. Plugin adds/updates the config in OpenCode's config files
  4. Creates backup before any modification
  5. Validates changes before writing

Safety measures

  • Backup before write: Creates .pencil-sync.bak before any modification
  • JSONC validation: Validates structure before writing
  • Verification: Confirms changes took effect
  • Auto-rollback: Restores backup if verification fails
  • Read-only source: Never modifies ~/.claude.json

Typical workflow

Automatic setup (recommended):

  1. Start Pencil app
  2. Start OpenCode - plugin detects Pencil and auto-configures global config
  3. Restart OpenCode to load Pencil MCP tools
  4. Done

Manual setup (if auto-setup fails):

  1. User: "Set up Pencil for me"
  2. Agent calls pencil_setup with scope: "global" or scope: "project"
  3. Restart OpenCode to apply

Port sync after Pencil restart:

  1. User tries to use Pencil tools, gets connection error
  2. Plugin auto-syncs on next OpenCode startup, OR
  3. Agent calls pencil_sync manually
  4. Restart OpenCode to apply

Note on Pencil lifecycle

Pencil removes its config from ~/.claude.json when closed. This is expected:

  • Pencil closed: Plugin does nothing (no source config)
  • Pencil open: Plugin can read port and sync
  • Pencil restarted: Use pencil_sync to update port

Config locations

| Scope | Path | |-------|------| | Global | ~/.config/opencode/opencode.json, ~/.config/opencode/opencode.jsonc, ~/.config/opencode/config.json, ~/.config/opencode/config.jsonc | | Project | ./opencode.json, ./opencode.jsonc, ./config.json, ./config.jsonc | | Project (.opencode) | ./.opencode/opencode.json, ./.opencode/opencode.jsonc, ./.opencode/config.json, ./.opencode/config.jsonc |

The plugin checks for existing config files in the order listed above. If no config exists:

  • Global scope: Creates ~/.config/opencode/opencode.jsonc
  • Project scope: Creates ./opencode.json

Project config takes precedence over global config.

Troubleshooting

Plugin fails to add config automatically:

  • Ensure only one config file exists per scope (no duplicates like both opencode.json and config.json)
  • Check that the config file is valid JSONC
  • Try using pencil_setup tool manually

Pencil tools not available after setup:

  • OpenCode must be restarted to load new MCP servers
  • Check that Pencil app is running

Multiple config files detected:

  • The plugin will report conflicts and refuse to modify
  • Remove duplicate config files so only one remains per scope