SnipMe Documentation

MCP & API Integration Guide

Integrate SnipMe with Cursor AI and use our REST API

MCP Integration - Cursor AI

What is MCP?

Model Context Protocol (MCP) allows AI assistants in Cursor and other tools to use external services. With SnipMe's MCP server, AI can create beautiful code snippet images directly in your editor.

Setup for Cursor

1Open Cursor Settings

  1. Open Cursor
  2. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  3. Search for "Preferences: Open User Settings (JSON)"

2Add MCP Configuration

Add the following to your settings.json file:

{
  "mcpServers": {
    "snipme": {
      "type": "streamablehttp",
      "url": "https://snapi.aniruddhadev.in/api/mcp"
    }
  }
}

3Restart Cursor

Close and reopen Cursor for changes to take effect.

4Test It Out

In Cursor AI Chat, try asking:

"Create a code snippet image with this Python code: print('Hello, World!')"

Also works with Claude Desktop

You can also use SnipMe with Claude Desktop. Configuration:

{
  "mcpServers": {
    "snipme": {
      "type": "streamablehttp",
      "url": "https://snapi.aniruddhadev.in/api/mcp"
    }
  }
}

Config file locations:
• macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
• Windows: %APPDATA%\Claude\claude_desktop_config.json
• Linux: ~/.config/Claude/claude_desktop_config.json

Example Prompts:

"Create a snippet with this JavaScript code using the ocean-deep template"

"Make a code image of this Python function with the neon-night style"

"Generate a snippet image for this TypeScript code with glassy editor style"

Troubleshooting:

MCP server not showing up in Cursor:

  • Check the configuration in settings.json is correct
  • Ensure you have Node.js installed
  • Restart Cursor completely
  • Check Cursor's output panel for errors

Tool not working:

  • Verify the API endpoint is accessible
  • Check your internet connection
  • Try using the REST API directly to test

REST API Guide

Base URL

https://snapi.aniruddhadev.in

Endpoint: POST /api/snippet

Generate beautiful code snippet images with customizable themes and templates.

Request Body:

{
  "code": "const hello = 'world';",
  "language": "javascript",
  "theme": "monokai",
  "templateName": "fire",
  "editorStyle": "classic",
  "format": "png"
}

Parameters:

ParameterRequiredDefaultDescription
code✅ Yes-The code to render
language❌ NojavascriptProgramming language
theme❌ NomonokaiColor theme
templateName❌ NofireBackground template
editorStyle❌ NoclassicEditor window style
format❌ NopngOutput format (png/jpeg/base64)

Quick Example:

curl -X POST https://snapi.aniruddhadev.in/api/snippet \
  -H "Content-Type: application/json" \
  -d '{"code": "console.log(\"Hello!\");", "language": "javascript"}' \
  --output snippet.png

Available Themes:

monokai
dracula
github-dark
nord
synthwave
tokyo-night
fire
coral
mono

Available Templates:

candy-dream
fire
flame-gradient
ocean-deep
neon-night
tokyo-sunset
dot-grid
flux-shader
coral-glow

Need more help? Check out our GitHub repository