mcp-code-snippets

MCP.Pizza Chef: ngeojiajun

mcp-code-snippets is an MCP client that manages code snippets across various programming languages. It enables creating, listing with filters, and deleting snippets via a standardized interface. Featuring localization support and persistent local storage, it simplifies snippet management for developers in real-time workflows.

Use This MCP client To

Create and save reusable code snippets with metadata List code snippets filtered by language or tags Delete obsolete or unwanted code snippets by ID Persist code snippets locally for offline access Support multi-language snippet management in development environments

README

Code Snippet Server

Overview

Code Snippet Server is a Model Context Protocol (MCP) server designed to manage and store code snippets across different programming languages. It provides a flexible and extensible way to create, list, and delete code snippets using a standardized server interface.

Code Snippet Server MCP server

Features

  • Create code snippets with title, language, and code
  • List snippets with optional filtering by language or tag
  • Delete snippets by their unique ID
  • Localization support
  • Persistent local storage

Prerequisites

  • Node.js (18.x, 20.x, or 22.x)
  • npm

Installation

git clone git@github.com:ngeojiajun-deriv/mcp-code-snippets.git
npm run build
npm link

Usage

The server exposes three primary tools:

1. Create Snippet

Create a new code snippet with a title, language, and code.

Parameters:

  • title (required): Name of the snippet
  • language (required): Programming language
  • code (required): The actual code snippet
  • tags (optional): Array of tags for categorization

2. List Snippets

Retrieve a list of snippets with optional filtering.

Parameters:

  • language (optional): Filter snippets by programming language
  • tag (optional): Filter snippets by tag

3. Delete Snippet

Remove a snippet from storage.

Parameters:

  • id (required): Unique identifier of the snippet to delete

Development

Build

npm run build

Lint

npm run lint

Contributing

Any PRs are welcome

mcp-code-snippets FAQ

How do I install mcp-code-snippets?
Clone the repository, run npm build, then npm link to install dependencies and link the client locally.
What programming languages does mcp-code-snippets support?
It supports any programming language as snippets are stored as plain text with language metadata.
Can I filter snippets by tags or language?
Yes, the client supports listing snippets with optional filtering by language or tags for easy retrieval.
Does mcp-code-snippets support localization?
Yes, it includes localization support to adapt to different languages and regions.
How is snippet data stored?
Snippets are stored persistently in local storage to ensure data is retained across sessions.
What are the primary operations supported?
Creating, listing, and deleting code snippets are the main operations exposed by the client.
Is mcp-code-snippets compatible with Node.js?
Yes, it requires Node.js versions 18.x, 20.x, or 22.x to run properly.