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

snapas-mcp-server

v1.0.0

Published

MCP server for Snap.as photo hosting with Write.as authentication

Readme

Snap.as MCP Server

A Model Context Protocol (MCP) server for uploading photos to Snap.as using Write.as authentication.

Features

  • Upload JPG, PNG, or GIF images (max 10MB) to Snap.as
  • Automatic Write.as authentication with short-lived access tokens
  • Returns public URLs for uploaded photos
  • Configurable response formats (Markdown or JSON)
  • Comprehensive error handling with actionable messages

Installation

NPX Usage (Recommended)

No installation required! Use directly with npx:

npx snapas-mcp-server

Local Installation

npm install -g snapas-mcp-server

Configuration

The server requires Write.as credentials for authentication. Set these environment variables:

export WRITEAS_USERNAME="your-username"
export WRITEAS_PASSWORD="your-password"

Security Note: Access tokens are short-lived and obtained automatically on each request. Never store or configure access tokens directly.

Usage

As an MCP Server

Add to your MCP client configuration (e.g., Claude Desktop):

{
  "mcpServers": {
    "snapas": {
      "command": "npx",
      "args": ["snapas-mcp-server"],
      "env": {
        "WRITEAS_USERNAME": "your-username",
        "WRITEAS_PASSWORD": "your-password"
      }
    }
  }
}

Available Tools

snapas_upload_photo

Upload an image file to Snap.as and receive a public URL.

Parameters:

  • file_path (string, required): Absolute path to the image file
  • username (string, optional): Write.as username (overrides env variable)
  • password (string, optional): Write.as password (overrides env variable)
  • response_format (string, optional): Output format - "json" (default) or "markdown"

Example Usage:

// Via MCP tool call (default JSON response)
{
  "file_path": "/Users/username/photos/sunset.jpg"
}

Response (JSON format - default):

{
  "id": "abc123",
  "filename": "sunset.jpg",
  "size": 245760,
  "url": "https://i.snap.as/abc123.jpg"
}

Response (Markdown format):

// Via MCP tool call with markdown response
{
  "file_path": "/Users/username/photos/sunset.jpg",
  "response_format": "markdown"
}
## Photo Uploaded Successfully

**URL:** https://i.snap.as/abc123.jpg
**ID:** abc123
**Filename:** sunset.jpg
**Size:** 240.00 KB

You can access the photo at: https://i.snap.as/abc123.jpg

Supported File Types

  • JPG/JPEG (.jpg, .jpeg)
  • PNG (.png)
  • GIF (.gif)

Maximum file size: 10MB

Error Handling

The server provides clear, actionable error messages:

  • Authentication failed: Invalid Write.as credentials (HTTP 401)
  • File not found: The specified file path doesn't exist
  • Unsupported file type: File must be JPG, PNG, or GIF
  • File exceeds 10MB limit: File is too large
  • Rate limit exceeded: Too many requests (HTTP 429)
  • Access denied: Insufficient permissions (HTTP 403)

Development

Prerequisites

  • Node.js >= 18
  • npm

Setup

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

# Install dependencies
npm install

# Run tests
npm test

# Build
npm run build

# Test locally
npm start

Testing

The project uses Vitest with comprehensive test coverage:

# Run tests once
npm test

# Watch mode
npm run test:watch

# Coverage report
npm run test:coverage

Project Structure

snapas-mcp-server/
├── src/
│   ├── __tests__/          # Test files
│   │   ├── services/
│   │   └── utils/
│   ├── services/           # API clients
│   │   ├── snapas-client.ts
│   │   └── writeas-client.ts
│   ├── utils/              # Utilities
│   │   ├── auth.ts
│   │   └── file-handler.ts
│   ├── constants.ts        # Configuration constants
│   ├── index.ts            # MCP server entry point
│   ├── schemas.ts          # Zod validation schemas
│   └── types.ts            # TypeScript types
├── package.json
├── tsconfig.json
└── vitest.config.ts

API References

License

AGPL-3.0-or-later

Contributing

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