mcp image downloader
Enables AI assistants to download images from URLs and perform basic image optimization tasks.
Enables AI assistants to download images from URLs and perform basic image optimization tasks.
An MCP server that provides tools for downloading and optimizing images. Built using the Model Context Protocol (MCP), this server enables AI assistants to download images from URLs and perform basic image optimization tasks.
# Clone the repository
git clone https://github.com/qpd-v/mcp-image-downloader.git
cd mcp-image-downloader
# Install dependencies
npm install
# Build the project
npm run build
Add the server to your MCP configuration (e.g., in Claude Desktop's config):
{
"mcpServers": {
"image-downloader": {
"command": "node",
"args": ["/path/to/mcp-image-downloader/build/index.js"]
}
}
}
Downloads an image from a URL to a specified path.
Parameters:
- url
: URL of the image to download
- outputPath
: Path where to save the image
Creates an optimized version of an image.
Parameters:
- inputPath
: Path to the input image
- outputPath
: Path where to save the optimized image
- width
(optional): Target width (maintains aspect ratio if only width is specified)
- height
(optional): Target height (maintains aspect ratio if only height is specified)
- quality
(optional): JPEG/WebP quality (1-100)
# Run in development mode
npm run start
# Build the project
npm run build
MIT License - see the LICENSE file for details.
qpd-v
0.1.0 - Initial release
[
{
"description": "Download an image from a URL to a specified path",
"inputSchema": {
"properties": {
"outputPath": {
"description": "Path where to save the image",
"type": "string"
},
"url": {
"description": "URL of the image to download",
"type": "string"
}
},
"required": [
"url",
"outputPath"
],
"type": "object"
},
"name": "download_image"
},
{
"description": "Create an optimized version of an image",
"inputSchema": {
"properties": {
"height": {
"description": "Target height (maintains aspect ratio if only height is specified)",
"type": "number"
},
"inputPath": {
"description": "Path to the input image",
"type": "string"
},
"outputPath": {
"description": "Path where to save the optimized image",
"type": "string"
},
"quality": {
"description": "JPEG/WebP quality (1-100)",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"width": {
"description": "Target width (maintains aspect ratio if only width is specified)",
"type": "number"
}
},
"required": [
"inputPath",
"outputPath"
],
"type": "object"
},
"name": "optimize_image"
}
]