- Home
- MCP servers
- Snippets
Snippets
- javascript
1
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"freakynit-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"
}
}
}
}Snippets MCP is a server for storing, searching, and managing code snippets using semantic search and traditional keyword matching. It helps you save, organize, and retrieve code snippets with fast, meaningful results, so you can quickly reuse ideas across projects.
How to use
You interact with Snippets MCP through your MCP client to add, search, and manage snippets. Start by saving snippets you frequently reuse, then search by intent or exact terms. Use semantic search to find snippets by meaning, and combine it with keyword filtering to narrow results by language or tags.
Typical usage patterns you can follow: 1) Add a snippet with its code, optional language, tags, and a short description to improve semantic search. 2) Search for related code by describing your goal in natural language or by keywords. 3) Filter results by language and tags to quickly find the most relevant snippet. 4) Update a snippet if its content or description changes, which also refreshes its embeddings for accurate future searches. 5) Delete a snippet you no longer need.
How to install
Prerequisites: you need a working Node.js environment. Install Node.js from the official source and verify Node.js and npm are available on your system.
Install the Snippets MCP package in your project or workspace.
Configure and run Snippets MCP through your MCP setup using the provided commands and environment variable. The following MCP configurations show how to run Snippets MCP as a local (stdio) server via your MCP runner.
Configuration and running notes
The Snippets MCP server can be run via MCP by adding a stdio configuration that executes the package with npx and passes the correct arguments. You can also run it via a Windows command shell if you are on Windows. The environment variable SNIPPETS_FILE_PATH controls where the JSON database with snippets and embeddings is stored.
Environment variable to configure: SNIPPETS_FILE_PATH
- Purpose: path to save snippets and embeddings in a JSON file
- Default: ~/.snippets-mcp-db.json if not provided
Examples and gotchas
If you want to run Snippets MCP via MCP, use the following configurations in your MCP setup. The HTTP and STDIO examples below show how to wire Snippets MCP into your environment.
Available tools
add-snippet
Adds a new code snippet to the database with code content, optional tags, language, and description to improve semantic search.
search-snippets
Searches for snippets using a hybrid of semantic similarity and keyword matching, with optional filters for tags, language, and date range.
update-snippet
Updates an existing snippet and re-generates embeddings if the code, tags, or description change.
delete-snippet
Deletes a snippet by its ID from the database.
get-snippet
Retrieves a single snippet by its ID.