MCP Server Capabilities

The Skfoldr MCP server provides four powerful tools for managing your code library directly from your IDE. This guide explains each tool, its parameters, return values, and usage examples.

Tool Overview

  • get-company-snippets: Retrieve all company snippets
  • get-snippet-content: Get the contents of a specific snippet
  • create-snippet-from-mcp: Create a new snippet from files or code content
  • search-snippets: Search for snippets by library name

1. get-company-snippets

Retrieves all company snippets from the system. Use this to discover available code snippets before selecting one to use.

Parameters

None required.

Returns

A list of all company snippets, each containing:

  • Snippet ID
  • Title and description
  • Creation and update timestamps
  • Associated libraries

Usage Example

// Ask AI: "Show me all available company snippets"
// The MCP server will return a list of all snippets
// that you can browse and select from

2. get-snippet-content

Retrieves the contents of a snippet by its ID. The snippet is stored as a base64-encoded zip file that gets extracted and returned as individual files with their contents.

Parameters

  • snippetId (number, required): The ID of the snippet to retrieve content for

Returns

Snippet description and all file contents extracted from the zip, including:

  • File paths and names
  • Complete file contents
  • Snippet metadata

Usage Example

// Ask AI: "Get the content of snippet ID 123"
// The MCP server will extract and return all files
// from the snippet's zip archive

3. create-snippet-from-mcp

Creates a snippet from files or code content. Accepts either file paths or code content (or both), packages them into a zip file, validates the total uncompressed size is under 5MB, and uploads via the GraphQL API.

Parameters

  • title (string, required): Title of the snippet
  • description (string, required): Description of the snippet
  • files (array of strings, optional): Array of file paths to include in the snippet
  • codeContent (array of objects, optional): Array of code content objects with path and content properties
  • filename (string, optional): Name for the zip file (default: "snippet.zip")
  • visibility (enum, optional): Visibility of the snippet - COMPANY_WIDE or USER_SPECIFIC (default: USER_SPECIFIC)

Returns

Created snippet details including:

  • Snippet ID
  • Title and description
  • File URL
  • Creation and update timestamps

Usage Example

// Ask AI: "Create a snippet from these files: 
// src/utils/auth.ts, src/components/Login.tsx"
// Or: "Create a snippet with this code content"
// The MCP server will package and upload the snippet

Note: The total uncompressed size of all files must be under 5MB. If it exceeds this limit, the operation will fail with a validation error.


4. search-snippets

Searches for snippets by library name. Returns snippets that match the specified library name. Supports optional pagination.

Parameters

  • libraryName (string, required): The library name to search for snippets
  • limit (number, optional): Maximum number of results to return
  • offset (number, optional): Number of results to skip for pagination

Returns

An array of matching snippets, each containing:

  • Snippet ID, title, and description
  • Associated library information
  • Timestamps

Usage Example

// Ask AI: "Search for snippets in the React library"
// Or: "Find all TypeScript snippets"
// The MCP server will return matching snippets

Best Practices

  • Use get-company-snippets first: Browse available snippets before retrieving specific content
  • Search before creating: Check if a similar snippet already exists before creating a new one
  • Provide clear descriptions: When creating snippets, use descriptive titles and descriptions for better discoverability
  • Use pagination: For large result sets, use limit and offset parameters to paginate through results

Common Use Cases

  • Code discovery: Find existing implementations before writing new code
  • Pattern reuse: Retrieve proven code patterns and adapt them to your current needs
  • Knowledge sharing: Save useful code snippets for your team to reuse
  • Library organization: Organize code by library or framework for easy discovery

Need help configuring the MCP server? See our configuration guide.

Skfoldr Logo

Skfoldr

Built by LJ Solutions Services LLC.