Image2URL developer stack

SDK + CLI for instant image URLs

Official packages behind image2url.com: imgtourl (CLI), mcp-server-image2url (agents), @image2url/react (UI), and @image2url/next (API helpers). Upload once, share everywhere.

Global CDN

Edge cached

Security

TLS + MIME checks

Free tier

IP-based quotas

EEAT-ready: transparent limits, HTTPS by default, Cloudflare R2 storage, and structured outputs for reproducible workflows.

Signed uploads, cache headers, and filename sanitization baked in.
Web Terminal Simulator

Type npm install -g imgtourl and press Enter to simulate.

Step 1: simulate install. Step 2: try imgtourl logo.png for an upload with a green URL output.

SDK lineup

Consistent responses across CLI, MCP, React, and Next.js.

imgtourl (CLI)

Zero-config global CLI. Turn any file path into a CDN-backed URL.

$ npm install -g imgtourl
imgtourl hero.png

Ideal for CI scripts, docs authors, and quick terminal uploads.

mcp-server-image2url

Drop-in MCP server for Claude or any MCP client.

$ npx -y mcp-server-image2url
upload_image {"path": "/tmp/screenshot.png"}

Returns URL + Markdown/HTML/BBCode snippets in structured MCP output.

@image2url/react

React hook for drag-and-drop uploads with progress state.

$ npm install @image2url/react
const { upload, status } = useImage2URL();

Client-friendly, works with fetch, keeps bundle small.

@image2url/next

Server-first helper that signs and streams uploads inside Next.js routes.

$ npm install @image2url/next
await uploadImage({ file, alt })

API Route / Route Handler ready; caches and enforces size caps.

React quick start

Progressive enhancement: drop-in hook plus drag-and-drop. Keep uploads off your backend or override the endpoint for private deployments.

import { useImage2URL } from '@image2url/react';

export function ImageUploader() {
  const { upload, status, result, error } = useImage2URL({
    uploadUrl: 'https://www.image2url.com/api/upload',
  });

  async function handleFile(file) {
    await upload({ file, alt: 'hero banner' });
  }

  return (
    <div>
      <input type="file" accept="image/*" onChange={(e) => e.target.files && handleFile(e.target.files[0])} />
      <p>{status === 'uploading' ? 'Uploading…' : null}</p>
      {result?.url && <a href={result.url}>{result.url}</a>}
      {error && <span>{error}</span>}
    </div>
  );
}
Next.js Route Handler

Keep uploads server-side to avoid exposing tokens. Works in API Routes or Route Handlers with streaming responses and cache headers.

import { uploadImage } from '@image2url/next';
import { NextResponse } from 'next/server';

export async function POST(request: Request) {
  const data = await request.formData();
  const file = data.get('file');

  if (!(file instanceof File)) {
    return NextResponse.json({ error: 'Missing file' }, { status: 400 });
  }

  const result = await uploadImage({
    file,
    alt: 'marketing-banner',
    endpoint: 'https://www.image2url.com/api/upload',
  });

  return NextResponse.json(result);
}

Security & trust

HTTPS by default, MIME validation, filename encoding, and Cache-Control headers tuned for CDNs. Structured errors make observability easy.

Ready for SEO & embeds

Links are CDN-cached and stable, perfect for blogs, docs, wikis, and social embeds without base64 bloat.

Consistent output

Every package returns URL, Markdown, HTML, BBCode, filename, mimeType, and uploadedAt so your workflows stay deterministic.

FAQ

What is Image2URL?

Image2URL turns any file or remote image URL into a permanent HTTPS link plus Markdown/HTML snippets. The SDK stack wraps that endpoint for CLI, MCP, React, and Next.js.

Is there a free tier?

Yes. The default endpoint on image2url.com provides IP-based free quota so you can test locally without tokens.

Can I self-host?

Set IMAGE2URL_BASE_URL or IMAGE2URL_UPLOAD_URL to point at your own deployment or Cloudflare R2 bucket. The CLI, MCP server, and SDKs respect these env vars.

Which formats are returned?

Direct URL plus Markdown, HTML, and BBCode strings. Structured responses include filename, mimeType, size, uploadedAt, and uploadEndpoint.

How are files validated?

Images must present a valid image/* MIME type. Default size cap is 2 MB; you can override via IMAGE2URL_MAX_BYTES in self-hosted deployments.

Is the SDK production ready?

Yes. Built on HTTPS with cache-friendly headers, integrity checks, and clear error messages. Used by image2url.com itself.