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

yhn-mcp

v0.1.0

Published

Model Context Protocol server for y.hn — lets Claude Code, Cursor, Cline and other AI agents create and manage short links.

Downloads

129

Readme

yhn-mcp

Model Context Protocol server for y.hn. Lets Claude Code, Cursor, Cline, and any other MCP-aware AI agent create and manage short links by talking to the y.hn API.

Quick start

  1. Generate an API key at https://y.hn/dashboard/settings.
  2. Add the server to your MCP client config (examples below).
  3. Restart the client. Type something like "Shorten https://example.com with custom slug demo" — the agent now has tools.

No global install needed; npx fetches the package on demand.

Claude Code

Add to ~/.claude.json (or your project .mcp.json):

{
  "mcpServers": {
    "yhn": {
      "command": "npx",
      "args": ["-y", "yhn-mcp"],
      "env": {
        "YHN_API_KEY": "yhn_..."
      }
    }
  }
}

Cursor

Settings → MCP → New MCP Server, paste the same JSON.

Cline / Continue / other MCP clients

Same JSON shape, drop into the client's MCP config. Anything that speaks stdio MCP works.

Available tools

| Tool | Purpose | |---|---| | whoami | Verify the API key, return plan + email | | create_link | Create a short link (url, optional customSlug, password, expiresAt, OG, UTM, tags) | | list_links | Paginated list with search / folder / tag filter | | get_link | Fetch one link by ID | | update_link | Patch any field (retarget, expire, archive, move folder) | | delete_link | Permanent delete | | get_link_stats | Time series + geo + device + referrer for one link | | bulk_create_links | Create many links in one call (CSV import / migration) | | get_qr_url | Returns a signed-style QR PNG URL for a link | | list_folders / create_folder | Folder management | | list_tags / create_tag | Tag management | | analytics_overview | Account-wide totals + top links | | analytics_geo | Country/city click breakdown | | list_conversion_goals / track_conversion | Server-side conversion events | | list_webhooks / create_webhook | Webhook subscriptions | | list_domains | Custom domains (Pro+) |

More endpoints (A/B test, geo/device routing rules, pixels, marketplace) are exposed via the raw y.hn API; ask if you'd like a tool for them.

Configuration

| env var | default | purpose | |---|---|---| | YHN_API_KEY | required | Your y.hn API key (yhn_...) | | YHN_BASE_URL | https://y.hn/api | Override for self-hosted / staging |

Examples

Once installed, you can prompt naturally:

Shorten https://huggingface.co/blog/agents and put it in folder Reading list.

Bulk-shorten the URLs in /path/to/links.txt, set utm_source=newsletter on all of them, and email me the resulting CSV.

What's my top performing link this week? Pull stats and tell me where the clicks came from.

The agent picks the right tool, calls it, and continues.

Development

npm install
npm run build
node dist/index.js   # smoke test (will exit because YHN_API_KEY missing)

License

MIT