Labsco
falahgs logo

3D Cartoon Generator & File System Tools

โ˜… 3

from falahgs

Generates 3D-style cartoon images using Google's Gemini AI and provides secure file system operations.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

MCP Combined Server: 3D Cartoon Generator & File System Tools

A professional-grade server that provides two major capabilities:

  1. High-quality 3D-style cartoon image generation using Google's Gemini AI
  2. Secure file system operations for reading, writing, and managing files

3D Cartoon Generator Demo

๐ŸŒŸ Features

Image Generation

  • 3D Cartoon Generation: Creates high-quality 3D-style cartoon images
  • Child-Friendly Design: Focuses on colorful, playful, and engaging visuals
  • Instant Preview: Automatically opens generated images in your default browser
  • Local Storage: Saves images and previews in an organized output directory

File System Operations

  • Secure File Access: Path validation and security checks
  • Read/Write Files: Read and write text file contents
  • Directory Operations: List, create, and navigate directories
  • File Search: Find files matching patterns

System Features

  • Professional Configuration: Robust error handling and controlled logging
  • Cross-Platform Support: Intelligent file path handling for Windows, macOS, and Linux
  • Smart OS Detection: Automatically finds the best save location for each operating system
  • Security Controls: Restricted directory access through configuration

๐Ÿ› ๏ธ Technical Stack

  • Core Framework: Model Context Protocol (MCP) SDK
  • AI Integration: Google Generative AI (Gemini)
  • Runtime: Node.js v14+
  • Language: TypeScript
  • Package Manager: npm

๐Ÿš€ Available Tools

1. Image Generation Tool

{
  "name": "generate_3d_cartoon",
  "description": "Generates a 3D style cartoon image for kids based on the given prompt",
  "inputSchema": {
    "type": "object",
    "properties": {
      "prompt": {
        "type": "string",
        "description": "The prompt describing the 3D cartoon image to generate"
      },
      "fileName": {
        "type": "string",
        "description": "The name of the output file (without extension)"
      }
    },
    "required": ["prompt", "fileName"]
  }
}

2. File System Tools

Read File

{
  "name": "read_file",
  "description": "Read the contents of a file",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "Path to the file to read"
      }
    },
    "required": ["path"]
  }
}

Write File

{
  "name": "write_file",
  "description": "Write content to a file",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "Path to the file to write"
      },
      "content": {
        "type": "string",
        "description": "Content to write to the file"
      }
    },
    "required": ["path", "content"]
  }
}

List Directory

{
  "name": "list_directory",
  "description": "List the contents of a directory",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "Path to the directory to list"
      }
    },
    "required": ["path"]
  }
}

Create Directory

{
  "name": "create_directory",
  "description": "Create a new directory",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "Path to the directory to create"
      }
    },
    "required": ["path"]
  }
}

Search Files

{
  "name": "search_files",
  "description": "Search for files matching a pattern",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "Base directory to search from"
      },
      "pattern": {
        "type": "string",
        "description": "Search pattern (glob format)"
      },
      "excludePatterns": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Patterns to exclude from search (glob format)"
      }
    },
    "required": ["path", "pattern"]
  }
}

๐Ÿ”’ Security Features

The server implements several security measures:

  1. Path Validation: All file paths are validated to ensure they are within allowed directories.
  2. Allowed Directories: Only directories explicitly set in the ALLOWED_DIRECTORIES environment variable can be accessed.
  3. Symlink Protection: Prevents access to directories outside the allowed scope via symlinks.
  4. Controlled Logging: Debug logs are disabled by default to prevent information leakage.

๐Ÿ“„ License

MIT License

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.