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

@freakynit/snippets-mcp

v1.0.0

Published

MCP server for storing, searching, and managing code snippets using AI-powered semantic search and traditional keyword matching. Just ask your coding agent to save or search a certain snippet. That's it.

Readme

Snippets MCP

  • MCP server for storing, searching, and managing code snippets using semantic search and traditional keyword matching.
  • Just tell your coding agent (claude code, cursor, cline, opencode, etc.) to save a certain snippet. That's it.
  • When needed, just tell it to search for code snippets related to: your query.

Features

  • Semantic search using AI embeddings to find snippets by meaning, not just keywords
  • Hybrid search combining semantic similarity and keyword matching
  • Automatic programming language detection
  • Tag-based organization and filtering
  • Date range filtering
  • No database needed. JSON based storage.
  • Vector embeddings cached for fast retrieval

Installation

npm install @freakynit/snippets-mcp

Available Tools

add-snippet

Adds a new code snippet to the database.

Parameters:

  • code (string, required) - The code content
  • tags (array, optional) - Array of tag strings
  • language (string, optional) - Programming language (auto-detected if not provided)
  • description (string, optional) - Text description for better semantic search

search-snippets

Searches snippets using hybrid semantic and keyword matching.

Parameters:

  • query (string, optional) - Natural language search query
  • tags (array, optional) - Filter by specific tags (AND logic)
  • language (string, optional) - Filter by programming language
  • dateStart (ISO date string, optional) - Filter by creation date start
  • dateEnd (ISO date string, optional) - Filter by creation date end
  • limit (number, optional) - Maximum results to return (default: 10)

update-snippet

Updates an existing snippet. Re-generates embeddings if code, tags, or description change.

Parameters:

  • id (string, required) - Snippet ID
  • updates (object) - Object containing fields to update (code, tags, language, description)

delete-snippet

Deletes a snippet from the database.

Parameters:

  • id (string, required) - Snippet ID

get-snippet

Retrieves a single snippet by ID.

Parameters:

  • id (string, required) - Snippet ID

Environment Variables

  1. SNIPPETS_FILE_PATH: Optional, Full path to file to save snippets and embeddings in. Defaults to ~/.snippets-mcp-db.json.

How It Works

The library uses a hybrid search approach:

  1. Semantic Search (70% weight) - Uses the all-MiniLM-L6-v2 model to perform vector searh against embeddings generated off code, description, tags and language.
  2. Keyword Matching (30% weight) - Traditional text matching for exact term matches based on code and tags.
  3. Hard Filters - Applied first to narrow results by tags, language, and date range.

Embeddings are generated once when adding/updating snippets and cached for fast retrieval.

Storage

Snippets are stored in a JSON file specified by environment variable SNIPPETS_FILE_PATH, or at default path: ~/.snippets-mcp-db.json with the following structure:

{
  "id": "uuid",
  "code": "string",
  "language": "string",
  "tags": ["array"],
  "description": "string",
  "embedding": [/* vector array */],
  "createdAt": "ISO date",
  "updatedAt": "ISO date"
}

Configuring using mcpServers json

For Mac and Linux

{
  "mcpServers": {
    "snippets-mcp": {
      "command": "npx",
      "args": ["-y", "@freakynit/snippets-mcp@latest"],
      "env": {
        "SNIPPETS_FILE_PATH": "Optional... path to save snippets and embeddings in.. should have .json extension"
      }
    }
  }
}

For Windows

{
  "mcpServers": {
    "snippets-mcp": {
      "command": "cmd",
      "args": ["/k", "npx", "-y", "@freakynit/snippets-mcp@latest"],
      "env": {
        "SNIPPETS_FILE_PATH": "Optional... path to save snippets and embeddings in.. should have .json extension"
      }
    }
  }
}

License

MIT