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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mcp-image-size

v1.0.1

Published

A Model Context Protocol (MCP) service for retrieving image dimensions, supporting both URL and local file sources.

Downloads

8

Readme

Image Size MCP

A Model Context Protocol (MCP) service for retrieving image dimensions, supporting both URL and local file sources.

中文文档

Features

  • Retrieve image dimensions from URLs
  • Get image dimensions from local files
  • Returns width, height, type, and MIME type information

Installation

npm install image-size-mcp

Usage

Using as an MCP Service

This service provides two tool functions:

  1. get_image_size - Get dimensions of remote images
  2. get_local_image_size - Get dimensions of local images

Client Integration

To use this MCP service, you need to connect to it from an MCP client. Here are examples of how to integrate with different clients:

Using with Claude Desktop

  1. Install Claude Desktop from claude.ai/download
  2. Configure Claude Desktop to use this MCP server by editing the configuration file:
{
  "mcpServers": {
    "image-size": {
      "command": "npx",
      "args": ["image-size-mcp"]
    }
  }
}
  1. Restart Claude Desktop
  2. Ask Claude to get image dimensions: "Can you tell me the dimensions of this image: https://example.com/image.jpg?"

Using with MCP Client Library

import { McpClient } from "@modelcontextprotocol/client";

// Initialize the client
const client = new McpClient({
  transport: "stdio" // or other transport options
});

// Connect to the server
await client.connect();

// Get image dimensions from URL
const urlResult = await client.callTool("get_image_size", {
  options: {
    imageUrl: "https://example.com/image.jpg"
  }
});
console.log(JSON.parse(urlResult.content[0].text));
// Output: { width: 800, height: 600, type: "jpg", mime: "image/jpeg" }

// Get image dimensions from local file
const localResult = await client.callTool("get_local_image_size", {
  options: {
    imagePath: "D:/path/to/image.png"
  }
});
console.log(JSON.parse(localResult.content[0].text));
// Output: { width: 1024, height: 768, type: "png", mime: "image/png", path: "D:/path/to/image.png" }

Tool Schemas

get_image_size

{
  options: {
    imageUrl: string // URL of the image to retrieve dimensions for
  }
}

get_local_image_size

{
  options: {
    imagePath: string // Absolute path to the local image file
  }
}

Technical Implementation

This project is built on the probe-image-size library for image dimension detection.

License

MIT