Skip to main content
Glama
Grayhood144

Snippet Saver

by Grayhood144

Snippet Saver MCP Server

A Model Context Protocol (MCP) server that lets AI coding tools save, list, and read code snippets. Build your personal code snippet library that Claude Code, Cursor, and other MCP-compatible tools can access.

What It Does

This MCP server provides three tools:

  1. save_snippet - Save a code snippet with a name, language, and optional description

  2. list_snippets - View all your saved snippets

  3. read_snippet - Read a specific snippet back

Snippets are stored as individual files in ~/snippets/ directory for easy access.

Related MCP server: Doclea MCP

Installation

  1. Clone or download this project

  2. Install dependencies:

    cd snippet-saver
    npm install
  3. Configure Claude Code (choose one method):

    Method A: Using command line (recommended)

    claude mcp add --transport stdio snippet-saver -- node C:\Users\Grays\mcp-projects\snippet-saver\index.js

    Method B: Manual configuration Create or edit .mcp.json in your project root:

    {
      "mcpServers": {
        "snippet-saver": {
          "command": "node",
          "args": ["C:\\Users\\Grays\\mcp-projects\\snippet-saver\\index.js"]
        }
      }
    }
  4. Reconnect servers in Claude Code:

    • Type /mcp in Claude Code

    • Or start a new session

Usage Examples

Save a Snippet

Claude, save this React hook as a snippet:

const useLocalStorage = (key, initialValue) => {
  const [value, setValue] = useState(() => {
    const item = localStorage.getItem(key);
    return item ? JSON.parse(item) : initialValue;
  });

  useEffect(() => {
    localStorage.setItem(key, JSON.stringify(value));
  }, [key, value]);

  return [value, setValue];
};

Name it "useLocalStorage", language "javascript"

List All Snippets

Claude, what snippets do I have saved?

Read a Snippet

Claude, show me the useLocalStorage snippet

How It Works

  • Snippets are stored in ~/snippets/ (your home directory)

  • Each snippet is saved as a separate file with the language extension

  • Metadata (name, language, description, date) is included as comments

  • Works with any MCP-compatible AI coding tool

Limitations

  • Snippets are stored as plain text files (no database)

  • No search functionality yet

  • Cannot update existing snippets (must save new version)

  • No categorization or tagging system

Requirements

  • Node.js v16 or higher

  • Claude Code or another MCP-compatible tool

Available Tools

3 tools
list_snippetsA

List all saved code snippets in your library

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It implies a read-only operation (listing snippets) which is non-destructive. However, it omits details such as whether results are paginated, sorted, or include full snippet content vs. metadata. The description is adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, succinct sentence conveys the entire purpose with no extraneous words. It is front-loaded and efficient, earning its place without waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description is somewhat complete but lacks details about the return format, pagination, or ordering. For a list operation, such context would be helpful. The minimalism leaves gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100% (trivially). Baseline score of 4 for no parameters is appropriate; the description adds no parameter info because none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a clear verb 'List' and specific resource 'all saved code snippets in your library', which unambiguously states the tool's function. It naturally distinguishes from siblings like read_snippet (which likely retrieves a single snippet) and save_snippet.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus alternatives like read_snippet or save_snippet. The description merely states what it does without context for decision-making, leaving the agent to infer usage from sibling tool names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_snippetA

Read a specific code snippet from your library

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesName of the snippet to read (without file extension)

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description does not disclose behavioral traits such as read-only nature, error handling on missing snippet, or required permissions. Minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no wasted words. Front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with one parameter and no output schema, the description is largely complete. Missing details about return value or behavior on failure, but acceptable given simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'name' is fully described in the schema (coverage 100%). The description adds 'specific' and 'from your library' but no meaningful extra semantics beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads a specific snippet from the library, with a verb and resource. Sibling names list_snippets and save_snippet further distinguish it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus list_snippets or save_snippet. The purpose is implied by the name, but lacking direct context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

save_snippetA

Save a code snippet to your snippets library. The snippet will be saved as a file in ~/snippets/

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesThe code snippet to save
nameYesName for the snippet (will be used as filename)
languageYesProgramming language (e.g., javascript, python, java)
descriptionNoOptional description of what this snippet does

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It reveals the file location (~/snippets/), which adds value, but does not disclose behavior on conflicts (e.g., overwrite), permissions, or side effects. Basic but incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, both essential: the action and the storage location. No redundant information. Efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple nature of a save operation and a fully-described schema, the description covers the key context (where it saves). It lacks details on overwrite behavior or error handling, but these are minor for this tool. Still above average.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, parameters are already well-documented. Description adds no extra meaning beyond what the schema states, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: 'Save a code snippet to your snippets library.' It specifies the resource (code snippet) and destination (~/snippets/), distinguishing it from sibling tools list_snippets and read_snippet which retrieve or view snippets.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While the description implies usage for saving snippets, it provides no explicit guidance on when to use this tool versus alternatives. Siblings are different operations, so context is implied, but no when-not-to-use or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • First observedlist_snippets
    • First observedread_snippet
    • First observedsave_snippet

TDQS

A3.9/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clear and distinct purpose: listing all snippets, reading a specific snippet, and saving a new snippet. There is no overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (list_snippets, read_snippet, save_snippet) with underscore separation, making them predictable.

Tool Count4/5

With 3 tools covering list, read, and create operations, the count is reasonable for a simple snippet library. It is slightly minimal but not inappropriate.

Completeness3/5

The set covers core operations (list, read, save) but lacks update and delete functionality, which are notable gaps for a snippet management tool.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    An MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.
    15
    303
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A local MCP server providing persistent memory for AI coding assistants by storing and searching architectural decisions, patterns, and solutions. It also includes tools for git automation and mapping codebase expertise based on project history.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A local MCP server that provides AI coding assistants with semantic search capabilities over codebases. It indexes code using local embeddings and exposes tools for efficient code retrieval, saving tokens and improving response quality.
    31
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables AI agents to navigate and understand codebases through file descriptions, semantic search, and code recommendations without repeatedly scanning files.
    MIT