npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@flymyai/mcp-server

v1.0.6

Published

FlyMyAI MCP Server for AI image generation with batch support

Readme

@flymyai/mcp-server

npm version License: MIT

MCP (Model Context Protocol) server for FlyMyAI image generation with batch support.

Features

  • Single Image Generation - Generate images from text prompts
  • Batch Processing - Generate multiple images in parallel with configurable concurrency
  • Automatic Retries - Built-in retry logic with exponential backoff
  • Rate Limit Handling - Respects API rate limits with automatic backoff
  • Comprehensive Logging - Configurable log levels for debugging
  • Highly Configurable - Environment variables for all settings

Installation

npm install -g @flymyai/mcp-server
# or
npx @flymyai/mcp-server

Quick Start

  1. Get your API key from FlyMyAI

  2. Set the environment variable:

export FLYMYAI_API_KEY=your-api-key
  1. Run the server:
flymyai-mcp

Configuration with MCP Clients

opencode

Add to your opencode.jsonc:

{
  "mcp": {
    "flymyai": {
      "type": "local",
      "command": ["npx", "@flymyai/mcp-server"],
      "environment": {
        "FLYMYAI_API_KEY": "your-api-key"
      }
    }
  }
}

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "flymyai": {
      "command": "npx",
      "args": ["@flymyai/mcp-server"],
      "env": {
        "FLYMYAI_API_KEY": "your-api-key"
      }
    }
  }
}

Available Tools

flymyai_generate

Generate a single image from a text prompt.

Parameters: | Name | Type | Required | Default | Description | |------|------|----------|---------|-------------| | prompt | string | ✅ | - | Text description of the image | | model | string | | flymyai/flux-schnell | Model ID | | width | number | | 1024 | Image width (64-2048) | | height | number | | 1024 | Image height (64-2048) | | num_inference_steps | number | | - | Denoising steps (1-100) | | guidance_scale | number | | - | Prompt adherence (0-20) | | seed | number | | - | Random seed for reproducibility |

Examples:

Generate an image of a sunset over mountains with dramatic clouds
a cyberpunk city @dev
@schnell a quick sketch of a cat
realistic photo of mountains @hq

Model shortcuts in prompt: | Shortcut | Model | |----------|-------| | @schnell, @fast | flymyai/flux-schnell | | @dev, @hq, @quality | flymyai/flux-dev | | @sdxl, @lora | flymyai/sdxl-lora |

flymyai_batch

Generate multiple images in parallel.

Parameters: | Name | Type | Required | Description | |------|------|----------|-------------| | prompts | array/string | ✅ | Array of prompts or newline-separated string | | model | string | | Model ID for all prompts |

Input formats:

// Array of strings
["a red car", "a blue boat", "a green plane"]

// Array of objects with custom params
[
  {"prompt": "a cat", "params": {"width": 512}},
  {"prompt": "a dog", "params": {"seed": 42}}
]

// Newline-separated string
"a cat\na dog\na bird"

flymyai_models

List available image generation models.

Available Models

| Model ID | Name | Speed | Quality | |----------|------|-------|---------| | flymyai/flux-schnell | FLUX Schnell | Fast | Good | | flymyai/flux-dev | FLUX Dev | Slow | High | | flymyai/sdxl-lora | SDXL LoRA | Medium | High |

Environment Variables

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | FLYMYAI_API_KEY | ✅ | - | Your FlyMyAI API key | | FLYMYAI_BASE_URL | | https://api.flymy.ai/api/v1 | API base URL | | FLYMYAI_DEFAULT_MODEL | | flymyai/flux-schnell | Default model for generation | | FLYMYAI_MAX_CONCURRENCY | | 5 | Max parallel requests for batch | | FLYMYAI_MAX_RETRIES | | 3 | Max retry attempts | | FLYMYAI_RETRY_DELAY_MS | | 1000 | Initial retry delay (ms) | | FLYMYAI_TIMEOUT_MS | | 120000 | Request timeout (ms) | | FLYMYAI_LOG_LEVEL | | info | Log level: debug, info, warn, error, silent |

Programmatic Usage

You can also use the client directly in your Node.js applications:

import { FlyMyAIClient, loadConfig } from '@flymyai/mcp-server'

const config = loadConfig()
const client = new FlyMyAIClient(config)

// Single image
const result = await client.generate({
  prompt: "a beautiful sunset",
  width: 1024,
  height: 1024,
})
console.log(result.image) // base64 string

// Batch generation
const results = await client.generateBatch([
  { id: "1", prompt: "a cat" },
  { id: "2", prompt: "a dog" },
  { id: "3", prompt: "a bird" },
])

Error Handling

The server includes comprehensive error handling:

  • ValidationError: Invalid input parameters
  • APIError: FlyMyAI API errors (with automatic retry for 5xx errors)
  • TimeoutError: Request timeout (retryable)
  • RateLimitError: Rate limit exceeded (automatic backoff)

Development

# Clone the repository
git clone https://github.com/FlyMyAI/flymyai-mcp-server.git
cd flymyai-mcp-server

# Install dependencies
npm install

# Build
npm run build

# Run locally
FLYMYAI_API_KEY=your-key npm start

# Watch mode
npm run dev

License

MIT © FlyMyAI